Skip to content

Commit ccdd3da

Browse files
jlehmanngitster
authored andcommitted
clone: Add the --recurse-submodules option as alias for --recursive
Since 1.6.5 "git clone" honors the --recursive option to recursively check out submodules too. As this option can easily be misinterpreted when it is added to other commands like "git grep", add the new --recurse-submodules option as an alias for --recursive so the same option can be used for all commands recursing into submodules. Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ca20906 commit ccdd3da

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Documentation/git-clone.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ SYNOPSIS
1212
'git clone' [--template=<template_directory>]
1313
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
1414
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
15-
[--depth <depth>] [--recursive] [--] <repository> [<directory>]
15+
[--depth <depth>] [--recursive|--recurse-submodules] [--] <repository>
16+
[<directory>]
1617

1718
DESCRIPTION
1819
-----------
@@ -167,6 +168,7 @@ objects from the source repository into a pack in the cloned repository.
167168
as patches.
168169

169170
--recursive::
171+
--recurse-submodules::
170172
After the clone is created, initialize all submodules within,
171173
using their default settings. This is equivalent to running
172174
`git submodule update --init --recursive` immediately after

builtin/clone.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ static struct option builtin_clone_options[] = {
6666
"setup as shared repository"),
6767
OPT_BOOLEAN(0, "recursive", &option_recursive,
6868
"initialize submodules in the clone"),
69+
OPT_BOOLEAN(0, "recurse_submodules", &option_recursive,
70+
"initialize submodules in the clone"),
6971
OPT_STRING(0, "template", &option_template, "path",
7072
"path the template repository"),
7173
OPT_STRING(0, "reference", &option_reference, "repo",

0 commit comments

Comments
 (0)