Git log rebases

mustard picture mustard · Jan 23, 2012 · Viewed 13k times · Source

I know that GIT rebases will rewrite the history -- i.e. the commit ids will change. However, Is there any way to trace when a branch was rebased and from which branch?

EDIT: I have a development branch 'A' and a topic branch 'B'. 'A' is shared by the team. At some point, 'A' has been re-based with a mainstream branch. As a result of the re-base (and subsequent commits), when I updated the topic branch, I saw discrepancies. I am trying to find out the correct person to talk to to resolve the issues.

Answer

idlethread picture idlethread · Jan 24, 2012
git reflog

will allow you to look at the history of all your git workflow. On a project I'm working on, here are the top three reflog entries:

151a1da HEAD@{0}: filter-branch: rewrite
db8c822 HEAD@{1}: checkout: moving from fixes to master
db8c822 HEAD@{2}: checkout: moving from master to fixes

The first column shows the SHAID. So you can use the standard git commands on this SHAID e.g. git show 151a1da