[Git]Please make sure you have the correct access rights and the repository exists
Posted Mr.do
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Git]Please make sure you have the correct access rights and the repository exists相关的知识,希望对你有一定的参考价值。
这个问题是这样,需要在已有github账号的A机器上,再创建一个github账号,新账号创建完毕,将代码通过机器A push上之后,再另一台机器B,clone 这个项目时报出了如下错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
解决方式是:
在clone代码的时候要使用https的形式。
https://github.com/accountName/projectname.git
另外,在机器A上配置两个git账户,需要重新生成sshkey,并且要将这两个github账户的ssh文件进行区分 id_rsa_old / id_rsa_new ,其次要通过配置文件对这两个账号进行配置,在使用的时候切换比较方便。
类似的教程,网上资源很多,多参考几个文档即可。
以上是关于[Git]Please make sure you have the correct access rights and the repository exists的主要内容,如果未能解决你的问题,请参考以下文章