使用git clone命令从github上同步github上的代码库时,如果使用SSH链接,系统会报下面的错误

fatal: Could not read from remote repository. Please make sure you have the correct access rights

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没有添加到github帐号设置中


解决:

需要在本地创建SSH key,然后将生成的SSH key文件内容添加到github帐号上去。创建SSH key的方法很简单。

生成SSH公钥

fatal: Could not read from remote repository. Please make sure you have the correct access rights


接着拷贝.ssh/id_rsa.pub文件内的所以内容,将它粘帖到github帐号管理中的添加SSH key界面中。

打开github帐号管理中的添加SSH key界面的步骤如下:

1. 登录github

2. 点击右上方的settings图标,添加即可

fatal: Could not read from remote repository. Please make sure you have the correct access rights

再进行git clone 操作:

fatal: Could not read from remote repository. Please make sure you have the correct access rights

相关文章:

  • 2021-10-06
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2021-12-25
  • 2018-09-07
  • 2021-10-19
  • 2022-12-23
  • 2021-07-18
  • 2021-12-17
  • 2021-09-23
相关资源
相似解决方案