@matheusbsbs / matheus-bagliano / commits / 4a465443a6
Fork 0

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>

Derrick Stolee committed Mar 22, 2020 at 19:50 UTC 4a465443a6ce51bd6e1d4ffef56d3f2e8d45f506
1 file changed +12 -1
Documentation/git-clone.txt
+12 -1
@@ -15,7 +15,8 @@ SYNOPSIS
15 [--dissociate] [--separate-git-dir <git dir>]
16 [--depth <depth>] [--[no-]single-branch] [--no-tags]
17 [--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>
20 [<directory>]
21
22 DESCRIPTION
@@ -162,6 +163,16 @@ objects from the source repository into a pack in the cloned repository.
163 of the repository. The sparse-checkout file can be
164 modified to grow the working directory as needed.
165
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 +
176 --mirror::
177 Set up a mirror of the source repository. This implies `--bare`.
178 Compared to `--bare`, `--mirror` not only maps local branches of the