主页

运行 git push origin main:main 一直报错说: unable to connect to github.com:

2023-10-14 09:20AM

运行 git push origin main:main 一直报错说:

$ git push origin main:main
fatal: unable to connect to github.com:
github.com[0: 20.205.243.166]: errno=Connection timed out

原因:需要用https才能读到数据 

可以使用下面这个命令:

git config --global url."https://github.com".insteadOf git://github.com

然后在重新运行 git push origin main:main

可能会报错说:

$ git push origin main:main
Username for 'https://github.com': xxxxxx
Password for 'https://xxxxx@github.com': 
fatal: unable to access 'https://github.com/xxxxxx/blog.git/': Error in the HTTP2 framing layer

再重新运行一次就可以了

$ git push origin main:main
Username for 'https://github.com': xxxxxx
Password for 'https://xxxxx@github.com': 
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 4 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 1.30 KiB | 1.30 MiB/s, done.
Total 16 (delta 14), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (14/14), completed with 9 local objects.
To https://github.com/xxxxx/blog.git
   78d500d..781b0cc  main -> main

返回>>

登录

请登录后再发表评论。

评论列表:

目前还没有人发表评论