设置本地代理
1 2 3 4 5 6 7 8 9 10 11
| # 设置HTTP代理 git config --global http.proxy http://127.0.0.1:1080
# 设置HTTPS代理 git config --global https.proxy http://127.0.0.1:1080
# 重置HTTP代理 git config --global --unset http.proxy
# 重置HTTPS代理 git config --global --unset https.proxy
|
如果你使用的是ss,则需要将协议换为socks5
1 2 3
| git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
|
针对特定网址设置代理
1 2 3 4 5
| # 针对特定网址,例如:Github git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
# 取消代理 git config --global --unset http.https://github.com.proxy
|
------------- 本文结束 感谢您的阅读 -------------