1. 设置scoks代理

全局配置代理

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

当前项目文件夹内

 git config  --local http.proxy socks5://127.0.0.1:10808
 git config  --local https.proxy socks5://127.0.0.1:10808

2.设置http代理

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

当前项目文件夹内

 git config  --local http.proxy http://127.0.0.1:1081
 git config  --local https.proxy https://127.0.0.1:1081

取消代理设置

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

修改 config 文件(推荐)

打开目录下 .git 文件夹

找到 config文件

在后面添加两行

[http]
	proxy = socks5://127.0.0.1:10808
[https]
	proxy = socks5://127.0.0.1:10808

同理,清除代理就是把这两行删掉

全局配置的设置 在 用户文件夹下(C:\Users\yourname) .gitconfig 文件中,

相关文章:

  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-03-07
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
相关资源
相似解决方案