[email protected]: Permission denied . fatal: Could not read from remote repository.

使用github克隆文件的时候,如出现以下问题:
[email protected]: Permission denied . fatal: Could not read from remote repository.

首先检查有没有在GitHub的https://github.com/settings/keys上添加你本机的SSH key。 添加SSH key的方法:
在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有id_rsa和id_rsa.pub这两个文件,私钥地址是C:\Users\(你电脑的名字)\.ssh,如果有pub,进入第二步。
[email protected]: Permission denied . fatal: Could not read from remote repository.

第2步:登陆GitHub,打开“Account settings”,“SSH Keys”页面:
[email protected]: Permission denied . fatal: Could not read from remote repository.
然后,点“Add SSH Key”,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容:
点“Add Key”,你就应该看到已经添加的Key。

如果还是不行,有可能git仓库并没有和这个SSH key 关联上。用下述方法解决:
ssh -add “C:\Users\(你电脑的名字)\.ssh
注意这里ssh-add后面填的是私钥地址,如mac电脑是 /Users/用户名/.ssh/id_rsa

此时可以尝试用克隆命令去克隆你想要的文件啦!
git clone (需要克隆的文件地址)

相关文章:

  • 2022-12-23
  • 2021-08-01
  • 2021-09-23
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
猜你喜欢
  • 2021-04-10
  • 2021-07-10
  • 2021-04-01
  • 2021-12-08
相关资源
相似解决方案