Git - easiest way to see diff with previous version if I have the sha

后端 未结 4 543
你的背包
你的背包 2020-12-15 02:58

A colleague of mine checked in some changes to Git, and I want to see exactly what those changes were. In other words, the diff between his check-in and its parent.

相关标签:
4条回答
  • 2020-12-15 03:25

    git diff shaOfHisCheckIn shaOfHisCheckIn^

    0 讨论(0)
  • 2020-12-15 03:27

    git show is your friend:

    git show shaOfHisCheckIn
    
    0 讨论(0)
  • 2020-12-15 03:35

    If you want to view the diff visually in kdiff3, meld, kompare, xxdiff, tkdiff, diffuse

    git difftool --dir-diff shaOfHisCheckIn^!
    
    git difftool --tool=meld --dir-diff shaOfHisCheckIn^!
    
    git difftool -t meld -d shaOfHisCheckIn^!
    
    0 讨论(0)
  • 2020-12-15 03:40

    Try this:

    git diff shaOfHisCheckIn^ shaOfHisCheckIn
    

    or

    git diff shaOfHisCheckIn{^,}
    
    0 讨论(0)
提交回复
热议问题