【git基础】Permission denied (publickey). fatal: Could not read from remote repository
运行以下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的更多相关文章
- github Permission denied (publickey). fatal: Could not read from remote repository.
github Permission denied (publickey).fatal: Could not read from remote repository. ----------------- ...
- github下载报错:Permission denied (publickey). fatal: Could not read from remote repository.
Permission denied (publickey). fatal: Could not read from remote repository. 博主在github上下载tiny face的的 ...
- Permission denied (publickey). fatal: Could not read from remote repository.
博主在github上下载tiny face的的源代码的时候,遇到git clone命令为:git clone --recursive git@github.com:peiyunh/tiny.git 而 ...
- 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去测试一下 图上可以明显看出缺少了 ...
- 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 : ...
- 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 ( ...
- Permission denied (publickey). fatal: The remote end hung up unexpectedly 解决办法
这两天学习git的时候,在本地创建了一个库,同时自己在GitHub上面也创建了一个库,照着廖老师的教程一步一步走到了push的环节突然出现了这样的错误: [zhangxiyu@localhost le ...
- git clone ssh 时出现 fatal: Could not read from remote repository
一.问题及解决办法参考: 在 ubuntu 中,要把 GitHub 上的储存库克隆到计算机上时,执行如下命令: git clone git@github.com:USER-NAME/REPOSITOR ...
- Git安装遇到的问题fatal: Could not read from remote repository.的解决办法
转自:https://blog.csdn.net/huahua78/article/details/52330792 查看远端地址 git remote –v 查看配置 git config --li ...
随机推荐
- Java8新特性(拉姆达表达式lambda)
一.函数式接口 函数式接口(functional interface 也叫功能性接口,其实是同一个东西).简单来说,函数式接口是只包含一个方法的接口.比如Java标准库中的java.lang.Runn ...
- php 数组的计算
数组是我们最常用到的类型,那如何计算某个一维数组的个数呢.其实我们可以用到我们之前学过的数学函数里面的一个:count(). 我们来看看count函数的用法: int count ( mixed $变 ...
- idea-git同步服务器代码后撤销操作
工具:IntelliJ IDEA 2019.2.1 x64 记录一次不小心同步代码后,如何撤销操作. 1.同步服务器代码,右击项目,点击Synchronize 'xxx',如下: 2.打开Versio ...
- Error Codes Messages查找工具介绍
当我们通过各种手段获取到一个Windows错误码后,如何获取对应的错误消息呢?有两种方法:一是用编程的手段(FormatMessage):其二是用现成的工具.第一种方法一般在我们编码的时候有用,而更多 ...
- CSS精灵图(王者荣耀案例)
首先,我们应该知道引入精灵图的原因: 具体是因为,网页上面的每张图片都要经历一次请求才能展示给用户,小的图标频繁的请求服务器,降低页面的加载速度,为了有效地减少服务器接收和发送请求的次数,提高页面的加 ...
- FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,
在对nginx添加fastCGI的支持后,然后进行php页面验证,发现页面识别不到,不清楚什么情况,随后google了下,原来是Nginx内置变量问题惹的祸. 1.平台介绍: 1 2 3 4 5 6 ...
- 《挑战30天C++入门极限》新手入门:C++下的引用类型
新手入门:C++下的引用类型 引用类型也称别名,它是个很有趣的东西.在c++ 下你可以把它看作是另外的一种指针,通过引用类型我们同样也可以间接的操作对象,引用类型主要是用在函数的形式参数上,通 ...
- Multi-Temporal SAR Data Large-Scale Crop Mapping Based on U-Net Model(利用U-net对多时相SAR影像获得作物图)
对哨兵1号的多时相双极化SAR数据进行预处理,得到18个日期的VV和VH共36景影像,通过ANOVA和JM距离分析,选其中ANOVA得到的F值最高的6景影像.真值用LC8数据和地面调查,目视解译得到标 ...
- Codeforces 1172D. Nauuo and Portals 构造
原文链接www.cnblogs.com/zhouzhendong/p/CF1172D.html 前言 明哥神仙打cf方式真潇洒.45分钟切D后就不打了? 我当场爆肝D想错方向不会做自闭了. 题解 考虑 ...
- 第2组 团队Git现场编程实战
目录 组员职责分工(1 2分) github 的提交日志截图(2 1分) 程序运行截图(3 3分) 程序运行环境(4 1分) GUI界面(5 5分) 基础功能实现(6 10分) 鼓励有想法且有用的功能 ...