1. 程式人生 > >git下載代碼遇到的‘Please make sure you have the correct access rights and the repository exists’問題

git下載代碼遇到的‘Please make sure you have the correct access rights and the repository exists’問題

log strong nbsp urn 成功 參考 刪除 ron mail

接著昨天的搭建博客,今天想直接把vuepress克隆到我的電腦上,結果出現了問題

忘記截圖了,反正就記得這麽一句話:‘Please make sure you have the correct access rights and the repository exists’

在網上搜索了一下,參考了大神的博客,終於正確改過來了。原博客地址:https://blog.csdn.net/jingtingfengguo/article/details/51892864

我來做一下記錄,省了以後忘記。

出現這個問題是因為ssh key出現問題,連不上服務器

1、重新在git設置一下身份的名字和郵箱

git config --global user.name "yourname"

git config --global user.email ‘[email protected]

2.刪除.ssh文件夾下的know_hosts

註:在C盤用戶文件夾下.ssh,點擊進入,手動刪除know_hosts

3、git輸入命令

$ ssh-keygen -t rsa -C ‘[email protected]

註:填寫自己設置的郵箱地址

填完以後會出現:一直摁回車就好了

技術分享圖片

出現到這塊的時候系統自動在.ssh文件夾下生成兩個文件:id_rsa 和 id_rsa.pub,用記事本打開id_rsa.pub,將其全部復制

打開https://github.com/,登錄自己的賬戶,進入設置

技術分享圖片

點擊New SSH key

技術分享圖片

將id_rsa.pub的內容粘貼到key中

技術分享圖片

5、在git中輸入命令

  ssh -T [email protected]

技術分享圖片

到這步就算是成功了

然後就可以使用git下載啦

技術分享圖片

嚕啦啦……

git下載代碼遇到的‘Please make sure you have the correct access rights and the repository exists’問題