2016-04-27 48 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 

好运。