git clone git@github.com:peiyunh/文件名
當(dāng)執(zhí)行此命令,出現(xiàn)如下錯(cuò)誤
Permissiondenied (publickey).
fatal:Could not read from remote repository.
Pleasemake sure you have the correctaccess rightsand the repository exists.
在本地或者服務(wù)器上沒(méi)有上沒(méi)有生成ssh key
1、可以先查看是否有id_rsa和id_rsa.pub文件,沒(méi)有的話
2輸入命令ssh-keygen -t rsa -C"郵箱"? 一路回車即可,會(huì)生成你的ssh key
3、ssh -v git@github.com
4、ssh-agent-s
5、ssh-add ~/.ssh/id_rsa? 如果出現(xiàn)錯(cuò)誤提示Could?not?open?a?connection?to?your?authentication?agent.
6、執(zhí)行命令 eval `ssh-agent -s`?? 在執(zhí)行ssh-add ~/.ssh/id_rsa?? 應(yīng)該就沒(méi)問(wèn)題了
7、打開(kāi)你剛剛生成的id_rsa.pub將里面的內(nèi)容復(fù)制到你的碼云賬號(hào)中公匙中,ok
8、在執(zhí)行g(shù)it clone git@github.com:peiyunh/文件名? ,下載你的代碼