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

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

git push 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://[email protected]/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://[email protected]/derekerdmann/lunch_call.git

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

推荐阅读

相关推荐