diff options
author | Johan Herland <johan@herland.net> | 2009-08-20 01:07:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-20 16:59:50 -0700 |
commit | e7fed18a89fae97655687e19f13cd802d8d70845 (patch) | |
tree | e9bd4f339a705f2290348e42a96ed69986cbe514 /Documentation/git-clone.txt | |
parent | e3ae4a8613151c93ffce78c674ac91c1ee34eef6 (diff) | |
download | git-e7fed18a89fae97655687e19f13cd802d8d70845.tar.gz |
git clone: Add --recursive to automatically checkout (nested) submodules
Many projects using submodules expect all submodules to be checked out
in order to build/work correctly. A common command sequence for
developers on such projects is:
git clone url/to/project
cd project
git submodule update --init (--recursive)
This patch introduces the --recursive option to git-clone. The new
option causes git-clone to recursively clone and checkout all
submodules of the cloned project. Hence, the above command sequence
can be reduced to:
git clone --recursive url/to/project
--recursive is ignored if no checkout is done by the git-clone.
The patch also includes documentation and a selftest.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-clone.txt')
-rw-r--r-- | Documentation/git-clone.txt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index b14de6c407..5a685ceec9 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git clone' [--template=<template_directory>] [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror] [-o <name>] [-u <upload-pack>] [--reference <repository>] - [--depth <depth>] [--] <repository> [<directory>] + [--depth <depth>] [--recursive] [--] <repository> [<directory>] DESCRIPTION ----------- @@ -139,6 +139,14 @@ then the cloned repository will become corrupt. with a long history, and would want to send in fixes as patches. +--recursive:: + 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 + the clone is finished. This option is ignored if the cloned + repository does not have a worktree/checkout (i.e. if any of + `--no-checkout`/`-n`, `--bare`, or `--mirror` is given) + <repository>:: The (possibly remote) repository to clone from. See the <<URLS,URLS>> section below for more information on specifying |