Git: Is there a quick way to see when was the last time that git merge master was done on the current working branch?

git show :/"Merge branch 'master'"

I personally like to inspect the difference in revision trees:

git log --graph --left-right --cherry-pick --oneline branch1...branch2

Also, in the 'magic' department there is

git show-branch 
git show-branch branch1 branch2
git show-branch --all # which does all of the above and more

And finally,

git merge-base branch1 branch2

to name the base revision that would be merged from


Notes:

  • replace branch1 and branch2 as appropriate for your project
  • you can alias those commands if you like them: http://progit.org/book/ch2-7.html#git_aliases
  • the --cherry-pick options carries a rare kind of magic:
--cherry-pick 

Omit any commit that introduces the same change as another commit on the "other side" when the set of commits are limited with symmetric difference.

For example, if you have two branches, A and B, a usual way to list all commits on only one side of them is with --left-right, like the example above in the description of that option. It however shows the commits that were cherry-picked from the other branch (for example, "3rd on b" may be cherry-picked from branch A). With this option, such pairs of commits are excluded from the output.


You could use git merge-base to get the common ancestor, and display the results.

Something like this:

git merge-base HEAD master | git show --pretty