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