Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
在 git clone 項(xiàng)目時(shí),提示沒(méi)有權(quán)限,不能clone,有以下幾種情況
1、可能是 之前電腦使用過(guò)git ,現(xiàn)在和之前不是同一個(gè)賬號(hào),要重置。
git config --system --unset credential.helper
輸入上面命令后,再次git clone時(shí),會(huì)讓我們重新輸入 username 和 password.
注:設(shè)置 修改 本地 git 賬號(hào)和密碼:
$ git config --global user.name "yourname" $ git config --global user.password "youremail"
2、設(shè)置后 重新 git clone 發(fā)現(xiàn)還是不行。

有可能是公鑰出現(xiàn)問(wèn)題,重新設(shè)置用戶(hù)名和密碼,生成公鑰(這里要記得刪除之前的公鑰)
$ git config --global user.name "yourname" $ git config --global user.password "youremail"
刪除 .ssh 文件夾
路徑:

git 輸入命令
$ ssh-keygen -t rsa -C "youremail"(設(shè)置的郵箱地址)

然后會(huì)生成 .ssh文件夾。
打開(kāi) .ssh文件下的id_rsa.pub 全部復(fù)制,進(jìn)入git ->setting ->ssh key 新增 ssh key即可。
浙公網(wǎng)安備 33010602011771號(hào)