运行以下git命令的时候出现错误

git push -u origin master

error

The authenticity of host 'github.com (13.250.177.223)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,13.250.177.223' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.

原因

本地没有生成SSH key.

解决方法here

1. generate SSH key;

$ ssh-keygen -t rsa -b  -C "your_email@example.com"

按照提示进行;

2. add your SSH key to the ssh-agent.

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa

3. add the SSH key to your Github account.

Paste the above copied outpur into your Github profile -> Settings -> SSH and GPG Keys -> Add new SSH key

另一个问题

error

~/../code/shell_learning$ git push origin master
To git@github.com:**/shell_test.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:**/shell_test.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方法:

利用强覆盖方式用你本地的代码替代git仓库内的内容

 git push -f

参考

1. github_issue;

2. Generating a new SSH key and adding it to the ssh-agent;

3. git_push_error;

【git基础】Permission denied (publickey). fatal: Could not read from remote repository的更多相关文章

  1. github Permission denied (publickey). fatal: Could not read from remote repository.

    github Permission denied (publickey).fatal: Could not read from remote repository. ----------------- ...

  2. github下载报错:Permission denied (publickey). fatal: Could not read from remote repository.

    Permission denied (publickey). fatal: Could not read from remote repository. 博主在github上下载tiny face的的 ...

  3. Permission denied (publickey). fatal: Could not read from remote repository.

    博主在github上下载tiny face的的源代码的时候,遇到git clone命令为:git clone --recursive git@github.com:peiyunh/tiny.git 而 ...

  4. Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure y

    这个应该是很多github新手经常出错的问题,这个就是没有在你github上添加一个公钥. 下面就直接说步骤: 1 可以用 ssh -T git@github.com去测试一下 图上可以明显看出缺少了 ...

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

    第一次提交遇到这样的情况,怎么回事呢,我在github上提交了ssh key 的啊. 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 host :    ...

  6. git克隆出错 github clone Permission denied (publickey) fatal Could not read from remote repo

    原文网址:http://blog.csdn.net/feeling450/article/details/53067563 github clone "Permission denied ( ...

  7. Permission denied (publickey). fatal: The remote end hung up unexpectedly 解决办法

    这两天学习git的时候,在本地创建了一个库,同时自己在GitHub上面也创建了一个库,照着廖老师的教程一步一步走到了push的环节突然出现了这样的错误: [zhangxiyu@localhost le ...

  8. git clone ssh 时出现 fatal: Could not read from remote repository

    一.问题及解决办法参考: 在 ubuntu 中,要把 GitHub 上的储存库克隆到计算机上时,执行如下命令: git clone git@github.com:USER-NAME/REPOSITOR ...

  9. Git安装遇到的问题fatal: Could not read from remote repository.的解决办法

    转自:https://blog.csdn.net/huahua78/article/details/52330792 查看远端地址 git remote –v 查看配置 git config --li ...

随机推荐

  1. docker 挂载实现容器配置更改为外部文件

    docker安装镜像后,每个服务都是独立的容器,容器与容器之间可以说是没关系,隔离独立的. 而且虚拟出来的这些容器里面的基本安装工具都是没有的,比如vi,vim等等.需要使用,还得安装处理. 那么我们 ...

  2. Vue的响应式系统

    Vue的响应式系统 我们第一次使用Vue的时候,会感觉有些神奇,举个例子: <div id="app"> <div>价格:¥{{price}}</di ...

  3. YAML_01 YAML语法和playbook写法

    ansible的playbook采用yaml语法,它简单地实现了json格式的事件描述.yaml之于json就像markdown之于html一样,极度简化了json的书写.在学习ansible pla ...

  4. Spring入门(一)——IOC

    1. IOC定义 Inversion of Control,减低计算机代码间的耦合度,对象的创建交给外部容器完成,不用再new了 2. 流程 2.1 创建Bean对象 package bean; pu ...

  5. C# 异步编程(async&await)

    同步:同步就是指一个进程在执行某个请求的时候,若该请求需要一段时间才能返回信息,那么这个进程将会一直等待下去,直到收到返回信息才继续执行下去 异步:异步是指进程不需要一直等下去,而是继续执行下面的操作 ...

  6. #505. 「LibreOJ β Round」ZQC 的游戏

    题目描述 首先一定是让ZQC吃掉他能吃到的所有的球,这样才能尽可能的满足ZQC的质量是所有玩家中最大的. 在满足某一个玩家的质量不会超过ZQC的情况下,让这个玩家吃掉尽可能多的球,让其他玩家吃掉的尽可 ...

  7. postman上传excel,java后台读取excel生成到指定位置进行备份,并且把excel中的数据添加到数据库

    最近要做个前端网页上传excel,数据直接添加到数据库的功能..在此写个读取excel的demo. 首先新建springboot的web项目 导包,读取excel可以用poi也可以用jxl,这里本文用 ...

  8. mysql group by 报错 ,only_full_group_by 三种解决方案

    报错信息  Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'data ...

  9. Kafka(一) —— 基本概念及使用

    一.安装&启动 安装Kafka(使用内置Zookeeper) 在Kafka官网下载安装包kafka_2.11-1.0.0.tgz #### 解压 tar zxvf kafka_2.11-1.0 ...

  10. appium 多线程还是多进程(转)

    https://www.cnblogs.com/zouzou-busy/p/11440175.html 在前面我们都是使用一个机器进行测试,在做app自动化的时候,我们要测不同的机型,也就是兼容性测试 ...