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 ...
随机推荐
- SwaggerUI+SpringMVC——构建RestFul API的可视化界面
今天给大家介绍一款工具,这个工具眼下可预见的优点是:自己主动维护最新的接口文档. 我们都知道,接口文档是非常重要的,可是随着代码的不断更新,文档却非常难持续跟着更新,今天要介绍的工具,完美的攻克了这个 ...
- HDU 3316 My Brute(二维费用流)经典
My Brute Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total S ...
- Scala进阶之App特质
App特质的作用 App特质的作用那就是延迟初始化,从代码上看它继承自DelayedInit,里面有个delayedInit方法 trait App extends DelayedInit Delay ...
- Oracle执行SQL报错ORA-00922
问题描述: 对Oracle数据库执行序列化脚本出错,ora-00922 missing or invalid option #无效的选项 问题解决: 对于set define off --这个是sq ...
- 查看Windows端口及端口关闭方法(转)
摘自:http://www.hackbase.com/tech/2011-05-17/63766.html 查看Windows端口及端口关闭方法 一.查看已开放的端口: 1.借助系统自带MS-DOS命 ...
- Erlang中atom的实现
Erlang的原子(atom)在匹配中有着重要作用,它兼顾了可读性和运行效率. 通过atom,可以实现很多灵活高效的应用. atom可以看作是给字符串生成了一个ID,内部使用的是ID值,必要时可以取出 ...
- this.class.getClassLoader().getResourceAsStream与this.class.getResourceAsStream
本文部分转自:http://xixinfei.iteye.com/blog/1256291 this.getClass().getClassLoader().getResource("tem ...
- Linux命令-终止进程命令:pkill
killall是杀死所有进程,而pkill是按照进程名称杀死进程,可以达到杀死所有进程的目的,因为linux里面同名的进程是分主进程和子进程的. pkill - httpd 按名称强制杀死httpd进 ...
- 最简易的PHP Storm调试模式开启方式
使用的是xdebug调试工具. 其实真的很想吐槽php语言开启调试模式真的好麻烦. 据说xdebug调试工具不支持php7.0以下版本,我同事的php5.6就不支持噗嗤.. 正文: 1.先用phpSt ...
- jquery中 $ 和 jQuery 及 $() 的区别
用过jquery的人都知道,jquery有两种用法,一种是$,还有一种是jQuery,那么这两种方式在使用上有什么区别呢? 答案是这两种用法没什么区别,只是别名而已,用$要比jQuery简短一些.方便 ...