From 28a1b56932c222b326e4ac0cd480d4e0be72fb1c Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 6 Jan 2016 14:06:47 +0100 Subject: docs: clarify that passing --depth to git-clone implies --single-branch It is confusing to document how --depth behaves as part of the --single-branch docs. Better move that part to the --depth docs, saying that it implies --single-branch by default. Signed-off-by: Sebastian Schuberth Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 0363d0039..dd8271478 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -178,15 +178,14 @@ objects from the source repository into a pack in the cloned repository. --depth :: Create a 'shallow' clone with a history truncated to the - specified number of revisions. + specified number of revisions. Implies `--single-branch` unless + `--no-single-branch` is given to fetch the histories near the + tips of all branches. --[no-]single-branch:: Clone only the history leading to the tip of a single branch, either specified by the `--branch` option or the primary - branch remote's `HEAD` points at. When creating a shallow - clone with the `--depth` option, this is the default, unless - `--no-single-branch` is given to fetch the histories near the - tips of all branches. + branch remote's `HEAD` points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any -- cgit v1.2.1 From fc142811d14d3acb64d1c2057a774fa1573e60cb Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Fri, 8 Jan 2016 10:18:21 +0100 Subject: docs: say "commits" in the --depth option wording for git-clone It is not wrong to talk about "revisions" here, but in this context revisions are always commits, and that is how we already name it in the git-fetch docs. So align the docs by always referring to "commits". Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index dd8271478..4df1af123 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -178,7 +178,7 @@ objects from the source repository into a pack in the cloned repository. --depth :: Create a 'shallow' clone with a history truncated to the - specified number of revisions. Implies `--single-branch` unless + specified number of commits. Implies `--single-branch` unless `--no-single-branch` is given to fetch the histories near the tips of all branches. -- cgit v1.2.1 From 60253a605d230a7fd2b32e77e94bd620c1399b72 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Fri, 8 Jan 2016 10:32:52 +0100 Subject: docs: clarify that --depth for git-fetch works with newly initialized repos The original wording sounded as if --depth could only be used to deepen or shorten the history of existing repos. However, that is not the case. In a workflow like $ git init $ git remote add origin https://github.com/git/git.git $ git fetch --depth=1 The newly initialized repo is properly created as a shallow repo. Signed-off-by: Junio C Hamano --- Documentation/fetch-options.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 92c68c3fd..fae1d7834 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -8,10 +8,11 @@ option old data in `.git/FETCH_HEAD` will be overwritten. --depth=:: - Deepen or shorten the history of a 'shallow' repository created by - `git clone` with `--depth=` option (see linkgit:git-clone[1]) - to the specified number of commits from the tip of each remote - branch history. Tags for the deepened commits are not fetched. + Limit fetching to the specified number of commits from the tip of + each remote branch history. If fetching to a 'shallow' repository + created by `git clone` with `--depth=` option (see + linkgit:git-clone[1]), deepen or shorten the history to the specified + number of commits. Tags for the deepened commits are not fetched. --unshallow:: If the source repository is complete, convert a shallow -- cgit v1.2.1