运行以下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. Linux 一款免费的shell工具 MobaXterm_Personal

    一款免费的shell工具 MobaXterm_Personal

  2. LOJ575. 「LibreOJ NOI Round #2」不等关系 [容斥,分治FFT]

    LOJ 思路 发现既有大于又有小于比较难办,使用容斥,把大于改成任意减去小于的. 于是最后的串就长成这样:<<?<?<??<<<?<.我们把一段连续的& ...

  3. kubernetes 1.14安装部署EFK日志收集系统

    简单介绍: EFK 组合插件是k8s项目的一个日志解决方案,它包括三个组件:Elasticsearch, Fluentd, Kibana.相对于ELK这样的架构,k8s官方推行了EFK,可能Fluen ...

  4. mac使用crawlab

    这里采用docker-compose的 第一步拉镜像 docker pull tikazyq/crawlab:latest 第二步修改compose文件 docker-compose.yml文件 ve ...

  5. java中nextLine()与next()的区别

    java中的next()和nextLine()还是有很大区别的. next()一定要读取到有效字符后才可以结束输入,对输入有效字符之前遇到的空格键.Tab键或Enter键等结束符,next()方法会自 ...

  6. Assignment2:因果图法的介绍与示例分析

    一. 黑盒测试:是一种常用的软件测试方法,它将被测软件看作一个打不开的黑盒,主要根据功能需求设计测试用例,进行测试.几种常用的黑盒测试方法和黑盒测试工具有,等价类划分法.边界值分析法.因果图法.决策表 ...

  7. [spring-boot] 多环境配置

    application-{profile}.properties 按照格式创建两个配置文件,一个DEV环境,一个测试环境 修改其端口: server.port=8888 DEV server.port ...

  8. [spring-boot] pom文件 spring-boot-starter-parent

    <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...

  9. 创建加载bean的实例

    一.创建实例 工程的结构如下图 1.创建接口 public interface Person { public void setName(String name); public String say ...

  10. TP5 查询 字符串条件如何实现

      TP5 查询 字符串条件如何实现 当查询条件是 (1,3,8) ,3,4) 这种情况改如何查询呢?   主要用到FIND_IN_SET $where[ ]=>['exp',Db::raw(& ...