码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2019-07-26 22:51:43      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:问题   命令   home   增加   sha   链接地址   repos   方法   http   

在服务器上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.

标签:问题   命令   home   增加   sha   链接地址   repos   方法   http   

原文地址:https://www.cnblogs.com/bneglect/p/11253298.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!