threads / discuss / 63112

Fwd: Suggesting config option for clone to always recurse submodules

Subject: Fwd: Suggesting config option for clone to always recurse submodules

## tl;dr

One message between Mar 13, 2025 and Mar 13, 2025.

replies: 0people: 1as markdown or json

Tor Nichols· Mar 13, 2025, 17:49 UTC · lore

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

← back to recent threads