Please make sure you have the correct access rights and the repository exists.

Posted bneglect

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Please make sure you have the correct access rights and the repository exists.相关的知识,希望对你有一定的参考价值。

在服务器上sudo  git pull 的时候,报错 Please make sure you have the correct access rights and the repository exists.

解决步骤:
1. 输入 ssh-keygen -t rsa -C "bneglect" //bneglect是你git操作的账号
会显示 Generating public/private rsa key pair.
2. Enter file in which to save the key (/home/liangwu/.ssh/id_rsa): //什么都不用输入,直接回车
Enter passphrase (empty for no passphrase): //什么都不用输入,直接回车
Enter same passphrase again: //什么都不用输入,直接回车
显示 Your identification has been saved in /home/liangwu/.ssh/id_rsa.
Your public key has been saved in /home/liangwu/.ssh/id_rsa.pub.
The key fingerprint is:

SHA256:RbwKQOd9htV5zh9Qdl/EaWZQWqa5SJHeKgFk7nGHv0E bneglect
The key‘s randomart image is:
+---[RSA 2048]----+
| .. oo .oo.o+O=|
| .ooo +o.+.O==|
| ..o+o=E.B= .|
| o o=*...+. |
| oS..+.. ..|
| .. .o .|
| .. |
| |
| |
+----[SHA256]-----+

3. 然后进入code.aliyun.com/profile目录下(或者找到设置->ssh公钥->增加ssh秘钥)
4. (服务器上)密钥对所在目录 /home/bneglect/.ssh/   

*************************上面的方法没解决在看下面的*************************
5. 如果修改了密钥对, 还是不好使,那么可以修改origin 地址, git remote -v 查看一下, 如果是ssh地址, 那么就登录github或者code阿里云复制https地址,
通过命令 git remote set-url origin https://code.aliyun.com/a/b.git 修改, 重新Git pull 试试
(举个栗子: 将url = git@github.com:manishnakar/polymer-demo.git ; 改成url = https://github.com/manishnakar/polymer-demo.git 即可)
6.猜测可能因为 (可能是因为git新账号的原因)(或者说可能是code阿里云上新成员)
7.需要重新选择下git上的ssh地址 因为默认配置的https地址
************************************
8.使用 cat .git/config 查看本地设置的仓库URL地址和github使用的链接地址是否一致.
ssh -T git@github.com检查公钥是否有问题

以上是关于Please make sure you have the correct access rights and the repository exists.的主要内容,如果未能解决你的问题,请参考以下文章

[Git]Please make sure you have the correct access rights and the repository exists

git:Please make sure you have the correct access rights and the repository exists.问题解决

Git Please make sure you have the correct access rights and the repository exists.

出现Please make sure you have the correct access rights and the repository exists.问题解决

出现Please make sure you have the correct access rights and the repository exists.问题解决

git "Could not read from remote repository.Please make sure you have the correct access rights.