What should "git reflog show <ref>" show?

123 views Asked by At

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.

1

There are 1 answers

1
David Deutsch On BEST ANSWER

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.