Search code examples
gitmergemerge-conflict-resolution

Show conflict diff part of a merge


I need to present to the team what changes I've made during conflict resolution of a merge.

I know this is kind of hard, but I certainly believe it is possible somehow. I've tried already git show -m and git show -c.


Solution

  • Look at the hash (or tag) of the merge commit (the commit that has multiple parents) and do:

    git diff hash hash^1 hash^2
    

    It will output a 3 way-diff of the changes.

    hash^ (or hash^1) references the first parent commit of hash
    hash^2 references the second parent commit of hash