-
首先確認自己git拉取代碼的方式
git remote -v (以https方式連接遠程倉庫)
origin https://github.com/(fetch)
origin https://github.com/(push) -
設置代理
http
git config --global http.proxy http://127.0.0.1:7890(自己代理的端口號)
git config --global https.proxy https://127.0.0.1:7890(自己代理的端口號)
ssh
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080' -
查看代理是否成功
git config --get --global http.proxy(未設置就沒有返回值)
http://127.0.0.1:7890
4.查看git配置
git config --global --list
- 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy