I have a question about git reflog:
at the beginning of my project, when I did a git reflog, I was able to see all the steps up to my original git clone command.
Today, git reflog no longer goes back up to the git clone command.
More precisely, git reflog returns 4143 lines, and the last lines is truncated:
$ git reflog
6146d34 HEAD@{0}: checkout: moving from feature/cluster to feature/config
[...]
cb14a86 HEAD@{4140}: checkout: moving from master to demo/20170529
b2ef8d6 HEAD@{4141}: checkout: moving from master to demo/20170529
b2ef8d6
$
Can anyone explain me why?
Is there a way to get the entire reflog?
Thanks a lot,
Julien
@TimBiegeleisen has it right, the reflog is emptied periodically. As long as the reflog holds references to otherwise unreachable commits, they will still stick around in your repository. Only when the commit references are pruned from the reflog ('expired'), the commits will be garbage collected and therefore be gone completely. If this would not happen, commits from deleted branches would stay around forever.
Since such 'dangling' commits and other unused references have already been deleted from your repository and no recording of your repositorys' local history is around, you cannot retrospectively get the entire reflog for your repository.
Edit: Found here:
This gets confirmed here, and as you can see in the examples, you can also set
reflogExpire = never
to never let reachable reflog entries expire. This can, however, not bring your already pruned reflogs back, but only prevent deletion in the future.