Github无法push代码报Connection closed

2024-09-16  本文已影响0人  齐格Insight

背景

突然间代码 push 不上去,报如下错误:

Connection closed by 140.82.113.4 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

发现有人也遇到过类似的问题,原因是 22 端口的问题
https://github.com/vernesong/OpenClash/issues/1960#issuecomment-1115732292

image.png

解决

解决方法参考
https://docs.github.com/zh/authentication/troubleshooting-ssh/using-ssh-over-the-https-port

修改 ~/.ssh/config这个文件,添加以下内容

Host github.com
    Hostname ssh.github.com
    Port 443
    User git
image.png

问题解决,可以提交代码

image.png
上一篇下一篇

猜你喜欢

热点阅读