git克隆项目报错

2019-02-02  本文已影响0人  seven_3a2d

git clone git@github.com:peiyunh/文件名

当执行此命令,出现如下错误

Permissiondenied (publickey).

fatal:Could not read from remote repository.

Pleasemake sure you have the correctaccess rightsand the repository exists.

在本地或者服务器上没有上没有生成ssh key

1、可以先查看是否有id_rsa和id_rsa.pub文件,没有的话

2输入命令ssh-keygen -t rsa -C"邮箱"  一路回车即可,会生成你的ssh key

3、ssh -v git@github.com

4、ssh-agent-s

5、ssh-add ~/.ssh/id_rsa  如果出现错误提示Could not open a connection to your authentication agent.

6、执行命令 eval `ssh-agent -s`   在执行ssh-add ~/.ssh/id_rsa   应该就没问题了

7、打开你刚刚生成的id_rsa.pub将里面的内容复制到你的码云账号中公匙中,ok

8、在执行git clone git@github.com:peiyunh/文件名  ,下载你的代码

上一篇 下一篇

猜你喜欢

热点阅读