Please make sure you have the correct access rights and the repository exist

接上篇:Git 中 SSH key 生成步骤_追逐吾之所求的博客-CSDN博客_git sshkey

一、Please make sure you have the correct access rights and the repository exist

在完成上篇文章后,有时会报错:

Please make sure you have the correct access rights and the repository exist

解决方案:

在git中输入命令:

ssh -T git@github.com 

然后耐心等待,过一会出现一大堆英文。后面括号内会让你输入命令(yes/no)。

输入命令:yes

按回车。

然后就会提示你成功了。

最后退出git重新进入路径提交或者git clone一下就可以了。

转自:git提示“Please make sure you have the correct access rights and the repository exists.”_Evan Wang的博客-CSDN博客

二、git@github.com: Permission denied (publickey)

ssh -T git@github.com 

如果报错:

git@github.com: Permission denied (publickey)

打开文件夹C:\Users\Administrator\.ssh(Administrator是当前用户名),在空白处点鼠标右键选择“Git Bush Here” ,打开gitbush。

1.首先,如果你没有ssh key的话,输入命令:ssh-keygen -t rsa -C "xx@example.com", youremail@example.com改为自己的邮箱即可,途中会让你输入密码啥的,不需要管,一路回车即可,会生成你的ssh key。(如果重新生成的话会覆盖之前的ssh key。)

 2.然后再执行命令:ssh -v git@github.com

        最后两句会出现:

        No more authentication methods to try.  

        Permission denied (publickey).

3.这时候再下输入:

  ssh-agent -s

  然后会提示类似的信息:

4.接着再输入:ssh-add ~/.ssh/id_rsa

这时候应该会提示:

(注意)如果出现错误提示:

 请执行命令:eval `ssh-agent -s`后,继续执行命令 ssh-add ~/.ssh/id_rsa,这时候一般OK了。

5.打开你刚刚生成的id_rsa.pub,将里面的内容复制,进入你的github账号,在settings下,SSH and GPG keys下new SSH key,title随便取一个名字,然后将id_rsa.pub里的内容复制到Key中,完成后Add SSH Key。

6.最后一步,验证Key

输入命令:ssh -T git@github.com

提示:如下信息就OK了。

这时候你的问题就解决啦,可以使用命令 git clone去下载你的代码啦。
转自:解决git@github.com: Permission denied (publickey)_tony康的博客-CSDN博客

  • 18
    点赞
  • 60
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值