【問題1】:每天git push代碼都好好的,今天也不知道為啥,傲嬌起來了,報了這樣一個錯誤:No supported authentication methods available(server sent:pubickey),然後就來問度娘了,一位網友提供了如下解決方法:
将Tortoise預設的SSH用戶端修改為Git服務的SSH用戶端,即
D:\software\TortoiseGit\bin\TortoiseGitPlink.exe
修改為
D:\software\Git\usr\bin\ssh.exe
。
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIiZpdmL3YzN4ATM1YTM2EDNwEjMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.gif)
恩,“沒有認證方法”的問題解決了,又來問題了:fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists,但是我明明在github裡配置了ssh key啊,于是另一個網友又提供了解決方法:把
.ssh
目錄下的
known_hosts
檔案删除。
最終,可以push代碼了。
【問題2】:IDEA中使用git push代碼時遇到如下報錯:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:xnm0q+BqBcS4V4hbst3zE9U7AabUGi5RquzA5kP/bfk.
Please contact your system administrator.
Add correct host key in /c/Users/admin/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/admin/.ssh/known_hosts:1
RSA host key for [git.imooc.com]:80 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.
删除
C:\Users\admin\.ssh
目錄下的
known_hosts
即可。