How can I find the previous merge join between two branches?
I would like to see changes in my main branch since the last merge of the release cells into the main branch. To see changes in release branches from the last branch, it is as simple as git diff ...release
But obviously git diff release... doesn't work, because it also includes all changes until the last merge. So I think I need the commit identifier 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 terribly complicated. Is there an easier solution?
Example
I / \ A1 B1 \ | | M | | A2 B2
Here I is the initial commit. A[12] is the fixation of the issue, and B[12] is the main fixation. M is the previous commit. In this example, the changes between the last merge and the master are just the changes made to B2. git merge-base A2 B2 returns A 1. And git diff B2 A1 includes B1 changes. So the question is how to find M in the generally more complicated case so that you can run git diff M B2 without having to manually find M
git
Roland Schulz
source share