<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/fetch-options.adoc, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-15T18:30:40Z</updated>
<entry>
<title>remote: add negotiationRequire config as default for --negotiation-require</title>
<updated>2026-04-15T18:30:40Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=288ea6c3c275d29817efa6e80711701abd041dfe'/>
<id>urn:sha1:288ea6c3c275d29817efa6e80711701abd041dfe</id>
<content type='text'>
Add a new 'remote.&lt;name&gt;.negotiationRequire' multi-valued config option
that provides default values for --negotiation-require when no
--negotiation-require arguments are specified over the command line.
This is a mirror of how 'remote.&lt;name&gt;.negotiationRestrict' specifies
defaults for the --negotiation-restrict arguments.

Each value is either an exact ref name or a glob pattern whose tips
should always be sent as 'have' lines during negotiation. The config
values are resolved through the same resolve_negotiation_require()
codepath as the CLI options.

This option is additive with the normal negotiation process: the
negotiation algorithm still runs and advertises its own selected
commits, but the refs matching the config are sent unconditionally
on top of those heuristically selected commits.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch: add --negotiation-require option for negotiation</title>
<updated>2026-04-15T18:30:40Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18d5475b45b2a883ca88b12c87f4cc19d1ec5cf2'/>
<id>urn:sha1:18d5475b45b2a883ca88b12c87f4cc19d1ec5cf2</id>
<content type='text'>
Add a new --negotiation-require option to 'git fetch', which ensures
that certain ref tips are always sent as 'have' lines during fetch
negotiation, regardless of what the negotiation algorithm selects.

This is useful when the repository has a large number of references, so
the normal negotiation algorithm truncates the list. This is especially
important in repositories with long parallel commit histories. For
example, a repo could have a 'dev' branch for development and a
'release' branch for released versions. If the 'dev' branch isn't
selected for negotiation, then it's not a big deal because there are
many in-progress development branches with a shared history. However, if
'release' is not selected for negotiation, then the server may think
that this is the first time the client has asked for that reference,
causing a full download of its parallel commit history (and any extra
data that may be unique to that branch). This is based on a real example
where certain fetches would grow to 60+ GB when a release branch
updated.

This option is a complement to --negotiation-restrict, which reduces the
negotiation ref set to a specific list. In the earlier example, using
--negotiation-restrict to focus the negotiation to 'dev' and 'release'
would avoid those problematic downloads, but would still not allow
advertising potentially-relevant user brances. In this way, the
'require' version solves the problem I mention while allowing
negotiation to pick other references opportunistically. The two options
can also be combined to allow the best of both worlds.

The argument may be an exact ref name or a glob pattern. Non-existent
refs are silently ignored.

Also add --negotiation-require to 'git pull' passthrough options.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch: add --negotiation-restrict option</title>
<updated>2026-04-15T18:30:39Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d542ba848889be052927828218a0d4c88a812cb4'/>
<id>urn:sha1:d542ba848889be052927828218a0d4c88a812cb4</id>
<content type='text'>
The --negotiation-tip option to 'git fetch' and 'git pull' allows users
to specify that they want to focus negotiation on a small set of
references. This is a _restriction_ on the negotiation set, helping to
focus the negotiation when the ref count is high. However, it doesn't
allow for the ability to opportunistically select references beyond that
list.

This subtle detail that this is a 'maximum set' and not a 'minimum set'
is not immediately clear from the option name. This makes it more
complicated to add a new option that provides the complementary behavior
of a minimum set.

For now, create a new synonym option, --negotiation-restrict, that
behaves identically to --negotiation-tip. Update the documentation to
make it clear that this new name is the preferred option, but we keep
the old name for compatibility.

Update a few warning messages with the new option, but also make them
translatable with the option name inserted by formatting. At least one
of these messages will be reused later for a new option.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'db/doc-fetch-jobs-auto'</title>
<updated>2026-02-27T23:11:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-27T23:11:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4416ec1ae3cc431e2c441410ebee7da3e87fb66d'/>
<id>urn:sha1:4416ec1ae3cc431e2c441410ebee7da3e87fb66d</id>
<content type='text'>
Doc update.

* db/doc-fetch-jobs-auto:
  doc: fetch: document `--jobs=0` behavior
</content>
</entry>
<entry>
<title>doc: fetch: document `--jobs=0` behavior</title>
<updated>2026-02-19T17:36:59Z</updated>
<author>
<name>Daniel D. Beck</name>
<email>daniel@ddbeck.com</email>
</author>
<published>2026-02-18T19:32:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=143e84958cb0209947a56d656c8e947d736dd4ab'/>
<id>urn:sha1:143e84958cb0209947a56d656c8e947d736dd4ab</id>
<content type='text'>
In c39952b92 (fetch: choose a sensible default with --jobs=0 again,
2023-02-20), the `--jobs=0` behavior was (re)introduced, but it went
undocumented. Since this is the same behavior as `git -c fetch.parallel=0
fetch`, which is documented, this change creates symmetry between the two
documentation sections.

Signed-off-by: Daniel D. Beck &lt;daniel@ddbeck.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: wire up and enable auto filter logic</title>
<updated>2026-02-17T19:46:41Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2026-02-16T13:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef2f1845ec4b683df791bfd956f551b096a38009'/>
<id>urn:sha1:ef2f1845ec4b683df791bfd956f551b096a38009</id>
<content type='text'>
Previous commits have set up an infrastructure for `--filter=auto` to
automatically prepare a partial clone filter based on what the server
advertised and the client accepted.

Using that infrastructure, let's now enable the `--filter=auto` option
in `git clone` and `git fetch` by setting `allow_auto_filter` to 1.

Note that these small changes mean that when `git clone --filter=auto`
or `git fetch --filter=auto` are used, "auto" is automatically saved
as the partial clone filter for the server on the client. Therefore
subsequent calls to `git fetch` on the client will automatically use
this "auto" mode even without `--filter=auto`.

Let's also set `allow_auto_filter` to 1 in `transport.c`, as the
transport layer must be able to accept the "auto" filter spec even if
the invoking command hasn't fully parsed it yet.

When an "auto" filter is requested, let's have the "fetch-pack.c" code
in `do_fetch_pack_v2()` compute a filter and send it to the server.

In `do_fetch_pack_v2()` the logic also needs to check for the
"promisor-remote" capability and call `promisor_remote_reply()` to
parse advertised remotes and populate the list of those accepted (and
their filters).

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: fetch: document `--filter=&lt;filter-spec&gt;` option</title>
<updated>2026-02-17T19:46:40Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2026-02-16T13:23:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=190438b62fa5624077c2ee48065f47e1a56d01a7'/>
<id>urn:sha1:190438b62fa5624077c2ee48065f47e1a56d01a7</id>
<content type='text'>
The `--filter=&lt;filter-spec&gt;` option is documented in most commands that
support it except `git fetch`.

Let's fix that and document this option. To ensure consistency across
commands, let's reuse the exact description currently found in
`git clone`.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: convert git pull to synopsis style</title>
<updated>2025-11-19T23:00:42Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2025-11-19T21:40:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c80a5ebce0e6afe3f9d3f5047f3de524386c40bb'/>
<id>urn:sha1:c80a5ebce0e6afe3f9d3f5047f3de524386c40bb</id>
<content type='text'>
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _&lt;placeholder&gt;_ instead of &lt;placeholder&gt; in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: convert git fetch to synopsis style</title>
<updated>2025-11-19T23:00:37Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2025-11-19T21:40:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=903b04a3e721f4afb337bd48890b69e16c04c5d6'/>
<id>urn:sha1:903b04a3e721f4afb337bd48890b69e16c04c5d6</id>
<content type='text'>
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _&lt;placeholder&gt;_ instead of &lt;placeholder&gt; in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kh/doc-markup-fixes'</title>
<updated>2025-09-12T17:41:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-09-12T17:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4097eac99cc59ec55b3a8e7cb1862e5ba6d49595'/>
<id>urn:sha1:4097eac99cc59ec55b3a8e7cb1862e5ba6d49595</id>
<content type='text'>
Doc markup fixes.

* kh/doc-markup-fixes:
  doc: remove extra backtick for inline-verbatim
  doc: add missing backtick for inline-verbatim
</content>
</entry>
</feed>
