Skip to content

Commit

Permalink
docs: clarify that --depth for git-fetch works with newly initialized…
Browse files Browse the repository at this point in the history
… 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 <gitster@pobox.com>
  • Loading branch information
Sebastian Schuberth authored and Junio C Hamano committed Jan 8, 2016
1 parent fc14281 commit 60253a6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Documentation/fetch-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
option old data in `.git/FETCH_HEAD` will be overwritten.

--depth=<depth>::
Deepen or shorten the history of a 'shallow' repository created by
`git clone` with `--depth=<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=<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
Expand Down

0 comments on commit 60253a6

Please sign in to comment.