What is probably happening is that your master submodule is not the version your repo wants to support.
Install your submodule in the version that the repo wants to hold:
holding/ $ git submodule update
Check the desired SHA1 submodule:
holding/ $ git submodule
Verify that your submodule is master :
holding/ $ cd sub holding/sub $ git checkout master holding/sub $ git log -1
Is SHA1 at (2) the same as you (1)? If not, this is your problem. Something happened to the submodule master, but these new changes were not included in the holding repo.
A persistent repo supports SHA1 as a link to the version of the submodule used. If further development takes place in the submodule repository, the repository-repository still saves the same version; it does not automatically update the submodule.
If you order a newer version (for example, master ) of a submodule, and then return to the holding repo, git status will tell you that you checked the new commit in your submodule. This change in the current submodule commit can be committed to your holding repository. This will update the version of the submodule version that will be used with this commit.
If you want to continue working on a submodule, from the version that the repo wants to conduct, you will need to create a new branch. master reflects further development in the submodule repository, so either you work from master (and include both this further development and your new work), or you create a new branch from the detached head that is referenced.
If you forced master to a detached head, which would be desirable while holding, what would happen to the commits (hereinafter dev) that were created between the detached head and master ? They will be lost. And what happens the next time you push the moved master to origin ? There will be a conflict because your local master will deviate from origin .