aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2025-02-06 07:33:30 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-06 12:23:53 -0800
commitbc26f7690a318fd0a875bfd8d56c70e1ccb79ccb (patch)
treee5de4e66e3f92c19e4598025a9058f4cd6d5f19a /Documentation
parentclone: cut down on global variables in clone.c (diff)
downloadgit-bc26f7690a318fd0a875bfd8d56c70e1ccb79ccb.tar.gz
git-bc26f7690a318fd0a875bfd8d56c70e1ccb79ccb.zip
clone: make it possible to specify --tags
Option --no-tags was added in 0dab2468ee (clone: add a --no-tags option to clone without tags, 2017-04-26). At the time there was no need to support --tags as well, although there was some conversation about it[1]. To simplify the code and to prepare for future commits, invert the flag internally. Functionally there is no change, because the flag is default-enabled passing `--tags` has no effect, so there's no need to add tests for this. [1]: https://lore.kernel.org/git/CAGZ79kbHuMpiavJ90kQLEL_AR0BEyArcZoEWAjPPhOFacN16YQ@mail.gmail.com/ Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-clone.txt17
1 files changed, 10 insertions, 7 deletions
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index de8d8f5893..8d0476f6dc 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -13,7 +13,7 @@ git clone [--template=<template-directory>]
[-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] [--no-tags]
+ [--depth <depth>] [--[no-]single-branch] [--[no-]tags]
[--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
[--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
[--filter=<filter-spec>] [--also-filter-submodules]] [--] <repository>
@@ -273,12 +273,15 @@ corresponding `--mirror` and `--no-tags` options instead.
branch when `--single-branch` clone was made, no remote-tracking
branch is created.
-`--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]).
+`--[no-]tags`::
+ Control whether or not tags will be cloned. When `--no-tags` is
+ given, the option will be become permanent by setting the
+ `remote.<remote>.tagOpt=--no-tags` configuration. This ensures that
+ future `git pull` and `git fetch` won't follow any tags. Subsequent
+ explicit tag fetches will still work (see linkgit:git-fetch[1]).
+
+ By default, tags are cloned and passing `--tags` is thus typically a
+ no-op, unless it cancels out a previous `--no-tags`.
+
Can be used in conjunction with `--single-branch` to clone and
maintain a branch with no references other than a single cloned