X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-clone.txt;h=f23100e5094a891a0b6205badc0516fedfc74664;hb=5b590d783a461c63fa803d1c21b57bc79c0207f7;hp=4072f40d7ae5417c51d1cddcf587b674aa1dc0e5;hpb=0d5055665ca1e76659ffa96bf972b4b0125ea069;p=git.git diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 4072f40d7..f23100e50 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git clone' [--template=] [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror] [-o ] [-u ] [--reference ] - [--depth ] [--] [] + [--depth ] [--recursive] [--] [] DESCRIPTION ----------- @@ -72,11 +72,19 @@ These objects may be removed by normal git operations (such as 'git-commit') which automatically call `git gc --auto`. (See linkgit:git-gc[1].) If these objects are removed and were referenced by the cloned repository, then the cloned repository will become corrupt. - - ++ +Note that running `git repack` without the `-l` option in a repository +cloned with `-s` will copy objects from the source repository into a pack +in the cloned repository, removing the disk space savings of `clone -s`. +It is safe, however, to run `git gc`, which uses the `-l` option by +default. ++ +If you want to break the dependency of a repository cloned with `-s` on +its source repository, you can simply run `git repack -a` to copy all +objects from the source repository into a pack in the cloned repository. --reference :: - If the reference repository is on the local machine + If the reference repository is on the local machine, automatically setup .git/objects/info/alternates to obtain objects from the reference repository. Using an already existing repository as an alternate will @@ -119,6 +127,13 @@ then the cloned repository will become corrupt. Instead of using the remote name 'origin' to keep track of the upstream repository, use . +--branch :: +-b :: + Instead of pointing the newly created HEAD to the branch pointed + to by the cloned repositoroy's HEAD, point to branch + instead. In a non-bare repository, this is the branch that will + be checked out. + --upload-pack :: -u :: When given, and the repository to clone from is accessed @@ -139,6 +154,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) + :: The (possibly remote) repository to clone from. See the <> section below for more information on specifying @@ -149,7 +172,7 @@ then the cloned repository will become corrupt. part of the source repository is used if no directory is explicitly given ("repo" for "/path/to/repo.git" and "foo" for "host.xz:foo/.git"). Cloning into an existing directory - is not allowed. + is only allowed if the directory is empty. :git-clone: 1 include::urls.txt[]