【IDEA-gitee】Permission denied (publickey). fatal: Could not read from remote repository

在IDEA中从Gitee拉取代码时出现这种问题,于是搜到了下面这篇文章,成功解决

原文地址:Permission denied (publickey). fatal: Could not read from remote repository.

Git clone [email protected]:账户 /项目.git

上面以SSH方式访问用项目出现权限问题

Permissiondenied (publickey).

fatal:Could not read from remote repository.

Pleasemake sure you have the correct access rights

andthe repository exists.

 

解决方法:

在git.bash.窗口输入

ssh-******–t rsa –c”你的邮箱地址”

ssh-****** -t rsa -C "邮箱地址"

然后一直回车就行

操作成功后会在

C:\Users\Administrator目录下生成一个.ssh目录,内容如下

【IDEA-gitee】Permission denied (publickey). fatal: Could not read from remote repository

Id-rsa是你的私钥,用笔记本方式打开id_rsa.pub把里面的公钥复制到coding.net的账户下面的SSH公钥下

【IDEA-gitee】Permission denied (publickey). fatal: Could not read from remote repository

然后重新输入

Git clone [email protected]:账户 /项目.git就OK了

【IDEA-gitee】Permission denied (publickey). fatal: Could not read from remote repository