git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git submodule update on rebase or merge

From
Pperegineme <peregineme@gmail.com>
Date
Mar 28, 2023, 07:04 UTC
Message-ID
<CAO_O05BjFve4=xXaqf7xX8Ls9h0jPHzx6stDLuEFvODyqcRiqw@mail.gmail.com>

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.

Message 1 of 1 in “Git submodule update on rebase or merge”
  1. pereginemeMar 28, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.