18

Given a conflicted file foo.txt, how to tell git diff to show changes between the base version of the file and "their" version of the file?

I can see each of the versions via git show :1:foo.txt or git show:3:foo.txt - is there a simple way to compare the two versions?

Rafał Dowgird
  • 40,680
  • 11
  • 76
  • 89
  • 1
    This link shows how to view the patch that failed: http://stackoverflow.com/questions/2118364/how-to-identify-conflicting-commits-by-hash-during-git-rebase --ie, it explains how to see the "theirs" patch. – Eddified Feb 08 '13 at 19:36

2 Answers2

22
git diff :1:foo.txt :3:foo.txt

More info at man gitrevisions; look for :[<n>:]<path>.

jsageryd
  • 3,682
  • 18
  • 32
2

Simply type git diff and it will show only the conflicts.

Further reading: Advanced Merging

Notice the --base and --theirs arguments for diff

Thomas Rawyler
  • 1,067
  • 7
  • 16