美文网首页
Git 设置代理

Git 设置代理

作者: faverr | 来源:发表于2020-09-07 23:36 被阅读0次

设置代理

http 代理

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

socks5 代理

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

注意 socks5 代理的默认端口号(1086)与 http 代理的默认端口号(1080)不同

取消代理

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

这里的代理设置是全局的(--global 参数),代理设置会一直生效,代理软件关闭或失效,会导致 git 无法连接,需要取消设置代理使得 git 流量不经过代理。

相关文章

网友评论

      本文标题:Git 设置代理

      本文链接:https://www.haomeiwen.com/subject/srvrektx.html