Git 设置代理和取消设置代理

设置 http 代理

  • socks5 协议代理
git config --global http.proxy 'socks5://127.0.0.1:10808'
git config --global https.proxy 'socks5://127.0.0.1:10808'
  • http / https 协议代理
git config --global http.proxy 'http://127.0.0.1:10809'
git config --global https.proxy 'https://127.0.0.1:10809'

取消设置 http 代理

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

查看代理设置

最终设置的结果保存在: ~/.gitconfig 文件中.

[http]
        proxy = socks5://127.0.0.1:10808
[https]
        proxy = socks5://127.0.0.1:10808
原文地址:https://www.cnblogs.com/crayonsea/p/14766184.html