Skip to content

Commit 85705cf

Browse files
committed
Merge branch 'ss/clone-depth-single-doc'
Documentation for "git fetch --depth" has been updated for clarity. * ss/clone-depth-single-doc: docs: clarify that --depth for git-fetch works with newly initialized repos docs: say "commits" in the --depth option wording for git-clone docs: clarify that passing --depth to git-clone implies --single-branch
2 parents 76b620d + 60253a6 commit 85705cf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Documentation/fetch-options.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
option old data in `.git/FETCH_HEAD` will be overwritten.
99

1010
--depth=<depth>::
11-
Deepen or shorten the history of a 'shallow' repository created by
12-
`git clone` with `--depth=<depth>` option (see linkgit:git-clone[1])
13-
to the specified number of commits from the tip of each remote
14-
branch history. Tags for the deepened commits are not fetched.
11+
Limit fetching to the specified number of commits from the tip of
12+
each remote branch history. If fetching to a 'shallow' repository
13+
created by `git clone` with `--depth=<depth>` option (see
14+
linkgit:git-clone[1]), deepen or shorten the history to the specified
15+
number of commits. Tags for the deepened commits are not fetched.
1516

1617
--unshallow::
1718
If the source repository is complete, convert a shallow

Documentation/git-clone.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,14 @@ objects from the source repository into a pack in the cloned repository.
190190

191191
--depth <depth>::
192192
Create a 'shallow' clone with a history truncated to the
193-
specified number of revisions.
193+
specified number of commits. Implies `--single-branch` unless
194+
`--no-single-branch` is given to fetch the histories near the
195+
tips of all branches.
194196

195197
--[no-]single-branch::
196198
Clone only the history leading to the tip of a single branch,
197199
either specified by the `--branch` option or the primary
198-
branch remote's `HEAD` points at. When creating a shallow
199-
clone with the `--depth` option, this is the default, unless
200-
`--no-single-branch` is given to fetch the histories near the
201-
tips of all branches.
200+
branch remote's `HEAD` points at.
202201
Further fetches into the resulting repository will only update the
203202
remote-tracking branch for the branch this option was used for the
204203
initial cloning. If the HEAD at the remote did not point at any

0 commit comments

Comments
 (0)