github上如何fork和clone


在github上你fork了一个项目之后,想clone,但是碰到这个问题:


andy@AndyMacBookPro:/usr/local/webdata$ git clone [email protected]:qdujunjie/yershop.git
Cloning into 'yershop'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


这个可以在本地生成一个ssh 的 rsa 秘钥对


ssh-keygen -t rsa -C "[email protected]"


会让你指定文件,你可以不指定,默认就会声称在 ~/.ssh/ 目录下,然后会提示你输入 passphrase (密码短语) 两次,输入即可。


之后你可以到 ~/.ssh/ 目录下查看自己的 id_rsa.pub 这就是你的公钥。


andy@AndyMacBookPro:~$ ssh -T [email protected]
Hi qdujunjie! You've successfully authenticated, but GitHub does not provide shell access.
andy@AndyMacBookPro:~$


你可能感兴趣的:(github上如何fork和clone)