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 i
You need to make sure the new commit was pushed to the submodule remote repository. (the one listed in the .gitmodules URL line)
Then you need to do a git status within your main parent repo local clone, to check it is at the latest of the master
branch and that git ls-tree does show the right submodule root tree commit.
The OP me76 adds in the comments:
I "solved" it differently.
I had to do some changes in the submodule, so I manually switched to the right commit, did and committed the changes in submodule, and committed the submodule in the parent project.
This finally updated the reference to submodule.
That is because doing so forces the main repository to update the gitlink (special entry in the index) to reference the new commit of the submodule main folder tree.
Pushing that will publish that new gitlink commit.
The OP also refers to this thread:
The person had (apparently conflicting) version of submodule in the index (
git ls-files --stage | grep 160000
).After removing it from index (
git rm --cached
) and re-adding it withgit submodule add
, I was finally able to update the submodule from the parent project.
Note: the git rm --cached asubmoduleFolder
must not ends with '/
': you are removing a gitlink (the '160000' special entry in the index). Not a folder.