挂VPN推送代码到github上时,遇到Recv failure: Connection was reset这个报错

1,383 阅读1分钟

在推送代码的时候遇到了这样的报错:Recv failure: Connection was reset

image.png

这个错误表明 Git 在尝试通过 HTTPS 协议(默认端口 443)与 GitHub 服务器建立连接时失败了。

所以我们直接使用 git Bash 来修改我们的http 和https的端口这里的 http://127.0.0.1:xxxxx 是指你打算使用的代理服务器的地址和端口号,其中 127.0.0.1 表示本机(localhost),xxxxx 应该替换为你实际使用的代理服务端口号。

image.png

从这里去拿到我们需要的端口号

然后使用

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

再次推送,成功!