为 git 设定 socks5 代理

为 git 设定 socks5 代理

查看当前设定

git config --global -l

为 git 设定全局代理

git config --global http.proxy socks5h://127.0.0.1:1080
git config --global https.proxy socks5h://127.0.0.1:1080

其中127.0.0.1:1080为你所使用的代理服务器IP地址及端口。这里我使用的是 ShadowsocksR 默认本地端口。

只对 GitHub 设定全局代理

git config --global http.https://github.com.proxy socks5h://127.0.0.1:1080
git config --global https.https://github.com.proxy socks5h://127.0.0.1:1080

取消设定

git config --global --unset http.proxy
git config --global --unset https.proxy
posted @ 2020-02-01 11:01  skylee03  阅读(1200)  评论(0编辑  收藏  举报