I have the following project structure:
root-project
|
|-- A
| |
| |-- C
|
|-- B
A and B are submodules of the root-project. C is in turn a submodule of project A. Suppose I have made changes to projects A,B and C and commited these changes to the respective indices. After that I update the references to A and B in the root-project and commit that change as well. When I push the changes of the root-project with the option --recurse-submodules=on-demand, git pushes all commits of projects A, B and the root-project, but silently ignores the commits of project C. I would expect that it pushes the changes of project C as well.
I know that i can work around this problem by using the following two commands in the root-project folder.
git submodule foreach --recursive 'git push origin master'
git push
Could someone clarify whether I'm doing something wrong or if this is a bug in git-push.I have already asked this question on the git mailing list but didn't receive any response: http://thread.gmane.org/gmane.comp.version-control.git/266184
I have also written a small shell script that sets up the described project structure and executes the recursive push operation: https://gist.github.com/usommerl/6e8defcba94bd4ba1438
git version 2.3.3
git add C
in theA
submodule first? Committing to a submodule is like saving changes to a file, you have togit add
the new content. – Roley