github无法连接的问题

github经常处于无法访问的状态,此时在cmd中ping github.com也是ping不通的,如果使用git clone/git pull/git push
等命令也会失败
此时配置代理即可:

git config --global http.proxy http://127.0.0.1:1080
git config --global http.proxy https://127.0.0.1:1080

最后面的端口号根据实际情况填写,查看位置(win11):设置-网络和internet-代理-手动设置代理-设置。

启动代理服务器后,执行git操作就可以正常进行了。没有开启代理的时候,使用代理服务器的开关是关闭着的,此时也无法执行git操作,执行git操作会报错:

Failed to connect to 127.0.0.1 port 1080: Connection refused

去除git代理设置的方法是

git config --global --unset http.proxy
git config --global --unset https.proxy
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐