github在国内的访问越来越不稳定了,如果出现速度慢,甚至无法连接的情况,可以通过设置代理解决。

具体的方法为
复制复制
复制
#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#取消代理
git config --global --unset http.https://github.com.proxy)
#全部网站代理
git config --global https.proxy socks5://127.0.0.1:1080
#取消全部网站代理
git config --global --unset https.proxy
这里的socke5也可以为http,根据自己的代理情况设置。
127.0.0.1也可以换成其他IP,1080是端口号。