Git tip: see all commits introduced by a merge
Git has the useful function git log --first-parent
that will show your branch without the commits introduced by merge commits. Sometimes I want the opposite (i.e., understand which commits were added by a merge), and there I find the following command useful: git log ^HEAD^ HEAD
. This command will print the commits that are not (an ancestor of) the commit on your branch before the merge commit. Effectively, it will only show the commits brought in by the merge commit.
A more succinct but less readable version is git log ^@^ @
.