I'm usually working on a branch that is diverged from master. So while I'm developing things, I perform git merge master
once in a while. And sometimes I wanna know when was the last time, I did git merge master
on that branch. I know I can do git log
and look for "Merge branch 'master'", and see the Date of the commit… but if there is a magic, I'd like to know!
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:
branch1
and branch2
as appropriate for your project--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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With