git - 您的分支比 'origin/cherryPick' 领先 1 次提交。为什么?

标签 git git-pull

我在使用 git pull 时遇到问题。我已经在本地仓库中提交了我的更改。当我执行 git status 时,我确实收到一条消息,说“你的分支在 1 次提交之前领先于‘origin/cherryPick’”。当我尝试从远程存储库中 pull 时,我收到一条消息说“已经是最新的。”。我认为我遗漏了一些基本点。我已将所有 3 个命令的日志粘贴到下面

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.

任何帮助将不胜感激

最佳答案

我想从概念上说,你缺少的基本点是,如果你在一次提交之前领先于远程 repo ,那么过时的是远程 repo ,而不是你。您需要将更改推送给它们,而不是 pull ,因为没有什么可 pull 的。您可能已获得所有远程可用的提交,因此您确实是最新的。

关于git - 您的分支比 'origin/cherryPick' 领先 1 次提交。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2193411/

相关文章:

git - 'git pull' 和 'git fetch' 有什么区别?

git - 撤消 git 中单个文件的未暂存修改

git - 丢弃之前的提交,强制推送到远程

android - 如何使用git跟踪android分支

Git分离头问题

windows - Git 从另一个用户的工作目录中 pull

git - 在 VS2013 中查看两个 git 修订版之间的差异

Git bash 不让我 pull

linux - 从 Bash 脚本中使用 Apache 执行 'git pull'

laravel - 防止 git 在 git pull 时覆盖文件所有者