> git show --first-parent COMMIT # perspective of target branch = branch you were on when merging
> git show -m COMMIT # perspective of both branches
Lengthy explanation and more ways to do it: https://stackoverflow.com/questions/40986518/git-show-of-a-m...
Also the following works in my experience and is more easy to memorize because the command literally says what you want to know:
> git diff COMMIT_BEFORE_MERGE..MERGE_COMMIT
This article shows what I mean: https://euroquis.nl/blabla/2019/08/09/git-alligator.html . (The only thing missing is the rebase before merge, since the example image shows a case where a merge could have hidden some changes.)
That said the rebase followed by --no-ff merge is my preferred approach as well.
git show [commit]^1..[commit]
The ^1 incantation means "first parent", so in the feature branch style I'm describing, this would show the changes on all of the commits for the feature merged at [commit]. You can use `git diff` instead of `show` in the same way, if you just want the cumulative diff.It seems to work on the repository I've been contributing to, as it shows each of the commits that were part of the feature branch. The merge commit itself is empty, as desired, avoiding the up-thread concern of unreviewed auto-merged code.
"git bisect" supports "--first-parent" too.
I often do this, but then have some integration related change that’s required after.