2016-04-27 30 views
4
$ git push 
fatal: The current branch master has no upstream branch. 
To push the current branch and set the remote as upstream, use 

    git push --set-upstream origin master 


$ git push --set-upstream origin master 
fatal: I don't handle protocol '' 

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

$ git push --set-upstream origin master 
fatal: I don't handle protocol '' 

$ git push 
fatal: The current branch master has no upstream branch. 
To push the current branch and set the remote as upstream, use 

    git push --set-upstream origin master 
+3

看起來您的遠程URL配置錯誤。 git remote -v顯示什麼? – larsks

+0

皮爾@ PIERRE-PC〜/項目/ datasciencecoursera(主) $ GIT中遠程-v datasciencecoursera://github.com/pbxavier/datasciencecoursera.git(讀取) datasciencecoursera://github.com/pbxavier/datasciencecoursera。 git(push) origin https://github.com/pbxavier/datasciencecoursera(fetch) origin https://github.com/pbxavier/datasciencecoursera(push) – pbx2

+0

當人們要求更多信息時,最好更新問題而不是留下評論,因爲評論並沒有很多正確的格式選項。但是,你似乎錯過了那些URL上的協議(它們以'://'而不是'https://'開頭)。 @VonC的回答應該讓你感到滿意。 – larsks

回答

9

嘗試和推動網址重置爲:

git remote set-url origin https://github.com/<username>/<reponame> 

與datasciencecoursera回購名稱替換<username>與您的GitHub的用戶帳戶,<reponame>

0

它是Https的安全協議錯誤。 (在ssl中也是如此) 其固定與VonC說的信息。 git remote set-url原點https://github.com//

只需按照Vonc說明操作即可。

3

我有一個類似的問題,我做了以下內容,運行以下命令

1. git remote set-url origin https://github.com/<username>/<reponame> 

更換用戶名和reponame然後運行

2. git push --set-upstream origin master 

好運。