在clone google官方demo的时候出现的坑(详细如下):

Please make sure you have the correct access rightsand the repository exists.

一度以为是本地的 git config 出现问题,但是 git commit 能正常运行,朦胧记起以前玩的时候还要配置ssh**之类的,既然知道问题所在,那就开始吧。

遇到的问题(见图):

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

报错详细

在 git clone 出现"Please make sure you have the correct access rights and the repository exists." 这句英文大概意思就是:"请确保您拥有正确的访问权限并且存储库存在"。简而言之就是没有访问权限,经过查阅资料可知,这是因为 github ssh**不匹配或者未配置出现的异常。

找到问题:github ssh**不匹配或者未配置出现的异常

好的,既然知道问题,那就好办了,既然使用 ssh 方式克隆需要权限那就换Http 克隆总可以吧。一梭子就是干,运行结果,果不其然(看图):

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

运行结果

显示克隆成功,还是不怎么放心,去该目录看一眼,确认过眼神,的确 clone 下来了。

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

目录

目标是实现了。但是 ssh 的方式就放弃了?那是不可能的。来吧,继续造。

配置ssh**

既然知道是ssh**未配置或者不匹配的问题,那就配置 ssh **就行了呗。

    生成 ssh **:

$ ssh-****** -t rsa -C "[email protected]"

    [email protected] 换成你自己的 git 邮箱便可,后面连续三个回车。

    最后会得到两个文件 : id_rsa id_rsa.pub ,分别存放在c:/Users/Administrator/.ssh/ 路径下:

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

生成的ssh**

    如果之前配置过,就在 overwrite 选项出现的时候输入 y 便可。

添加**到ssh-agent

确保 ssh-agent 是可用的。ssh-agent是一种控制用来保存公钥身份验证所使用的私钥的程序,其实ssh-agent就是一个**管理器,运行ssh-agent以后,使用ssh-add将私钥交给ssh-agent保管,其他程序需要身份验证的时候可以将验证申请交给ssh-agent来完成整个认证过程。

$ eval "$(ssh-agent -s)"

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

start the ssh-agent in the background

添加生成的ssh**到 ssh-agent

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

添加成功

添加SSH到Github

把 id_rsa.pub 文件里的内容复制到下面的对话框,点击Add SSH key,完成添加。

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

测试添加是否成功

$ ssh -T [email protected]

如果你看到以下的图片就代表成功了

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

添加SSH成功

重新尝试使用SSH克隆Github文件

随便clone 点东西(gtkmm)

$ git clone [email protected]:GNOME/gtkmm.git

Please make sure you have the correct access rightsand the repository exists.(Git 爬坑)

克隆成功

完事。

相关文章: