Git到GitHub仓库连接超时的解决办法

发布于 2024-07-18  197 次阅读


Please refresh the page if equations are not rendered correctly.
---------------------------------------------------------------

问题

即使使用了VPN,采用Git同步代码到GitHub仓库时也会总是出现连接超时,提示如下:

BY@LAPTOP-MRBN72D4 MINGW64 /d/04_coding/Python/07_CLT (main)
$ git push
fatal: unable to access 'https://github.com/binyang424/CLT.git/': Failed to connect to github.com port 443 after 21077 ms: Couldn't connect to server

解决方法

网络和Internet/代理窗口,点击编辑使用代理服务器。

记下下图中的代理ip地址和端口号:

打开git bash,执行:

git config --global http.proxy http://127.0.0.1:7890

如果想要检查代理是否设置成功,执行:

git config --global -l

返回值中应包含设置的代理ip。这是应该不会再出现超时的问题了。该方案来自【完美解决】GitHub连接超时问题 Recv failure: Connection was reset_github请求超时

Everything not saved will be lost.
最后更新于 2024-07-18