报错: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 clone 命令时出现Please make sure you have the correct access rights and the repository exists.错误,出现改问题的原因是git服务器没有存储本地ssh密钥。

解决步骤:

  1. 删除 .ssh 文件夹【C:\Users(本地用户名).ssh】 中的 known_hosts(直接删除即可)
    报错:git clone 时候出现Please make sure you have the correct access rights and the repository exists.问题解决,前端开发,git,github,ssh

  2. 在下载好的Git中的bin目录下(一般是 C:\Program Files\Git\bin)打开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是电脑上的用户名,这个地址也是文件的存储地址,然后按回车,
    

    报错:git clone 时候出现Please make sure you have the correct access rights and the repository exists.问题解决,前端开发,git,github,ssh

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

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

  5. 两种情况回车后都会出现 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.

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

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

  8. 然后将你复制的内容粘贴到key中
    再点击Add SSH Key
    报错:git clone 时候出现Please make sure you have the correct access rights and the repository exists.问题解决,前端开发,git,github,ssh

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

报错:git clone 时候出现Please make sure you have the correct access rights and the repository exists.问题解决,前端开发,git,github,ssh

大功告成,再次输入 git clone 就成功了文章来源地址https://www.toymoban.com/news/detail-751672.html

到了这里,关于报错:git clone 时候出现Please make sure you have the correct access rights and the repository exists.问题解决的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包