设置代理:
git config --global http.proxy 'http://127.0.0.1:1080'
git config --global https.proxy 'http://127.0.0.1:1080'
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
或者:
git config --local http.proxy 'socks5://127.0.0.1:1080'
git config --local https.proxy 'socks5://127.0.0.1:1080'
查看设置的代理:
git config --global --list
git clone 的时候会走设置的代理。
也可以这么clone:
git clone -c http.proxy=http://127.0.0.1:1080 https://github.com/xxxxx/xxxxx.git
取消代理:
git config --global --unset http.proxy
git config --global --unset https.proxy