1. 程式人生 > >Git clone時出現Please make sure you have the correct access rights and the repository exists.問題已解決。

Git clone時出現Please make sure you have the correct access rights and the repository exists.問題已解決。

already 下載 cor 兩個 .com pair 賬戶 same 使用

看了好多資料終於搞定了git 中clone命令報錯這個問題,廢話不多說直接上步驟希望對大家有幫助。

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.

3

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

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

技術分享

5 然後將你復制的內容粘貼到key中

技術分享

再點擊Add SSH Key

ok還有最後一步

6 仍然在bash.exe中輸入ssh -T [email protected]然後會跳出一堆內容你只需輸入yes回車就完事了,然後他會提示你成功了。

然後你就可以正常使用git clone命令了,最後祝你好運哈哈!

Git clone時出現Please make sure you have the correct access rights and the repository exists.問題已解決。