git push失败:Could not read from remote repository

问题描述
$ git push
Connection reset by ip-address port 22
fatal: Could not read from remote repository.

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

另外,在C:\Users\Administrator.ssh\里面的known_hosts文件里面有几个ip-address,不知道怎么生成的。

我的解决方法

删除C:/Users/Administrator/.ssh/里面的known_hosts文件,然后重新生成id_rsa.pub里面的SHH key,我之前有了,就覆盖掉原本的:Overwrite (y/n)? yes,其他一路enter,最后把id_rsa.pub里面新的key给配置到GitHub里面即可。

$ ssh-keygen -t rsa -C "username"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
/c/Users/Administrator/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:GG8cUu3D0RHGrFgeiHbA3CaWyijxSxYuZ3HkwV6fleo qinmeizhen
The key's randomart image is:
+---[RSA 3072]----+
|   ooo.=.o =+o   |
|. o.o.X.= B.+    |
| + B.=o=.X +     |
|o O +  *=.*      |
| B .  ..S  .     |
|  .    .E        |
|                 |
|                 |
|                 |
+----[SHA256]-----+

    昨天晚上解决了,今天早上clone的时候遇到这个问题,然后我直接删掉known_hosts文件,再clone,最后到下面一步时输入yes就可以了。

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

(ps:以后不会每次要这样吧,麻烦,后面有心思的时候再探究一下这到底是什么原因)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值