How do you see / show a git merge conflict resolution that was done, given a merge commit SHA1?

前端 未结 2 569
不知归路
不知归路 2020-12-08 14:18

When you resolve a conflict, then stage the changes, then do a git diff, it shows you two columns of +\'s and -\'s, one for \"ours\" and one for \"theirs\". Given a merge c

2条回答
  •  不知归路
    2020-12-08 14:36

    If you know the ref, then git show will show you the resolution done (if any) for the merge commit.

    For log, use git log -p -c or git log -p --cc. From the manpage of git log:

       -c
           With this option, diff output for a merge commit shows the differences from each 
           of the parents to the merge result simultaneously instead of showing pairwise 
           diff between a parent and the result one at a time. Furthermore, it lists only 
           files which were modified from all parents.
    
       --cc
           This flag implies the -c option and further compresses the patch output by 
           omitting uninteresting hunks whose contents in the parents have only two 
           variants and the merge result picks one of them without modification.
    

提交回复
热议问题