git status:在分支XXX上你的分支超过原点/ YYY由10个提交

时间:2014-09-25 07:48:08

标签: git git-branch

我在git status上有这条消息:

# On branch YYY
# Your branch is ahead of 'origin/XXX' by 10 commits.
#
nothing to commit (working directory clean)

分支YYY是分支XXX的子代。但通常我会期待git状态:

# On branch YYY
# Your branch is ahead of 'origin/YYY' by 10 commits.
#
nothing to commit (working directory clean)

Git fetch无法解决问题。 有什么想法吗?

git branch -avvv(已过滤)的输出:

* XXX                              0d64037 [origin/YYY: ahead 10] test
  remotes/origin/XXX               0d64037 test

1 个答案:

答案 0 :(得分:1)

检查git branch -avvv

的输出

可能YYY已设置为跟踪origin/XXX

您可以使用以下命令进行更改:

git branch branch_name -u your_new_remote/branch_name
git branch YYY -u origin/YYY

# for git older than 1.8
git branch YYY --set-upstream origin/YYY

YYY输出中看到有关origin/YYY的任何内容之前,您需要至少推送git status一次。