I have two branches, master and b1. When I'm on b1, 'git reflog show' displays all the changes to b1. However, after I switch to master and run 'git reflog show b1', it displays something different. The manpage for 'git reflog' does not explain how the arg, <ref>, affects the output.
Asked
Active
Viewed 73 times
1 Answers
3
It shows the history of <ref>
. If <ref>
is not provided, it shows the history of HEAD. Note that this is not what HEAD points to, but rather HEAD itself. So when you do a git reflog show
while on b1, it is showing the history of HEAD, not b1. When you do git reflog show b1
, it shows the history of b1. So that is where the difference comes from.

David Deutsch
- 17,443
- 4
- 47
- 54
-
Ah hah, that's what I missed. By default, 'git reflog show' displays changes to HEAD, and not the "branch" itself. Thank you. – Ltf4an Jun 13 '15 at 20:31