mirror of
https://github.com/git/git.git
synced 2026-03-11 01:28:42 +01:00
Add a new configuration option that lets users specify a default
partial clone filter, optionally scoped by URL pattern. When
cloning a repository whose URL matches a configured pattern,
git-clone automatically applies the filter, equivalent to passing
--filter on the command line.
[clone]
defaultObjectFilter = blob:limit=1m
[clone "https://github.com/"]
defaultObjectFilter = blob:limit=5m
[clone "https://internal.corp.com/large-project/"]
defaultObjectFilter = blob:none
The bare clone.defaultObjectFilter applies to all clones. The
URL-qualified form clone.<url>.defaultObjectFilter restricts the
setting to matching URLs. URL matching uses the existing
urlmatch_config_entry() infrastructure, following the same rules as
http.<url>.* — a domain, namespace, or specific project can be
matched, and the most specific match wins.
The config only affects the initial clone. Once the clone completes,
the filter is recorded in remote.<name>.partialCloneFilter, so
subsequent fetches inherit it automatically. An explicit --filter
on the command line takes precedence, and --no-filter defeats the
configured default entirely.
Signed-off-by: Alan Braithwaite <alan@braithwaite.dev>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
`clone.defaultRemoteName`::
|
|
The name of the remote to create when cloning a repository. Defaults to
|
|
`origin`.
|
|
ifdef::git-clone[]
|
|
It can be overridden by passing the `--origin` command-line
|
|
option.
|
|
endif::[]
|
|
ifndef::git-clone[]
|
|
It can be overridden by passing the `--origin` command-line
|
|
option to linkgit:git-clone[1].
|
|
endif::[]
|
|
|
|
`clone.rejectShallow`::
|
|
Reject cloning a repository if it is a shallow one; this can be overridden by
|
|
passing the `--reject-shallow` option on the command line.
|
|
ifndef::git-clone[]
|
|
See linkgit:git-clone[1].
|
|
endif::[]
|
|
|
|
`clone.filterSubmodules`::
|
|
If a partial clone filter is provided (see `--filter` in
|
|
linkgit:git-rev-list[1]) and `--recurse-submodules` is used, also apply
|
|
the filter to submodules.
|
|
|
|
`clone.defaultObjectFilter`::
|
|
`clone.<url>.defaultObjectFilter`::
|
|
When set to a filter spec string (e.g., `blob:limit=1m`,
|
|
`blob:none`, `tree:0`), linkgit:git-clone[1] will automatically
|
|
use `--filter=<value>` to enable partial clone behavior.
|
|
Objects matching the filter are excluded from the initial
|
|
transfer and lazily fetched on demand (e.g., during checkout).
|
|
Subsequent fetches inherit the filter via the per-remote config
|
|
that is written during the clone.
|
|
+
|
|
The bare `clone.defaultObjectFilter` applies to all clones. The
|
|
URL-qualified form `clone.<url>.defaultObjectFilter` restricts the
|
|
setting to clones whose URL matches `<url>`, following the same
|
|
rules as `http.<url>.*` (see linkgit:git-config[1]). The most
|
|
specific URL match wins. You can match a domain, a namespace, or a
|
|
specific project:
|
|
+
|
|
----
|
|
[clone]
|
|
defaultObjectFilter = blob:limit=1m
|
|
|
|
[clone "https://github.com/"]
|
|
defaultObjectFilter = blob:limit=5m
|
|
|
|
[clone "https://internal.corp.com/large-project/"]
|
|
defaultObjectFilter = blob:none
|
|
----
|
|
+
|
|
An explicit `--filter` option on the command line takes precedence
|
|
over this config, and `--no-filter` defeats it entirely to force a
|
|
full clone. Only affects the initial clone; it has no effect on
|
|
later fetches into an existing repository. If the server does not
|
|
support object filtering, the setting is silently ignored.
|