安裝完git后想從Git庫中克隆項目,需要先生成密鑰,否則會提示:Please make sure you have the correct access rightsand the repository exists 或Permission de
解決方法如下:
?進入https://github.com/settings/profile查看自己的賬號和郵箱,記到記事本下來,下面會用到。
? 打開Git輸入命令
? ? ? ? ? ? ? git config –global? user.name? ?“yourname”? ?回車?
? ? ? ? ? ? ? git config –global user.email? ?“your@email.com”? ?回車?
? ? ? ? ? ? ? $ ssh-keygen -t rsa -C “your@email.com”(請?zhí)钅阍O置的郵箱地址)回車
會出一些提示,無視這些一直點回車請繼續(xù)直接按下回車
直到出現(xiàn)?
The key’s randomart image is:?
+—[RSA 2048]—-+?
| ==++. . |?
| . ++.o . .|?
| ..o++Oo |?
然后去save?目錄下打開id_rsa.pub,復制里面內容。注意要復制全部內容包含ssh-rsa等開頭
進入自己的賬號https://github.com/settings/keys?點擊 New sshKey 。
復制的內容粘貼到Key里,點擊Add SSH Key按鈕添加成功即可
