歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> git push fatal: unable to connect to github.com問題

git push fatal: unable to connect to github.com問題

日期:2017/2/28 14:34:44   编辑:Linux教程

當修改或者添加完文件,git commit之後運行git push推送到遠程倉庫,第一次遇到問題:

解決方案參考:解決fatal: unable to connect to github.com問題 http://www.linuxidc.com/Linux/2014-03/98667.htm

$ 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://[email protected]/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://[email protected]/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

Copyright © Linux教程網 All Rights Reserved