[PATCH 0/2] Add fetch.updateHead option
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Apr 5, 2023, 01:27 UTC
- Message-ID
- <20230405012742.2452208-1-felipe.contreras@gmail.com>
It's surprising that `git clone` and `git init && git remote add -f` don't create the same remote state.
Fix this by introducing a new configuration: `fetch.updateHead` which updates the remote `HEAD` when it's not present with "missing", or always with "always".
By default it's "never", which retains the current behavior.
This has already been discussed before [1].
[1] https://lore.kernel.org/git/20201118091219.3341585-1-felipe.contreras@gmail.com/
Felipe Contreras (2): Add fetch.updateHead option fetch: add support for HEAD update on mirrors
Documentation/config/fetch.txt | 4 ++ Documentation/config/remote.txt | 3 ++ builtin/fetch.c | 69 ++++++++++++++++++++++++++++++++- remote.c | 21 ++++++++++ remote.h | 11 ++++++ t/t5510-fetch.sh | 49 +++++++++++++++++++++++ 6 files changed, 156 insertions(+), 1 deletion(-)
-- 2.40.0+fc1