Git clone項目時候報錯

clone 項目時候報錯

Cloning into 'xxx new'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for git.xxxxx.com has changed,
and the key for the corresponding IP address 172.20.107.213
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:b9CCBpNyA1vDh4avmXzqgxZczo8u2bHE6/HjeZb18BQ.
Please contact your system administrator.
Add correct host key in /c/Users/GetOn/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/GetOn/.ssh/known_hosts:4
RSA host key for git.xxxxx.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

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

多次更新不下來項目

  1. 刪除.ssh文件夾(直接搜索該文件夾)下的known_hosts(手動刪除即可,不需要git)

  2. 在下載好的Git中的bin目錄下打開bash.exe輸入命令ssh-keygen -t rsa -C “username” (注:username爲你git上的用戶名),如果執行成功。返回:

    Generating public/private rsa key pair.
    Enter file in which to save the key (/Users/username/.ssh/id_rsa):

//這裏的username是電腦上的用戶名,這個地址也是文件的存儲地址,然後我們按回車,如果你以前有存儲地址會返回/Users/your username/.ssh/id_rsa already exists.Overwrite (y/n)?直接輸入y回車。如果以前沒有儲存地址就會出現 Enter passphrase(empty for no passphrase);也直接回車,兩種情況回車後都會出現 Enter same passphrase again 然後接着回車會顯示一長串內容其中還有一些…o… o oo .oS. 之類的代碼,這說明SSH key就已經生成了。文件目錄就是:username/.ssh/id_rsa.pub.

  1. 然後找到系統自動在.ssh文件夾下生成兩個文件,id_rsa和id_rsa.pub,用記事本打開id_rsa.pub將全部的內容複製。

  2. 打開https://github.com/,登陸你的賬戶,進入設置(Settings)找到

  3. 然後將你複製的內容粘貼到key中

ok還有最後一步

  1. 仍然在bash.exe中輸入

    ssh -T [email protected]
    

然後會跳出一堆內容你只需輸入yes回車就完事了,然後他會提示你成功了。
然後你就可以正常使用git clone命令了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章