运行以下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. 学习Spring-Data-Jpa(四)---Naming命名策略,源码跟踪

    1.首先在Entity实体中,命名方式有两种: 一种是显示命名,即通过@Table的name属性指定对应的数据库表名称,@Column的name属性指定实体字段对应数据库字段的名称. 另一种是隐式命名 ...

  2. go mod

    https://blog.csdn.net/zzhongcy/article/details/97243826 来自为知笔记(Wiz)

  3. Newtonsoft.Json 自定义序列化器---时间

    IsoDateTimeConverter _IsoDateTimeConverter = new IsoDateTimeConverter() { DateTimeFormat = "yyy ...

  4. QGraphicsView,QGraphicsScene,QGraphicsItem

    参考:Qt4 开发实践第八章 图形视图QGraphicsView #ifndef DRIVEDGRAPH_H #define DRIVEDGRAPH_H #include <QObject> ...

  5. 2017.10.5 国庆清北 D5T1 拼不出的数

    题目描述 3 个元素的集合{5,1,2}的所有子集的和分别是0,1,2,3,5,6,7,8.发现最小的不能由该集合子集拼出的数字是4. 现在给你一个n个元素的集合,问你最小的不能由该集合子集拼出的数字 ...

  6. 区块链阶段1-Linux基础- 2 Linux文件系统

    2.1 什么是文件系统 文件系统是操作系统在磁盘或分区上组织文件的方法和数据结构.负责对磁盘空间进行组织和分配,存储文件数据,并对其提供保护和检索服务.学习Linux,首先需要了解整个 Linux 文 ...

  7. 数据量与半监督与监督学习 Data amount and semi-supervised and supervised learning

    机器学习工程师最熟悉的设置之一是访问大量数据,但需要适度的资源来注释它.处于困境的每个人最终都会经历逻辑步骤,当他们拥有有限的监督数据时会问自己该做什么,但很多未标记的数据,以及文献似乎都有一个现成的 ...

  8. js判断是不是在微信浏览器打开?

    is_weixin:function(){      var ua = window.navigator.userAgent.toLowerCase();      if (ua.match(/Mic ...

  9. django celery 异步执行任务遇到的坑

    部署后,任务没有持久化,所有用supervisor 进行进程管理 安装 pip install supervisor 创建 配置文件 [program:testplatform-flower] com ...

  10. springboot项目获取resource下的文件

    package com.expr.exceldemo; import org.springframework.core.io.ClassPathResource; public class Test ...