git 配置本地代理

git 配置本地代理

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 文件中,

posted @ 2021-07-08 19:19  Pursue`  阅读(1218)  评论(0编辑  收藏  举报