Re: FETCH_HEAD files and mirrored repos

2 messages, 2 authors, 2020-07-11 · open the first message on its own page

Re: FETCH_HEAD files and mirrored repos

From: Junio C Hamano <hidden>
Date: 2020-07-11 21:07:09

Konstantin Ryabitsev [off-list ref] writes:
Are there any downsides to deleting FETCH_HEAD after performing "git 
remote update" in repos that are only used for mirrored hosting?
The only time Git itself uses FETCH_HEAD is during "git pull".

"git pull" is a two step process---it first calls "git fetch" and
then calls "git merge" (or "git rebase") to integrate the fetched
history with the history of your current branch.  "git fetch" leaves
what it got in that file, and "git pull" figures out what parameters
and message to use to drive the second step.  After that, FETCH_HEAD
is not used by Git.  If you call "git fetch" yourself, FETCH_HEAD
left by that process is not used by Git itself, but you can use what
is in it to manually execute the second step of what "git pull"
would do.

So, unless your script depends on the presence and/or the contents
of FETCH_HEAD, you can safely remove it.

Re: FETCH_HEAD files and mirrored repos

From: Konstantin Ryabitsev <hidden>
Date: 2020-07-11 21:19:21

On Sat, Jul 11, 2020 at 02:07:01PM -0700, Junio C Hamano wrote:
So, unless your script depends on the presence and/or the contents
of FETCH_HEAD, you can safely remove it.
Excellent, that just saved me 20G per each mirror. :)

Thanks,
-K
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help