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