git设置全局代理或单域名代理

查看git设置

git config --global --list

设置全局代理,使用 http 代理

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

设置全局代理,使用socks5代理

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

取消全局代理

git config --global --unset http.proxy
git config --global --unset https.proxy

只对 github.com 使用代理

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

取消 github.com 代理

git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy
最后修改:2023 年 08 月 07 日 10 : 28 AM
如果觉得我的文章对你有用,请随意赞赏

发表评论