git:Could not read from remote repository

issue

  • 链接 github 时,总是出现错误提示
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

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

环境

  • windows 7 64bit
  • git version: git version 2.8.3.windows.1

结论

经过调查发现,在C:\Users\xxx\.ssh\config中的配置出现了问题,HostName 应配置为 ssh.github.com,不要漏掉 ssh.
以下是完整配置(IdentityFile 需自行指定)

Host github.com
    User git
    HostName ssh.github.com
    Port 443
    IdentityFile /C/Users/xxx/.ssh/id_rsa
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容