1. 程式人生 > 其它 >git 配置本地代理

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 檔案中,