为 git 设定 socks5 代理

你说的曾经没有我的故事 提交于 2020-02-01 12:08:18

为 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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!