git push origin -- connection reset/ connect Timed out

环境:

Win10

 

 

解决过程描述:

可以正常登录GitHub,执行git clone,但是执行git push origin xxbranch提示:

Connection was reset in connection to github.com:443

使用git clone SSL 报错中使用方法设置:

git config --global http.sslVerify false

后再次push,报错提示变成:

Failed to connect to github.com port 443: Timed out

使用Win10 Time out + 分析中的方法设置:

git config --global http.proxy 127.0.0.1:1080

再次push,成功。

成功方案复述:

Win10 Time out + 分析

环境为:

代理设置界面中「使用设置脚本」是打开的,通过脚本地址下载「pac」文件,在 「pac」中找到 「proxy」的值,「github.com」也位列其中,分析为代理导致的问题。

分析:

需要将「proxy」的值设置为 git 的 http.proxy 的值,设置参数可以通过下列两个 git 命令完成。

git config --global http.proxy 127.0.0.1:1080 为全局的 git 项目都设置代理

git config --local http.proxy 127.0.0.1:1080 为某个 git 项目单独设置代理

posted @ 2022-03-25 01:34  YSMY  阅读(100)  评论(0编辑  收藏  举报