主页

git pull / git push 报错:fatal: 无法连接到 github.com: github.com[0: 20.205.243.166]: errno=连接超时

2026-04-08 07:57PM

我在 git pull 和 git push 的时候报错了

fatal: 无法连接到 github.com

github.com[0: 20.205.243.166]: errno=连接超时

根本原因是我使用的是 git 协议(9418端口)在国内/云服务器环境基本是被封的

$ git remote -v
origin  git://github.com:9418/xxxxxx/test_blog.git (fetch)
origin  git://github.com:9418/xxxxxxx/test_blog.git (push)

解决方法:

1. 修改为 https

git remote set-url origin https://github.com/xxxxxx/test_blog.git

发现又报错了

fatal: unable to access 'https://github.com/007638/test_blog.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

解决方法:

$ git config --global http.version HTTP/1.1
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy 

然后重新拉去,就发现已经可以了 

返回>>

登录

请登录后再发表评论。

评论列表:

目前还没有人发表评论