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

前端 未结 11 626
旧时难觅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:53

    A better solution (mentioned by @KrisNuttycombe):

    git diff fc17405...ee2de56
    

    for the merge commit:

    commit 0e1329e551a5700614a2a34d8101e92fd9f2cad6 (HEAD, master)
    Merge: fc17405 ee2de56
    Author: Tilman Vogel 
    Date:   Tue Feb 22 00:27:17 2011 +0100
    

    to show all of the changes on ee2de56 that are reachable from commits on fc17405. Note the order of the commit hashes - it's the same as shown in the merge info: Merge: fc17405 ee2de56

    Also note the 3 dots ... instead of two!

    For a list of changed files, you can use:

    git diff fc17405...ee2de56 --name-only
    

提交回复
热议问题