你的分支比'origin/cherryPick'超前了1次提交。为什么?

4

我遇到了git pull的问题,我已经在本地仓库中提交了我的更改。当我运行 git status 命令时,会显示 "Your branch is ahead of 'origin/cherryPick' by 1 commit" 的消息。 当我尝试从远程仓库拉取代码时,会显示 "Already up-to-date." 的消息。我认为我缺少一些基本的知识点。下面是这三个命令的日志:

wh-test $ git branch -a
alternate

* cherryPick

  master

 new

  squashBranch

  testBranch

  remotes/origin/HEAD -> origin/master

  remotes/origin/cherryPick

  remotes/origin/master

  remotes/origin/testBranch

 git status
# On branch cherryPick

# Your branch is ahead of 'origin/cherryPick' by 1 commit.
#

git pull origin cherryPick

From ssh://xxxx.dyndns.org/home/shopapp/wh-test

 * branch            cherryPick -> FETCH_HEAD

Already up-to-date.

非常感谢您的帮助

1个回答

7

从概念上来说,你所缺少的根本点是,如果你领先于远程存储库一个提交,那么过时的是远程存储库,而不是你。你需要将你的更改推送到他们,而不是拉取,因为没有东西可以拉取。很有可能你已经拥有了所有可用的远程提交,所以你确实是最新的。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接