新電腦來啦,很高興,hin開森,但是一想到一連串的環境配置,代碼遷移什么的時候就很酸爽,
今日我就碰到了在新電腦clone的時候無法克隆的問題,記錄一下,希望能幫助到有需要的人
報的提示錯誤如下:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists
解決方法:
1.查看你的電腦中的.ssh文件夾中是否存在id_rsa.pub文件 ,在命令行中輸入:type %userprofile%\.ssh\id_rsa.pub
**如果你看到一個長字符串開始ssh-rsa,你可以跳過ssh-keygen的一步。

2.如果沒有那么現在使用以下命令,生成一個新的SSH密鑰:ssh-keygen -t rsa -C "你的git郵箱",然后一直按enter就可以
3.在命令行中再次輸入type %userprofile%\.ssh\id_rsa.pub 然后復制那串以ssh開頭的字符串
4.在github的網頁中找到Profile Settings頁面,並將復制的內容保存到如下的截圖中:

