How to find previous merge commit
git
Solution
It seems what you are looking for is the point at which the two branches started to differ, not the last merge between the two branches. These two concepts are different because your release branch may have been fast forwarded some time after it was merged.
`git merge-base master release` will find the most recent common ancestor of your master and release branches (i.e. the last commit that the two have in common).
Then, on master you can use `git diff [common ancestor] HEAD` to see the changes that have been made to master since the common ancestor.
Problem
How can one find the previous merge commit between two branches? I would like to see the changes in my master branch since the last time I have merged the release branch into the master branch. To see the changes in the release branch since the last branch, it is as easy as `git diff ...release` But obviously `git diff release...` doesn't work because it also includes all the changes before the last merge. Thus I think I need the commit id of the last merge to pass it to `git diff` ``` git log --reverse --ancestry-path `git merge-base HEAD release`.. \ --format=format:%H|head -n1 ``` seems to work and can be used with `git diff $(...)`, but it seems awfully complicated. Is there some easier solution? Example ``` I / \ A1 B1 \ | | M | | A2 B2 ``` Here `I` is the initial commit. `A[12]` are the release commits and `B[12]` are the master commits. `M` is the previous commit. In the example the changes between the last merge and master is just the changes introduces by B2. `git merge-base A2 B2` returns `A`1. And `git diff B2 A1` includes the changes of `B1`. Thus the question is how to find M in the general more complex case so that one can run `git diff M B2` without having to manually find `M`.