path: root/Documentation/fetch-options.txt
diff options
authorGlen Choo <>2022-01-19 00:00:56 (GMT)
committerJunio C Hamano <>2022-01-19 00:22:58 (GMT)
commit386c076a863cfafd733b71564245be973e3d1bda (patch)
treeeedadc4a35b264d86507a62a0b02179beb369fa9 /Documentation/fetch-options.txt
parent135a12bc1472290ca6b9a4c2f06c838a1495a612 (diff)
fetch --negotiate-only: do not update submodules
`git fetch --negotiate-only` is an implementation detail of push negotiation and, unlike most `git fetch` invocations, does not actually update the main repository. Thus it should not update submodules even if submodule recursion is enabled. This is not just slow, it is wrong e.g. push negotiation with "submodule.recurse=true" will cause submodules to be updated because it invokes `git fetch --negotiate-only`. Fix this by disabling submodule recursion if --negotiate-only was given. Since this makes --negotiate-only and --recurse-submodules incompatible, check for this invalid combination and die. This does not use the "goto cleanup" introduced in the previous commit because we want to recurse through submodules whenever a ref is fetched, and this can happen without introducing new objects. Signed-off-by: Glen Choo <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/fetch-options.txt')
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index e967ff1..f903683 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -71,6 +71,7 @@ configuration variables documented in linkgit:git-config[1], and the
ancestors of the provided `--negotiation-tip=*` arguments,
which we have in common with the server.
+This is incompatible with `--recurse-submodules=[yes|on-demand]`.
Internally this is used to implement the `push.negotiate` option, see