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

Fwd: Suggesting config option for clone to always recurse submodules

From
TNTor Nichols <bustedchain@gmail.com>
Date
Mar 13, 2025, 17:49 UTC
Message-ID
<CAJerik+ZJdV+YW-XePfHRzwCn3CBekK42fA9M19AkduK_YW44g@mail.gmail.com>
In-Reply-To
<CAJerikKVusF=7w6Wmmbn8a2sQ9OQOzZG3j8sJFx2_B=+Y6QGqg@mail.gmail.com>

Use case: Top level project with submodule. The submodule also has a submodule in it.

I would like to be able to set an option with git config that applies the --recursive or --recurse-submodules flag to all clone commands.

Looking at the .gitconfig file, I would have expected this to work:
[clone]
     recursive = true
OR:
[clone]
     recurse-submodules = true

When I checkout a branch, it is sometimes nice to have it go ahead and checkout the submodules too. Other times it is nice to checkout a specific branch without changing the submodules. So I don't want to change the existing behavior with a flag that affects multiple operations. Besides, the current way of applying a config for submodules recursiveness excludes clone anyway... If clone is going to be excluded, it would be nice for clone to have its own flag. Clone is the place where I would 100% of the time want to go ahead and clone submodules without executing another command.

Since I use an IDE and the CLI, having a config that makes it work the same in both places would be really nice. The IDE is "smart" and will clone the submodules automatically... it would be nice to make the CLI configurable to the point where I get the same behavior either way.

Thank you for considering my request.
-Tor
Message 1 of 1 in “Fwd: Suggesting config option for clone to always recurse submodules”
  1. Tor NicholsMar 13, 2025

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.