In recent Git (I'm using v2.15.1), the following will merge upstream submodule changes into the submodules recursively:
git submodule update --recursive --remote --merge
You may add --init
to initialize any uninitialized submodules and use --rebase
if you want to rebase instead of merge.
You need to commit the changes afterwards:
git add . && git commit -m 'Update submodules to latest revisions'