I am trying to update my submodules so that they use a more recent commit.
When we use submodules, they are supposed to remain in a detached head state. That's fine.
$ cd myproject
$ cd otherlibrary
$ git status .
HEAD detached from 091eccc
nothing to commit, working tree clean
I did some work in otherlibrary
and now I'd like to update myproject
so that it will use these new commits in otherlibrary
. That means, I need to 'update the submodule' somehow.
This doesn't work: (see? it's still has the same commit number)
$ cd myproject
$ cd otherlibrary
$ git submodule update --remote
$ git status .
HEAD detached from 091eccc
nothing to commit, working tree clean
For completeness, I also tried it like this git submodule update --rebase --remote
and like this git submodule update --merge --remote
and that doesn't make any difference.
I also read these two SO articles that talk about the subject, but my problem isn't solved by this: