• 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(本地用户名).ssh】 中的 known_hosts(直接删除即可)

    2. 在下载好的Git中的bin目录下(一般是 C:Program FilesGitin)打开bash.exe输入命令ssh-keygen -t rsa -C "username" (注:username为你git上的用户名),如果执行成功。返回:

           Generating public/private rsa key pair.
           Enter file in which to save the key (/Users/username/.ssh/id_rsa): //这里的username是电脑上的用户名,这个地址也是文件的存储地址,然后按回车,

    如果以前有存储地址会返回/Users/your username/.ssh/id_rsa already exists.Overwrite (y/n)?直接输入y回车。

    如果以前没有储存地址就会出现Enter passphrase(empty for no passphrase);也直接回车,

    两种情况回车后都会出现 Enter same passphrase again 然后接着回车会显示

    The key's randomart image is:
    +---[RSA 2048]----+
    |    .          . |
    | . = .       .  o|
    |o o * .     . ...|
    |E oo o   .   o.. |
    | B .  o S . ...  |
    |. o    o .o..    |
    | .       o**.    |
    |        .B=+%.   |
    |         +*BoBo  |
    +----[SHA256]-----+,这说明SSH key就已经生成了。文件目录就是:username/.ssh/id_rsa.pub.

    3. 然后找到系统自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,用记事本打开id_rsa.pub将全部的内容复制。

    4. 打开https://github.com/,登陆账户,进入设置(Settings)找到

     5. 然后将你复制的内容粘贴到key中

    再点击Add SSH Key  

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

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

  • 相关阅读:
    22算法中的O(1), O(n),O(logn), O(nlogn)是什么意思?
    212数据结构队列/优先队列
    02前端项目代码检查规范
    16对element源码进行修改实现上传列表增加上传文件大小显示
    182 尾调用/尾递归/尾递归优化/柯里化函数/蹦床函数
    2.formdata数据格式和json格式的区别
    18柯里化函数/偏函数
    MD5文件验证
    tomcat 部署运行静态html文件
    矩阵快速幂及其简单应用
  • 原文地址:https://www.cnblogs.com/jiaoliuxuexi/p/12668539.html
Copyright © 2020-2023  润新知