更换仓库地址后,git fetch origin master报错

1.问题描述:

今天服务器迁移了下git,于是就直接根据拷贝后的git repo创建了远程仓库,本来一切都很顺利。

服务器端执行命令报错。记录下解决过程

2.执行命令报错

$ git fetch origin master
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
50:a9:7a:a2:e6:cc:ae:ea:99:d0:f1:6e:ee:fa:e6:1e.
Please contact your system administrator.
Add correct host key in /c/Users/Administrator/.ssh/known_hosts to get rid of th
is message.
Offending key in /c/Users/Administrator/.ssh/known_hosts:13
RSA host key for 192.168.20.85 has changed and you have requested strict checkin
g.
Host key verification failed.
fatal: Could not read from remote repository.


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

3.解决方法:


vim  /c/Users/Administrator/.ssh/known_hosts



删除 known_hosts里面关于访问ip地址相关的 信息,保存退出即可。


4.重新执行fetch命令


$ git fetch origin master
The authenticity of host '192.168.20.85 (192.168.20.85)' can't be established.
RSA key fingerprint is 50:a9:7a:a2:e6:cc:ae:ea:99:d0:f1:6e:ee:fa:e6:1e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.20.85' (RSA) to the list of known hosts.
git@192.168.20.85's password:
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
From 192.168.20.85:/home/repo/project/
 * branch            master     -> FETCH_HEAD





转载于:https://my.oschina.net/dlpinghailinfeng/blog/342637

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值