How to do Git Log see only merges to master branch?

Git

Git Problem Overview


In my work process I need to provide a list of files to my server admin. The list comes from the merge of my working branch (Branch A) into Master branch.

So I merge branch A into branch Master and then deploy Master.

Right now the best I could do with git log is the following but this list contains other commit as well ( not only the merge I'm looking for ):
git log -m --name-only --author=[NAME]

So basically I need to retrieve the files list for the merge of Branch A into Master Branch

Is it possible with cli command ?

Git Solutions


Solution 1 - Git

Narrow it down using git log --merges --author to figure out the commit you want and then try

git diff --name-only ${MERGE_SHA}^1..${MERGE_SHA}

Solution 2 - Git

I find it useful to narrow the path to first parent in order to ignore "update branch" merges.

Looks like this for me:

git log r2.8.7-2018-09-04..HEAD --merges --first-parent

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWonderLandView Question on Stackoverflow
Solution 1 - GitAndrew CView Answer on Stackoverflow
Solution 2 - GitRicardo de CilloView Answer on Stackoverflow