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 git@github.com`测试一下 出现如下 问题就解决了  

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

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值