zoukankan      html  css  js  c++  java
  • git初次建立远程仓库问题

    git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案

    git建立远程仓库时出现:

    Permission denied (publickey).
    fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.

    出现这个问题是因为没有在github账号添加SSH key

    解决方法如下:

    1.在终端输入。

    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): 

    首先,说明一下,这里的 然后,在这里就是设置存储地址了.我们直接按回车,会出现一下两种情况的一种:

    (1)如果正常运行的话,会出现

    然后我们直接回车

    (2)有的时候我们可能会出现

    Overwrite (y/n)?

    这说明你已经设置了存储地址,我们输入“y”覆盖

    上面的任意两种情况之后,会出现

    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again:

    再次回车,这时候你会看见:

    Your identification has been saved in /home/zhuyihong/.ssh/id_rsa.
    Your public key has been saved in /home/zhuyihong/.ssh/id_rsa.pub.
    The key fingerprint is:
    xxxxx。。。
    The key's randomart image is:
    xxxxx。。。

    这说明SSH key就已经生成了。文件目录就是:username/.ssh/id_rsa.pub.

    我们执行cat命令查看文件的内容:

    username/.ssh/id_rsa.pub

    这时候会看见:

    (说明:ssh-rsa 后面的内容这就是你的SSH keys)

    把显示出来的SSH keys直接添加到github账户设置里边的SSH keys

    最后再执行git clone命令就可以了!!!

  • 相关阅读:
    Java 8 CompletableFuture思考
    Math.ceil 笔记
    Python virtual env
    Reactive Stream: 如何将两个数据流接到一起,然后进行操作
    基于Apollo实现.NET Core微服务统一配置(测试环境-单机)
    在ASP.NET Core 2.x中获取客户端IP地址
    Entity Framework Core(3)-配置DbContext
    .NET Core2.1下采用EFCore比较原生IOC、AspectCore、AutoFac之间的性能
    Entity Framework Core 入门(2)
    Entity Framework Core介绍(1)
  • 原文地址:https://www.cnblogs.com/home123/p/7909952.html
Copyright © 2011-2022 走看看