threads / discuss / 59487

Git submodule update on rebase or merge

Subject: Git submodule update on rebase or merge

## tl;dr

One message between Mar 28, 2023 and Mar 28, 2023.

replies: 0people: 1as markdown or json

peregineme· Mar 28, 2023, 07:04 UTC · lore

Why don't git rebase and merge have a --recurse-submodules option so that it updates the submodules when the operation is completed successfully?

The submodule.recurse configuration will thus affect the rebase and merge commands so that the submodules are automatically updated when running rebase or merge, after all, this configuration is supposed to make working with submodules automatic, especially when one is not making changes in the submodule, but just referencing it.

This seems very intuitive since commands like checkout and especially reset have the --recurse-submodules option, and even on the git rebase page it describes part of the git rebase process ass effectively running reset:

The current branch is reset to <upstream> or <newbase> if the --onto option was supplied. This has the exact same effect as git reset --hard <upstream> (or <newbase>). ORIG_HEAD is set to point at the tip of the branch before the reset.

I expected that at least the git `submodule.recurse` configuration will affect the rebase and merge.

← back to recent threads