Last time I checked, this is not handled directly by git. I had the same need: I wanted my update on a live script site to send all the changes that were merged to all users. I did not find a tool that allows me to easily analyze the history of the repo to tell me when the branches started to differ. In other words, I could not programmatically find an early common ancestor.
These are the solutions I came up with: just create a branch from the master to the merge. This branch can be permanent if you like it or in my case it is temporary:
git branch temp
Now that you are merging, you have a link where the merge begins:
git merge rel_foo_10 git log temp..HEAD
Once I saved the log to a file, I can delete the temp branch. If you plan to create a permanent pre-merge branch, then perhaps you can name it using some convention, for example pre_rel_foo_10 .
source share