According to this SO answer:
git submodule update --remote will only update the branch registered in the .gitmodule (...)
...
(...) you still have to go back to the parent repo, add and commit the new submodule SHA1 reference.
And according to this other:
Or do I have to tell my colleagues to pay more attention and do a git submodule update from time to time?
Ideally this is what they do. If they don't, you could try to add a git-hook which runs a git submodule update after they pulled.
I am working on my own from two different machines. My repo has a submodule in it.
When I need to upodate it normally I do git submodule update --recursive --remote
. And then, I do:
git add .
git commit -m "submodule updated"
git push origin master
The problem is, from the other machine, I pull the changes from the remote git pull origin master
, then I update the submodule with the same code (git submodule update --recursive --remote
), but then I seem I have to still add commit and push those changes again to the remote.
Is this the correct way to proceed?
If so, why should I have to push the updates to submodule twice to the remote?