]> git.99rst.org Git - git.git/commit
fetch: add configuration variable fetch.followRemoteHEAD
authorMatt Hunter <redacted>
Fri, 19 Jun 2026 09:44:26 +0000 (05:44 -0400)
committerJunio C Hamano <redacted>
Fri, 19 Jun 2026 16:19:36 +0000 (09:19 -0700)
commit7d00999b10579708fc3c2512cb0a55eff4e7565f
treec9bf23ab90e37e7224cc00fc0635f2b27937c2df
parent85ef88dc5511750218588dcc56b76b1b4ab67e7d
fetch: add configuration variable fetch.followRemoteHEAD

'fetch.followRemoteHEAD' is added as a generic setting used by all
remotes for which 'remote.<name>.followRemoteHEAD' is undefined.  If
both variables are undefined, a builtin default of "create" is in
effect, matching the previous behavior.

As mentioned in the previous patch, 'fetch.followRemoteHEAD' supports
all of the values that its 'remote' counterpart does _except_
warn-if-not-$branch, due to its tighter coupling to individual remote
repositories.

This setting interacts with the do_fetch mechanism in the same way as
the previous does, but there are opportunities for improved
user-experience discussed in [1].  See the included NEEDSWORK comment as
well.

Documentation and advice messages for both of the followRemoteHEAD
variables are reworded to better capture the relationship between the
two.

The added tests assert feature parity between the two followRemoteHEAD
variables, as well as the fact that 'remote.<name>.followRemoteHEAD'
always supersedes this new configurable default.

[1]: https://lore.kernel.org/git/xmqqh5n213bw.fsf@gitster.g/

Helped-by: Junio C Hamano <redacted>
Signed-off-by: Matt Hunter <redacted>
Signed-off-by: Junio C Hamano <redacted>
Documentation/config/fetch.adoc
Documentation/config/remote.adoc
builtin/fetch.c
t/t5510-fetch.sh
git clone https://git.99rst.org/PROJECT