我们在使用git clone 或其他命令的时候,有时候会遇到这类问题,如图:

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上的用户名)

如果执行成功。返回

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):

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

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

然后我们直接回车

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

Overwrite (y/n)?

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

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

Enter same passphrase again:

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

Your public key has been saved in /Users/
The key fingerprint is:

username

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

|    ...          |

|   o oo.         |

|  . .ooo.        |

|    o o+         |

|   . ..oS.       |

|    . . + .      |

|       . o .     |

|        . o+.    |

|         +E++.   |

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

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

username/.ssh/id_rsa.pub

这时候会看见:

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

把显示出来的SSH
keys直接添加到github账户设置里边的SSH keys

怎么添加SSHkeys,参见另一片关于git的文章

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

【git 报错】Could not read from remote repository.Please make sure you have the correct access rights.的更多相关文章

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

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

  3. 4.git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案

    转自:https://zhiku8.com/git-could-not-read-from-remote-repository.html 我们在使用git clone 或其他命令的时候,有时候会遇到这 ...

  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. Jenkins新建项目中源码管理Repository URL使用Git报错:Failed to connect to repository : Command "git ls-remote -h......

    之前部署了Gitlab+Gerrit+Jenkins持续集成环境,但在Jenkins中新建项目的源码管理"Repository URL"中添加git地址环节出现了问题,信息为&qu ...

  7. linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法

    输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...

  8. 记一次使用git报错,解决Unable to negotiate with **** port 22: no matching host key type found. Their offer: ssh-rsa

    windows电脑重装系统,去官网下载了最新的git安装,一路next下来,打开bash按老路子设置,生成公钥 git config --global user.name "yourname ...

  9. 【Devops】【docker】【CI/CD】jenkins源码管理,添加SSH地址后报错+Jenkins构建报错:Please make sure you have the correct access rights and the repository exists.

    jenkins源码管理,添加SSH地址后报错: Could not read from remote repository. Please make sure you have the correct ...

随机推荐

  1. C# 数字转换成大写

    /// <summary> /// 数字转大写 /// </summary> /// <param name="Num">数字</para ...

  2. mysql 多个字段合并

    group_concat 函数默认“,”合并 select p.id as patent_id,p.application_no,p.name,p.inventer,group_concat(pi.` ...

  3. !学习笔记:前端测试 、前端调试、console 等

    http://www.cnblogs.com/rubekid/p/4851988.html 你真的了解 console 吗 2014 http://www.codeceo.com/article/ja ...

  4. SpringCloud系列二:Restful 基础架构(搭建项目环境、创建 Dept 微服务、客户端调用微服务)

    1.概念:Restful 基础架构 2.具体内容 对于 Rest 基础架构实现处理是 SpringCloud 核心所在,其基本操作形式在 SpringBoot 之中已经有了明确的讲解,那么本次为 了清 ...

  5. threading join用法

    join():在子线程完成运行之前,这个子线程的父线程将一直被阻塞 import threading #线程import time def Beijing(n): print('Beijing tim ...

  6. 用java语言构建一个网络服务器,实现客户端和服务器之间通信,实现客户端拥有独立线程,互不干扰

    服务器: 1.与客户端的交流手段多是I/O流的方式 2.对接的方式是Socket套接字,套接字通过IP地址和端口号来建立连接 3.(曾经十分影响理解的点)服务器发出的输出流的所有信息都会成为客户端的输 ...

  7. Javascript中 toFixed

    javascript中toFixed使用的是银行家舍入规则. 银行家舍入:所谓银行家舍入法,其实质是一种四舍六入五取偶(又称四舍六入五留双)法. 简单来说就是:四舍六入五考虑,五后非零就进一,五后为零 ...

  8. Linux-vim文本编辑器

    [Vim文本编辑器] vim的三种模式:一般模式.编辑模式.命令模式. * 一般模式: 当你vim filename 编辑一个文件时,一进入该文件就是一般模式了.在这个模式下,你可以做的操作有,上下移 ...

  9. 基于maven javaweb编程缺少java源文件

    前提:基于maven的javaweb的开发环境,可参考 link 一. https://blog.csdn.net/ldlly0505/article/details/79674826 1.在sour ...

  10. 使用JavaMail发送邮件-从FTP读取图片并添加到邮件正文发送

    业务分析: 最近工作需要,需要从FTP读取图片内容,添加到邮件正文发送.发送邮件正文,添加附件采用Spring的MimeMessageHelper对象来完成,添加图片也将采用MimeMessageHe ...