git push出现ssh_dispatch_run_fatal错误

报错信息:

ssh_dispatch_run_fatal: Connection to 52.74.223.119 port 22: Software caused connection abort
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

报错原因

dns解析问题,打开cmd输入ping命令查看对github.com的连接,发现请求超时
git push出现ssh_dispatch_run_fatal错误_第1张图片

解决方法

C:\Windows\System32\drivers\etc下的 hosts 文件中,在末尾添加下面两段文字即可

192.30.255.112  github.com git 
185.31.16.184 github.global.ssl.fastly.net

保存之后再次输入ping命令,成功ping通
git push出现ssh_dispatch_run_fatal错误_第2张图片
再次git push没有问题,亲测有效,特意做个笔记。

参考链接:https://segmentfault.com/a/1190000021795122

你可能感兴趣的:(工具使用及异常处理)