SSH金鑰設定 解決:Please make sure you have the correct access rights and the repository exists
# 遇到訊息
1 | Please make sure you have the correct access rights and the repository exists |
設定 SSH 金鑰
step:
重設git
的設定識別資料
設定
1 | git config --global user.name "Luke Lin" |
查看
1 | git config user.name |
刪除 .ssh
資料夾
在Finder
文件夾中,按command-shift + G
。 搜尋 ~/.ssh
刪除找到的known_hosts
檔案,刪除對其他主機的密鑰檢查,之後 ssh 將再次重新創建文件。
生成密鑰
1 |
|
接著會看到
1 | # Generating public/private rsa key pair. |
直接按 enter 即可
接著.ssh
檔案夾會產生 id_rsa
、 id_rsa.pub
這兩支檔案
按id_rsa.pub
右鍵,打開檔案的應用程式 => 文字編輯(預設值)
複製全部內容
設定SSH keys
到 SSH keys settings 裡,找到SSH and GPG keys
=> New SSH key
把剛剛id_rsa.pub
的內容複製到key
內容裡,按下add SSH key
回到 git
輸入
1 | ssh -T git@github.com |
輸入: yes
完成 SSH 金鑰設置,接下來就可以重新提交檔案了