报错git@gitee.com: Permission denied (publickey).

前言:今天在windows下git push代码到gitee的时候,报错:

$ git push
git@gitee.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

 

原因:我电脑重装过了,可能ssh key变了

 

解决:

打开win10系统当前用户目录下的.ssh隐藏目录,把id_rsa.pub里面内容粘贴到gitee上面的公钥,然后提交代码就可以了

 

 

 

posted @ 2022-05-11 10:09  lucky_tomato  阅读(580)  评论(0编辑  收藏  举报