Skip to content

Commit bc29b0b

Browse files
stefanbellergitster
authored andcommitted
Documentation/git-clone: improve description for submodule recursing
There have been a few complaints on the mailing list that git-clone doesn't respect the `submodule.recurse` setting, which every other command (that potentially knows how to deal with submodules) respects. In case of clone this is not beneficial to respect as the user may not want to obtain all submodules (assuming a pathspec of '.'). Improve the documentation such that the pathspec is mentioned in the synopsis to alleviate the confusion around the submodule recursion flag in git-clone. While at it clarify that the option can be given multiple times for complex pathspecs. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a4e40a commit bc29b0b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Documentation/git-clone.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SYNOPSIS
1414
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
1515
[--dissociate] [--separate-git-dir <git dir>]
1616
[--depth <depth>] [--[no-]single-branch] [--no-tags]
17-
[--recurse-submodules] [--[no-]shallow-submodules]
17+
[--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
1818
[--jobs <n>] [--] <repository> [<directory>]
1919

2020
DESCRIPTION
@@ -231,14 +231,17 @@ branch of some repository for search indexing.
231231
After the clone is created, initialize and clone submodules
232232
within based on the provided pathspec. If no pathspec is
233233
provided, all submodules are initialized and cloned.
234-
Submodules are initialized and cloned using their default
235-
settings. The resulting clone has `submodule.active` set to
234+
This option can be given multiple times for pathspecs consisting
235+
of multiple entries. The resulting clone has `submodule.active` set to
236236
the provided pathspec, or "." (meaning all submodules) if no
237-
pathspec is provided. This is equivalent to running
238-
`git submodule update --init --recursive` immediately after
239-
the clone is finished. This option is ignored if the cloned
240-
repository does not have a worktree/checkout (i.e. if any of
241-
`--no-checkout`/`-n`, `--bare`, or `--mirror` is given)
237+
pathspec is provided.
238+
+
239+
Submodules are initialized and cloned using their default settings. This is
240+
equivalent to running
241+
`git submodule update --init --recursive <pathspec>` immediately after
242+
the clone is finished. This option is ignored if the cloned repository does
243+
not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
244+
or `--mirror` is given)
242245

243246
--[no-]shallow-submodules::
244247
All submodules which are cloned will be shallow with a depth of 1.

0 commit comments

Comments
 (0)