Permission denied (publickey). fatal: The remote end hung up unexpectedly 解决办法
这两天学习git的时候,在本地创建了一个库,同时自己在GitHub上面也创建了一个库,照着廖老师的教程一步一步走到了push的环节突然出现了这样的错误:
[zhangxiyu@localhost learngit] $ git push -u origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
去百度,CSDN,GitHub等等各种地方去查只得到一个答案,说是pubickey没有绑定到远程GitHub上,但这个步骤之前分明已经都做过了,没办法只好把GitHub上的公钥删掉,同时在本地rm -r ~/.ssh把.ssh文件夹全删掉重新生成ssh-keygen,重新把.ssh/id_rsa.pub绑定到GitHub。结果呢,还尼玛不行。还是提示上面的错误!woc!!!见了鬼了。然后就陷入了死循环,到处找解决方法,但结果是清一色的“没有绑定公钥”。
好在天无绝人之路,今天无意中看到了git push上传代码到gitlab上,报错401/403(或需要输入用户名和密码)这个帖子,突然想到了,昨天在push之前好像也遇到过这个问题:
[zhangxiyu@localhost learngit]$ git push -u github
error: The requested URL returned error: 403 Forbidden while accessing
https://github.com/zxy9527/zxy.git/info/refsfatal: HTTP request failed
然后在网上查找了一下问题不知怎么的就果断vi .git/config,然后把
[remote “github”]
url = https://github.com/zxy9527/zxy.git
fetch = +refs/heads/:refs/remotes/github/
改成了
[remote “github”]
url = ssh://github.com/zxy9527/zxy.git
fetch = +refs/heads/:refs/remotes/github/
喜大普奔,403的问题没有了,但随之而来的就是无限的Permission denied (publickey)。。。就是上面说的问题。
- 解决办法
在代码的.git/config文件内[remote “origin”]的url的gitlab域名前添加gitlab注册时的“用户名:密码@”
例如我的GitHub用户名为blx9527,密码为blx123456(当然不是真的密码~),所以.git/config文件内就应该改为:
[remote “github”]
url = https://blx9527:blx123456@github.com/zxy9527/zxy.git
fetch = +refs/heads/:refs/remotes/github/
改完之后,确保你的公钥已经绑定到GitHub(这个网上有很详细的教程)之后,就可以愉快的push啦!!
Permission denied (publickey). fatal: The remote end hung up unexpectedly 解决办法的更多相关文章
- fatal: The remote end hung up unexpectedly解决办法
$ git config --global http.postBuffer 2428000 git config http.postBuffer 524288000 配置完成后 git pull一下, ...
- ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly
问题出现的情景:使用git pull拉取开发的代码到测试服务器,报错: ssh: Could not resolve hostname git.****-inc.com : Temporary fai ...
- github Permission denied (publickey). fatal: Could not read from remote repository.
github Permission denied (publickey).fatal: Could not read from remote repository. ----------------- ...
- 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 ( ...
- github下载报错:Permission denied (publickey). fatal: Could not read from remote repository.
Permission denied (publickey). fatal: Could not read from remote repository. 博主在github上下载tiny face的的 ...
- 【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.22 ...
- git提交报异常,fatal: The remote end hung up unexpectedly
转自:http://liucanwen.iteye.com/blog/2021601 早上提交代码到 oschina代码库时,报了这个错误: fatal: The remote end hung up ...
- Git 提交大文件提示 fatal: The remote end hung up unexpectedly
使用gitlab搭建的git server,如果直接使用http的方式去提交的话,提交小文件不会有问题,但是提交大文件时,会出错: fatal: The remote end hung up unex ...
- fatal: The remote end hung up unexpectedly
git push 的时候出错,提示: fatal: The remote end hung up unexpectedly 遇见几次了,原因是因为文件太大,把限制放宽就好了.命令: git confi ...
随机推荐
- DB2的认证和授权
DB2 的安全性由两方面组成:认证和授权 1.认证 认证就是系统验证用户身份的过程.说的简单点,就是验证用户名和密码,因为DB2用户同时也是操作系统用户,所以,首先必须得到操作系统的认可.在默认情况下 ...
- C#多线程之 ManualResetEvent和AutoResetEvent
初次体验 ManualResetEvent和AutoResetEvent主要负责多线程编程中的线程同步:以下一段是引述网上和MSDN的解析: 在.Net多线程编程中,AutoResetEvent和Ma ...
- iOS点击获取短信验证码按钮
概述 iOS点击获取短信验证码按钮, 由于 Demo整体测试运行效果 , 整个修改密码界面都已展现, 并附送正则表达式及修改密码逻辑. 详细 代码下载:http://www.demodashi.com ...
- 转:PHP关于反斜杠处理函数addslashes()和stripslashes()的用法
1.php处理\函数:addslashes()和stripslashes()函数 addslashes():对输入字符串中的某些预定义字符前添加反斜杠,这样处理是为了数据库查询语句等的需要.这些预定义 ...
- java中写sql语句的小小细节
来源于:http://www.cnblogs.com/reine98/p/6180472.html 看如下一条sql语句 1 2 3 4 5 6 String sql="SELECT * F ...
- mysql中的order by
一.order by的原理 1.利用索引的有序性获取有序数据 当查询语句的 order BY 条件和查询的执行计划中所利用的 Index 的索引键(或前面几个索引键)完全一致,且索引访问方式为 ran ...
- iOS获取本地沙盒视频封面图片(含swift实现)
最近做了个小应用,有涉及到本地视频播放及列表显示. 其中一个知识点就是获取本地存储视频,用来界面中的封面显示. 记录如下: //videoURL:本地视频路径 time:用来控制视频播放的时间点图片截 ...
- HDUOJ----数塔
数塔 Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission ...
- deque容器的运用一点一点积累
#include<iostream> #include<deque> #include<cstdio> #include<cstring> #inclu ...
- Python中 append 和 extend 的区别
Python中Lists 的两个方法: append 和 extend : list.append(object) 向列表中添加一个对象object.append 接受一个参数,这个参数可以是任何数据 ...