git "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

and the repository exists.

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

出现这个问题是因为没有在github账号添加SSH key

解决方法如下:

1.在终端输入。

ssh-keygen -t rsa -C "username" (注:username为你git上的用户名)

上面的username(一般是管理员分配的,自己创建的应该没权限)

如果执行成功。返回

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/username/.ssh/id_rsa):

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): 

首先,说明一下,这里的username是你电脑上的用户名

然后,在这里就是设置存储地址了.我们直接按回车(一直按回车就行),会出现一下两种情况的一种:

(1)如果正常运行的话,会出现

Enter passphrase (empty for no passphrase):

然后我们直接回车

(2)有的时候我们可能会出现

/Users/your username/.ssh/id_rsa already exists.

Overwrite (y/n)?

这说明你已经设置了存储地址,我们输入“y”覆盖

Overwrite (y/n)? y

回车

上面的任意两种情况之后,会出现

Enter same passphrase again:

再次回车,这时候你会看见:

Your identification has been saved in /Users/username/.ssh/id_rsa.

Your public key has been saved in /Users/username/.ssh/id_rsa.pub.

The key fingerprint is:

58:42:8b:58:ad:4b:b5:b9:6d:79:bf:8c:f9:e2:2b:ed 
username

The key‘s randomart image is:

+--[ RSA 2048]----+

|    ...          |

|   o oo.         |

|  . .ooo.        |

|    o o+         |

|   . ..oS.       |

|    . . + .      |

|       . o .     |

|        . o+.    |

|         +E++.   |

+-----------------+

这说明SSH key就已经生成了。文件目录就是:/Users/username/.ssh/id_rsa.pub.

我们执行cat命令查看文件的内容:

cat /User/username/.ssh/id_rsa.pub

这时候会看见:

ssh-rsa AAAAB3NzaC1yc2。。。。。。。。。

后面的内容我省略了

(说明:ssh-rsa 后面的内容这就是你的SSH keys)

把显示出来的SSH
keys直接添加到github账户设置里边的SSH keys(全部的秘钥包括ssh-rsa以及后面所有的)

最后再执行git clone命令就可以了

原文地址:https://www.cnblogs.com/yw-ah/p/8508304.html

时间: 2024-10-17 17:54:24

git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案的相关文章

git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.

Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repositor

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

第一次提交遇到这样的情况,怎么回事呢,我在github上提交了ssh key 的啊. 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 host :    sudo vi /etc/hosts  (添加下面第三行) 127.0.0.1 localhost localhost.localdomain VM-0-6-ubuntu 127.0.1.1 TENCENT 192.30.255.113 github.com # 添加ip # The followi

git "Could not read from remote repository.Please make&n

git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案 标签: git 2015-09-28 17:55 11492人阅读 评论(0) 收藏 举报  分类: git(2)  版权声明:本文为博主原创文章,未经博主允许不得转载. 我们在使用Git clone 或其他命令的时候,有时候会遇到这类问题,如图: fatal: Could not re

git Could not read from remote repository 解决

错误: fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 解决办法: [email protected] /f/gitrepo/TestJedis (master) $ git remote

windows 部署 git 服务器报 Please make sure you have the correct access rights and the repository exists.错误

这两天在阿里云上弄windows 服务器,顺便部署了一个git服务.根据网上教程一步步操作下来,最后在 remote远程仓库的时候提示 fatal: 'yourpath/test.git' does not appear to be a git repositoryfatal: Could not read from remote repository. Please make sure you have the correct access rightsand the repository e

git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”

对于git的提交一直很小心翼翼,感觉一不小心就会踩到莫名的坑. 这不, 某天commit 就遇到了On branch master nothing to commit (working directory clean) 一查意思.你的分支很干净? 干净?excuse me? 然后git push origin master一下,漫长等待了弹出了fail:#¥%@(此处省略,我们看重点) Please make sure you have the correct access rights and

(转)git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”

对于git的提交一直很小心翼翼,感觉一不小心就会踩到莫名的坑. 这不, 某天commit 就遇到了On branch master nothing to commit (working directory clean) 一查意思.你的分支很干净? 干净?excuse me? 然后git push origin master一下,漫长等待了弹出了fail:#¥%@(此处省略,我们看重点) Please make sure you have the correct access rights and

[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 另外

git clone的时候遇到“Please make sure you have the correct access rights and the repository exists”

1.搜索.ssh文件,删除该文件下的known_hosts文件 2.运行Git Bash,输入命令ssh-keygen -t rsa -C "username",然后一路回车 3.在.ssh文件夹里找到 id_rsa.pub文件,打开,全部复制,然后登录 https://github.com/,找到settings,配置 SSH keys 将之前复制的id_rsa.pub文件里的所有内容黏贴在下面 4.最后运行Git Bash,输入命令ssh -T [email protected]