问题
当我们电脑能够正常访问Github时,但是git拉取代码出现 :
Recv failure: Connection was reset
原因
这是因为使用了特殊上网方法,电脑能够正常访问,但是git通过底层访问需要配置代理才能正常访问
解决办法
配置方法如下:
查看代理地址和端口号:
格式:
git config --global http.proxy http://"IP地址":"端口号"
git config --global https.proxy http://"IP地址":"端口号"示例:
git config --global http.proxy http://192.168.0.1:8000
git config --global https.proxy http://192.168.0.1:8000
如果需要取消使用如下代码:
git config --global --unset http.proxy
git config --global --unset https.proxy