I have a parent project with a submodule (no nested submodules). The submodule has a new commit (let's call it new-sha
), and the parent refers to that commit in remote repo (I can see submodule @ new-sha
when viewing the repo in web browser).
I have pulled the parent project, and it also refers to the right commit in the working directory, as seen in git show
output:
--- a/submodule
--- b/submodule
@@ -1 +1 @@
-Subproject commit old-sha
+Subproject commit new-sha
I.e. the latest commit in parent project has changed the submodule to new-sha
. However, neither git submodule update
nor git pull --recurse-submodules
update to new-sha
in the submodule, they always check out old-sha
.
Why, and how to fix it?
git version 2.21.0.windows.1
Some additional information: the submodule has sha-new
locally, but its HEAD is stuck at sha-old
.
sha-new
is immediately derived from sha-old
, and here are the last 3 commits, maybe this can give a clue:
sha-new == the top of submodule's branch used by parent project
sha-old == HEAD
sha-xyz == origin/HEAD
The origin/HEAD
line worries me. Even after manually pulling the submodule (cd submodule; git pull origin branch-name:branch-name
) origin/HEAD
stayed at third commit from top.