2015-09-25 61 views
1
There is no tracking information for the current branch. 
Please specify which branch you want to merge with. 
See git-pull(1) for details 

    git pull <remote> <branch> 

If you wish to set tracking information for this branch you can do so with: 

    git branch --set-upstream-to=origin/<branch> EXP-20-DOMAIN-CONVERSION 

这是什么意思?这听起来像我有一个远程分支,但它没有正确连接到远程存储库。 这用于在不同的分支上工作。难以设置git推/拉

当我尝试设置它时,我总是收到错误。

>git branch --set-upstream-to=origin/EXP-20-DOMAIN-CONVERSI 
ON EXP-20-DOMAIN-CONVERSION 
error: the requested upstream branch 'origin/EXP-20-DOMAIN-CONVERSION' does not 
exist 
hint: 
hint: If you are planning on basing your work on an upstream 
hint: branch that already exists at the remote, you may need to 
hint: run "git fetch" to retrieve it. 
hint: 
hint: If you are planning to push out a new local branch that 
hint: will track its remote counterpart, you may want to use 
hint: "git push -u" to set the upstream config as you push. 

我尝试运行git fetch,但它并没有告诉我发生了什么事情。 我可以在我的Web浏览器中在线查看分支。

>git branch --v 
* EXP-20-DOMAIN-CONVERSION    d53eae9 EXP-20-DOMAIN-CONVERSIOn started 
testing hash code 
...other branches 

我注意到上游拼错了。有一个小写字母n。也许这是造成它?我该如何解决?

回答

2

正如您猜测的那样,这是一个区分大小写的问题。 Git在区分大小写的文件系统中区分大小写。

要重命名的远程分支是正确的(通过跟踪,删除并重新推动它),运行以下命令:

$ git branch EXP-20-DOMAIN-CONVERSION origin/EXP-20-DOMAIN-CONVERSIOn 
$ git push origin --set-upstream EXP-20-DOMAIN-CONVERSION 
$ git push origin :EXP-20-DOMAIN-CONVERSIOn 

或者,如果你已经有了下一个上最新的本地分支正确的名称,只需删除远程分支并重新推送:

$ git push origin --set-upstream EXP-20-DOMAIN-CONVERSION 
$ git push origin :EXP-20-DOMAIN-CONVERSIOn 
+0

谢谢。有用! 我看到我没有正确设置我的上游 – obesechicken13