18

When I look at the diff of an lfs file, I just see the oid and size difference. Is there a way to easily diff the actual file contents?

alvion
  • 1,963
  • 3
  • 15
  • 23

2 Answers2

28

From this post by bk2204:

Another option if you want to have diffs is to run git config diff.lfs.textconv cat, which will have any files with the diff=lfs attribute automatically rendered through Git to show the LFS file instead of the pointer.


Sourcetree GUI example:

My diff looked like this:

pre-image

After running the command, it looks like this:

post-image

(You might need to re-open Sourcetree for the changes to be applied.)

sonnyb
  • 3,194
  • 2
  • 32
  • 42
  • This doesn't always work for me. I haven't figured out why yet. When it doesn't work, I use `Sourcetree -> Actions -> External Diff` – sonnyb Nov 04 '22 at 16:32
0

There's a script you can use to diff the files, given 2 revisions and the filename. https://github.com/git-lfs/git-lfs/issues/2498

William Power
  • 686
  • 7
  • 12