我有一个跟踪非默认分支的仓库。因此,有一个名为“master”的本地分支应该跟踪“origin/master-13.07”。我已经完成了“push -u”,我相信它应该足够了,分支被跟踪。的输出git branch -vv
:
C:\work\repo>git branch -vv
stuff 68792df [origin/stuff-13.07] Small bugfix
* master 68792df [origin/master-13.07: ahead 1] Small bugfix
的输出git status
C:\work\repo>git status
# On branch master
# Your branch is ahead of 'origin/master-13.07' by 1 commit.
# (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
一切似乎都很好,但是当我只使用“git push”(正如上面的 git 推荐的那样)时,它失败了:
C:\work\repo>git push
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use
git push origin HEAD:master-13.07
To push to the branch of the same name on the remote, use
git push origin master
是的,我知道名称不匹配,这正是我想要的,我通过“push -u”告诉了 git。为什么我不能只使用“推”?
C:\work\repo>git --version
git version 1.8.3.msysgit.0
C:\work\repo>git config push.default
simple