我在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
答案 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
一次。