Notes for working with Git Submodules, taken from:
https://git-scm.com/book/en/v2/Git-Tools-Submodules
Grab submodule dependencies after a fresh clone
git submodule init
git submodule update
..or alternatively,
git submodule update --init
Start using a submodule in a repo
git submodule add gitUrlOfProjectToAdd
Get upstream changes
git submodule update --remote
git submodule update --remote --merge
Track an alternative branch (rather than master)
git config -f .gitmodules submodule.SUBMODULEALIAS.branch ALTERNATIVEBRANCHNAME
Check that all submodules have been pushed
git push --recurse-submodules=check
To push outstanding changes/updates in submodules, you can cd
to each submodule and git push
as usual.
Alternatively from the top-level, Attempt to push changes in submodules
git push --recurse-submodules=on-demand