上传本地代码到GitEE报错:
git@gitee.com: Permission denied (publickey). Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
原因分析:
Permission denied (publickey) 没有权限的publickey(公锁) ,出现这错误一般是以下两种原因:
客户端与服务端未生成 ssh key
客户端与服务端的ssh key不匹配
找到问题的原因了,解决办法也就有了,重新生成一次ssh key ,服务端也重新配置一次即可。
1、生成本地公钥:
1、打开git bash,输入:ssh-keygen -t rsa -C “你的邮箱”,然后回车三次。
ssh-keygen -t rsa -C "个人邮箱"
2、执行命令:$ cat ~/.ssh/id_rsa.pub 查看生成的公钥:
cat ~/.ssh/id_rsa.pub
将获取到的所有内容全部复制。
2、Gitee添加公钥
1、打开个人设置
2、找到打开ssh公钥的标签页,将标题和公钥内容填写确定保存即可。
到此即可完成所有设置,可以畅快地上传本地代码到GitEE仓库了。