Skip to content

Commit

Permalink
clone: Add the --recurse-submodules option as alias for --recursive
Browse files Browse the repository at this point in the history
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 <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jens Lehmann authored and Junio C Hamano committed Nov 5, 2010
1 parent ca20906 commit ccdd3da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ SYNOPSIS
'git clone' [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
[--depth <depth>] [--recursive] [--] <repository> [<directory>]
[--depth <depth>] [--recursive|--recurse-submodules] [--] <repository>
[<directory>]

DESCRIPTION
-----------
Expand Down Expand Up @@ -167,6 +168,7 @@ objects from the source repository into a pack in the cloned repository.
as patches.

--recursive::
--recurse-submodules::
After the clone is created, initialize all submodules within,
using their default settings. This is equivalent to running
`git submodule update --init --recursive` immediately after
Expand Down
2 changes: 2 additions & 0 deletions builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static struct option builtin_clone_options[] = {
"setup as shared repository"),
OPT_BOOLEAN(0, "recursive", &option_recursive,
"initialize submodules in the clone"),
OPT_BOOLEAN(0, "recurse_submodules", &option_recursive,
"initialize submodules in the clone"),
OPT_STRING(0, "template", &option_template, "path",
"path the template repository"),
OPT_STRING(0, "reference", &option_reference, "repo",
Expand Down

0 comments on commit ccdd3da

Please sign in to comment.