Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does git store its reflog?

Tags:

git

git-reflog

I know that compressed version of reflog is stored in .git/packed-refs but where is actual reflog is located and how git restores history when one types git reflog ?

like image 312
TOP KEK Avatar asked Aug 03 '15 16:08

TOP KEK


1 Answers

The reflogs are in .git/logs/<refname>. For example, for a branch named master (eg, refs/heads/master) then you would want .git/logs/refs/heads/master.

HEAD, of course, is anomalous, and is .git/logs/HEAD.

like image 62
Edward Thomson Avatar answered Oct 20 '22 21:10

Edward Thomson