ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repo

项目场景:

今天在push代码的时候git突然报错!!!之前都是正常的,然后在网上查找解决方法,发现都不行!! 就很离谱,让后在github官网上找到解决方法  地址如下:https://gist.github.com/Tamal/1cc77f88ef3e900aeae65f0e5e504794

 但是有些同学可能看不懂 我这里来解释一下!

报错:ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.


不解释原因了直接上解决方法


解决方案

首先右键git bash here

 

然后

输入`vim ~/.ssh/config` 打开配置文件

按下 i 进入插入模式 把下面配置写入 写入后保存退出!

Host github.com
  Hostname ssh.github.com
  Port 443

然后`ssh -T [email protected]`测试一下 出现如下 问题就解决了  

`Hi Xkk1705! You've successfully authenticated, but GitHub does not provide shell access.`