files-backend: don't rewrite the `packed-refs` file unnecessarily
[gitweb.git] / Documentation / git-clone.txt
index ec41d3d698a1bcffac3b3a21489b61cc74f9d8d0..83c8e9b394a3a83639852210e2f6e237a0077ed2 100644 (file)
@@ -13,8 +13,8 @@ SYNOPSIS
          [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
          [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
          [--dissociate] [--separate-git-dir <git dir>]
-         [--depth <depth>] [--[no-]single-branch]
-         [--recursive | --recurse-submodules] [--[no-]shallow-submodules]
+         [--depth <depth>] [--[no-]single-branch] [--no-tags]
+         [--recurse-submodules] [--[no-]shallow-submodules]
          [--jobs <n>] [--] <repository> [<directory>]
 
 DESCRIPTION
@@ -90,13 +90,16 @@ 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 <repository>::
+--reference[-if-able] <repository>::
        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
        require fewer objects to be copied from the repository
        being cloned, reducing network and local storage costs.
+       When using the `--reference-if-able`, a non existing
+       directory is skipped with a warning instead of aborting
+       the clone.
 +
 *NOTE*: see the NOTE for the `--shared` option, and also the
 `--dissociate` option.
@@ -194,6 +197,14 @@ objects from the source repository into a pack in the cloned repository.
        tips of all branches. If you want to clone submodules shallowly,
        also pass `--shallow-submodules`.
 
+--shallow-since=<date>::
+       Create a shallow clone with a history after the specified time.
+
+--shallow-exclude=<revision>::
+       Create a shallow clone with a history, excluding commits
+       reachable from a specified remote branch or tag.  This option
+       can be specified multiple times.
+
 --[no-]single-branch::
        Clone only the history leading to the tip of a single branch,
        either specified by the `--branch` option or the primary
@@ -204,10 +215,26 @@ objects from the source repository into a pack in the cloned repository.
        branch when `--single-branch` clone was made, no remote-tracking
        branch is created.
 
---recursive::
---recurse-submodules::
-       After the clone is created, initialize all submodules within,
-       using their default settings. This is equivalent to running
+--no-tags::
+       Don't clone any tags, and set
+       `remote.<remote>.tagOpt=--no-tags` in the config, ensuring
+       that future `git pull` and `git fetch` operations won't follow
+       any tags. Subsequent explicit tag fetches will still work,
+       (see linkgit:git-fetch[1]).
++
+Can be used in conjunction with `--single-branch` to clone and
+maintain a branch with no references other than a single cloned
+branch. This is useful e.g. to maintain minimal clones of the default
+branch of some repository for search indexing.
+
+--recurse-submodules[=<pathspec]::
+       After the clone is created, initialize and clone submodules
+       within based on the provided pathspec.  If no pathspec is
+       provided, all submodules are initialized and cloned.
+       Submodules are initialized and cloned using their default
+       settings.  The resulting clone has `submodule.active` set to
+       the provided pathspec, or "." (meaning all submodules) if no
+       pathspec is provided.  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