红联Linux门户
Linux帮助

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

发布时间:2014-06-05 10:08:52来源:红联作者:velcbo
当修改或者添加完文件,git commit之后运行git push推送到远程仓库,第一次遇到问题。

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

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

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

解决方案参考: 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

然后再次推送成功。

附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

作者:xjhznick
文章评论

共有 0 条评论