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

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

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

解决方案参考:解决fatal: unable to connect to github.com问题

$ 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 建立组织

GitHub Linux下使用方法

Windows下Eclipse搭建GitHub开发环境图文教程

R语言 3.0.1 源码已经提交到 GitHub

从GitHub将Maven项目导入Eclipse4.2

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/18409.html