Git---“Please make sure you have the correct access rights and the repository exists.”

問題:

            Update failed
            remote:
            remote: ========================================================================
            remote:
            remote: The project you were looking for could not be found.
            remote:
            remote: ========================================================================
            remote:
            Could not read from remote repository.
            
            Please make sure you have the correct access rights and the repository exists.

ssh key有問題,連接不上服務器~~

解決辦法:

1、進入到項目所在的文件夾底下,打開git Bash,重新在git bash設置一下身份的名字和郵箱(如果記得自己的,就不需要重新設置了)

git config --global user.name "name"

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

注意:name是你要設置的名字,[email protected]是你要設置的郵箱。

 

2、手動刪除.ssh文件夾(一般在C:\Users\GY\.ssh,沒有的話,直接搜索該文件夾)下的known_hosts。

 

3、git輸入命令    $ ssh-keygen -t rsa -C "[email protected]"(請填你設置的郵箱地址)

 

4、出現:

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):

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

 

5、打開https://github.com/,登陸你的賬戶,進入ssh設置

在key中將剛剛複製的粘貼進去

點擊add ssh key,

添加權限成功ok!

 

6、在git中輸入命令:ssh -T [email protected] 然後輸入命令:yes,回車,然後就會提示成功了。

最後退出git重新進入路徑提交、更新項目就可以了。

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