查看当前设定

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

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2021-12-04
  • 2021-08-30
猜你喜欢
  • 2022-01-09
  • 2022-01-29
  • 2021-06-07
  • 2021-10-15
  • 2021-11-09
  • 2021-12-16
相关资源
相似解决方案