From: Junio C Hamano Date: Sun, 12 Jul 2020 20:52:17 GMT Subject: Re: FETCH_HEAD files and mirrored repos Message-ID: In-Reply-To: <20200712202502.x4p2c7rf6ctflt5g@chatter.i7.local> Konstantin Ryabitsev writes: > I also discovered that symlinking FETCH_HEAD to /dev/null works as well > and thus saves a few IO cycles. We could teach "git fetch" a new "--write-fetch-head" option and teach "git pull" to pass it when calling "git fetch". It is very plausible that some folks rely on "git fetch" to leave FETCH_HEAD without being told, so the option must default to on for a few development cycles before we flip the default to off, and for those who want to live in the future a bit earlier, we can also introduce fetch.writeFetchHEAD configuration variable that determines what happens when "git fetch" is run without "--write-fetch-head" option on the command line. That way, you could drop [fetch] writeFetchHEAD = 0 in say /etc/gitconfig or in ~/.gitconfig of the user that runs the mirroring automation.