When push.negotiate is enabled, 'git push' spawns a child 'git fetch
--negotiate-only' process to find common commits. Pass
--negotiation-include and --negotiation-restrict options from the
'remote.<name>.negotiationInclude' and
'remote.<name>.negotiationRestrict' config keys to this child process.
When negotiationRestrict is configured, it replaces the default
behavior of using all remote refs as negotiation tips. This allows
the user to control which local refs are used for push negotiation.
When negotiationInclude is configured, the specified ref patterns
are passed as --negotiation-include to ensure their tips are always
sent as 'have' lines during push negotiation.
Reviewed-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Derrick Stolee committedMay 19, 2026 at 16:24 UTCa6d92c48e4426b88a427a75ed2c20d1daa5dc7f7
5 files changed+70-7
Documentation/config/remote.adoc
+6
index 1951df154e..eb9c8a3c48 100644--- a/Documentation/config/remote.adoc+++ b/Documentation/config/remote.adoc@@ -122,6 +122,9 @@ command-line option. If `--negotiation-restrict` (or its synonym `--negotiation-tip`) is specified on the command line, then the config values are not used. ++These values also influence negotiation during `git push` if+`push.negotiate` is enabled.++ Blank values signal to ignore all previous values, allowing a reset of the list from broader config scenarios.@@ -147,6 +150,9 @@ negotiation algorithm still runs and advertises its own selected commits, but the refs matching `remote.<name>.negotiationInclude` are sent unconditionally on top of those heuristically selected commits. ++These values also influence negotiation during `git push` if+`push.negotiate` is enabled.++ Blank values signal to ignore all previous values, allowing a reset of the list from broader config scenarios.