How to “git show” a merge commit with combined diff output even when every changed file agrees with one of the parents?

前端 未结 11 577
旧时难觅i
旧时难觅i 2020-11-28 01:15

After doing a \"simple\" merge (one without conflicts), git show usually only shows something like

commit 0e1329e551a5700614a2a34d8101e92fd9f2ca         


        
11条回答
  •  有刺的猬
    2020-11-28 01:50

    You can use the diff-tree command with the -c flag. This command shows you what files have changed in the merge commit.

    git diff-tree -c {merged_commit_sha}
    

    I got the -c flag's description from Git-Scm:

    This flag changes the way a merge commit is displayed (which means it is useful only when the command is given one , or --stdin). It 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 (which is what the -m option does). Furthermore, it lists only files which were modified from all parents.

提交回复
热议问题