手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

git push fatal: unable to connect to github.com问题

[日期:2014-03-22] 来源:Linux社区  作者:xjhznick [字体:大 中 小]

当修改或者添加完文件,git commit之后运行git push推送到远程仓库,第一次遇到问题:

git push fatal: unable to connect to github.com问题

解决方案参考:解决fatal: unable to connect to github.com问题 http://www.linuxidc.com/Linux/2014-03/98667.htm

$ git config --global url."https://".insteadOF git://

然后连续两次次推送遇到问题:

git push fatal: unable to connect to github.com问题

解决方案参考: Pushing to Git returning Error Code 403 fatal: HTTP request failed (见附1)

GitHub似乎只支持ssh方式的读写远程仓库。因此配置当前本地仓库的 .git/config  文件,或者使用命令:

$ git remote set-url origin ssh://git@github.com/RanHuang/contiki.git

然后再次推送成功:

git push fatal: unable to connect to github.com问题

附1:

Pushing to Git returning Error Code 403 fatal: HTTP request failed

Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.
So you need to change your repo config on your PC to ssh way:

nstead of editing .git/config file manually, you can use git remote set-url command.
In your case it should be:

git remote set-url origin ssh://git@github.com/derekerdmann/lunch_call.git

GitHub 的详细介绍:请点这里
GitHub 的下载地址:请点这里

推荐阅读:

如何在 GitHub 建立组织 http://www.linuxidc.com/Linux/2013-08/88197.htm

GitHub Linux下使用方法 http://www.linuxidc.com/Linux/2013-06/86417.htm

Windows下Eclipse搭建GitHub开发环境图文教程 http://www.linuxidc.com/Linux/2013-06/85372.htm

R语言 3.0.1 源码已经提交到 GitHub http://www.linuxidc.com/Linux/2013-05/84425.htm

从GitHub将Maven项目导入Eclipse4.2 http://www.linuxidc.com/Linux/2013-04/83082.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款