使用代理加速github
一、查看代理端口
二、设置代理
设置socks5代理(推荐)
git config --global http.https://github.com.proxy socks5://127.0.0.1:7897
git config --global https.https://github.com.proxy socks5://127.0.0.1:7897
或者设置http代理
git config --global http.https://github.com.proxy http://127.0.0.1:7897
git config --global https.https://github.com.proxy http://127.0.0.1:7897
三、验证配置
# 查看当前 Git 配置
git config --global --list | grep proxy
# 测试连接
git ls-remote https://github.com/microsoft/vscode.git
四、取消代理
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy