Skip to content

Commit 4a46544

Browse files
derrickstoleegitster
authored andcommitted
clone: document --filter options
It turns out that the "--filter=<filter-spec>" option is not documented anywhere in the "git clone" page, and instead is detailed carefully in "git rev-list" where it serves a different purpose. Add a small bit about this option in the documentation. It would be worth some time to create a subsection in the "git clone" documentation about partial clone as a concept and how it can be a surprising experience. For example, "git checkout" will likely trigger a pack download. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 55a7568 commit 4a46544

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Documentation/git-clone.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ SYNOPSIS
1515
[--dissociate] [--separate-git-dir <git dir>]
1616
[--depth <depth>] [--[no-]single-branch] [--no-tags]
1717
[--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
18-
[--[no-]remote-submodules] [--jobs <n>] [--sparse] [--] <repository>
18+
[--[no-]remote-submodules] [--jobs <n>] [--sparse]
19+
[--filter=<filter>] [--] <repository>
1920
[<directory>]
2021

2122
DESCRIPTION
@@ -162,6 +163,16 @@ objects from the source repository into a pack in the cloned repository.
162163
of the repository. The sparse-checkout file can be
163164
modified to grow the working directory as needed.
164165

166+
--filter=<filter-spec>::
167+
Use the partial clone feature and request that the server sends
168+
a subset of reachable objects according to a given object filter.
169+
When using `--filter`, the supplied `<filter-spec>` is used for
170+
the partial clone filter. For example, `--filter=blob:none` will
171+
filter out all blobs (file contents) until needed by Git. Also,
172+
`--filter=blob:limit=<size>` will filter out all blobs of size
173+
at least `<size>`. For more details on filter specifications, see
174+
the `--filter` option in linkgit:git-rev-list[1].
175+
165176
--mirror::
166177
Set up a mirror of the source repository. This implies `--bare`.
167178
Compared to `--bare`, `--mirror` not only maps local branches of the

0 commit comments

Comments
 (0)