Skip to content

Commit 60253a6

Browse files
sschuberthgitster
authored andcommitted
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 <[email protected]>
1 parent fc14281 commit 60253a6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
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

0 commit comments

Comments
 (0)