更換倉庫地址後,git fetch origin master報錯

1.問題描述:

今天服務器遷移了下git,因而就直接根據拷貝後的git repo建立了遠程倉庫,原本一切都很順利。 git

服務器端執行命令報錯。記錄下解決過程 vim

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
相關文章
相關標籤/搜索