旁观自己 善待朝夕|

猫老板的豆

园龄:9年4个月粉丝:52关注:0

git clone 时候出现 Please make sure you have the correct access rights and the repository exists. 问题

输入 git clone 命令时出现Please make sure you have the correct access rights and the repository exists.错误,出现改问题的原因是git服务器没有存储本地ssh密钥。


解决方法如下:

  1. 删除 .ssh 文件夹C:\Users\Administrator\.ssh(Administrator为本地用户名) 中的 known_hosts(直接删除即可)
    在这里插入图片描述

  1. 在下载好的Git中的bin目录下(一般是在C:\Program Files\Git\bin)打开bash.exe输入命令
    ssh-keygen -t rsa -C "username" (注:username为你git上的用户名),如果执行成功,就一路回车确定
    在这里插入图片描述
    出现这个就说明SSH key就已经生成了。

  1. 然后找到系统自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,用记事本打开id_rsa.pub将全部的内容复制。
    在这里插入图片描述

  1. 打开 github
    登陆账户
    进入Settings
    找到SSH and GPG keys
    点击New SSH key
    然后将你复制的内容粘贴到key中
    在这里插入图片描述
    再点击Add SSH Key 即可~

  1. 仍然在bash.exe中输入ssh -T git@github.com然后会跳出一堆内容你只需输入yes回车就完事了,然后他会提示你成功了。
    在这里插入图片描述

大功告成,再次输入 git clone 就成功了

本文作者:猫老板的豆

本文链接:https://www.cnblogs.com/bingcola/p/16499189.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   猫老板的豆  阅读(200)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.