2

我有一个分叉的存储库,它被设置为一个名为 的远程存储库,origin它是从我可以推送访问的原始存储库中分叉的,称为upstream.

我检查了一个补丁发布分支,该分支也存储在两个存储库中:

git branch -va

develop                              8888888
patch-branch-0.9.x                   1111111
remotes/origin/develop               8888888
remotes/origin/patch-branch-0.9.x    1111111
remotes/upstream/develop             8888888
remotes/upstream/patch-branch-0.9.x  1111111

我知道在 中已经合并了拉取请求upstream,所以如果我要运行一个git fetch --allthen another git branch -va,我可能希望看到:

git branch -va

...
patch-branch-0.9.x                   1111111
...
remotes/upstream/patch-branch-0.9.x  2222222

pull但我更喜欢在更新我的本地分支时做一个简单的事情。但是,当我从上游运行拉时:

git checkout patch-branch-0.9.x
git pull upstream patch-branch-0.9.x

即使它报告:

From https://bitbucket.org/...
 * branch            patch-branch-0.9.x -> FETCH_HEAD
Updating 1111111..2222222

它似乎没有更新我从中提取的分支的状态,因为我最终得到:

git branch -va

...
patch-branch-0.9.x                   2222222
...
remotes/upstream/patch-branch-0.9.x  1111111

因此,即使我的本地分支已更新为快进到远程上游分支,我仍然需要运行另一个分支git fetch --allgit branch -va报告我的远程分支的正确 HEAD 提交。(即使它是我从中拉出来的!)

这是标准行为吗?我的印象pull是 afetch后面跟着一个merge?

4

0 回答 0