转自:https://zhiku8.com/git-could-not-read-from-remote-repository.html

我们在使用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上的用户名)

如果执行成功。返回

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

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

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

  1. 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 ...

  2. 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 hos ...

  3. 【git 报错】Could not read from remote repository.Please make sure you have the correct access rights.

    我们在使用git clone 或其他命令的时候,有时候会遇到这类问题,如图: and the repository exists. fatal: Could not read from remote ...

  4. 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 :    ...

  5. 关于github报错:ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

    当执行git命令如:git clone.git pull等等 出现报错:ssh: connect to host github.com port 22: Connection timed outfat ...

  6. 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. ...

  7. git Could not read from remote repository 解决

    错误: fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote reposit ...

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

    这两天在阿里云上弄windows 服务器,顺便部署了一个git服务.根据网上教程一步步操作下来,最后在 remote远程仓库的时候提示 fatal: 'yourpath/test.git' does ...

  9. Git push提交时报错Permission denied(publickey)...Please make sure you have the correct access rights and the repository exists.

    一.git push origin master 时出错 错误信息为: Permission denied(publickey). fatal: Could not read from remote ...

随机推荐

  1. ios 导航栏 点击barbutton的按钮 下拉列表

    环境:xocde5.0.2+ios7.0.1 1.导航栏 ----点击科目--------下拉列表 代码:NGRightTableViewViewController.h #import <UI ...

  2. iOS~判断应用是否有定位权限

    在特定场景下我们需要判断用户是否允许应用获取定位权限 1.导入类库: #import <CoreLocation/CLLocationManager.h> 2.判断用户手机是否开启了定位服 ...

  3. vue 2.x axios 封装的get 和post方法

    import axios from 'axios' import qs from 'qs' export class HttpService { Get(url, data) { return new ...

  4. PHP魔术方法__tostring()篇

    下面是关于__tostring 的运用 header('Content-type:text/html;charset="utf-8"'); /*存在内置方法_tostring()的 ...

  5. UVa 11292 The Dragon of Loowater 【贪心】

    题意:有一条有n个头的恶龙,有m个骑士去砍掉它们的头,每个骑士可以砍直径不超过x的头,问怎样雇佣骑士,使花的钱最少 把头的直径从小到大排序,骑士的能力值也从小到大排序,再一个一个地去砍头 #inclu ...

  6. Pyhton学习——Day27

    # hasattr(obj,'name')-->obj.name# getattr(obj,'name',default = 'xxx')--->obj.name# setattr(obj ...

  7. [分享]前端javascript插件(均开源)

    记录并分享一些自己使用过的插件,便于以后有相应的功能需要使用可以及时想到. 1:数字插件countUp.js 功能:用于动态显示数字的增加和减少 项目github地址:http://inorganik ...

  8. ajax中遇到无法发送的问题,以及收不到返回信息的问题

    1.在做ajax时,数据发送成功,后台确认了也返回了信息,但是怎么都在success里面接收不了,我遇见的造成的原因时因为dataType返回值类型错误造成的原因. var url = "请 ...

  9. 对于 wepy 不是内部或外部命令 -- 的解决办法

    闲来没事继续研究自己之前一直未解决的问题,  就是自己笔记本安装wepy-cli,一直提示"wepy 不是内部或外部命令". 因为公司里面用的是这个框架, 想着自己在家没事的时候去 ...

  10. Vue中的坑

    今天给大家总结了Vue中的坑,都是平常踩到的,希望对大家有所帮助 1.vuex的一个“坑” 报错原因:在使用Vuex的时候在main.js中引入的时候对名字的大小写有区别 解决法案: 错误写法: 正确 ...