美文网首页
Github无法push代码报Connection closed

Github无法push代码报Connection closed

作者: 齐格Insight | 来源:发表于2024-09-16 12:36 被阅读0次

    背景

    突然间代码 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

    相关文章

      网友评论

          本文标题:Github无法push代码报Connection closed

          本文链接:https://www.haomeiwen.com/subject/bvniljtx.html