2

I need to follow the history of a binary file, like what I would get from git log --follow --patch textfile, but for a binary file.

For git diff it's possible to configure a specific diff tool via .gitattributes and .git/config and I've done so: git diff binary_file shows a text representation of the change. git log --follow --patch doesn't show that representation however, it just says Binary files a/binary_file and b/binary_file differ - Is it possible to configure git to use the same machinery here as with git diff?

My particular case is a spreadsheet, so my .gitattributes:

*.ods diff=spreadsheet

.git/config:

[diff "spreadsheet"]
    binary = true
    command = excelcompare
3
  • 1
    Try git log --ext-diff: git log --ext-diff --follow --patch binaryfile Commented Jan 8 at 16:19
  • @phd that is a correct answer, thanks. Why didn't you post ist as a SO answer? too short? I'd really like to mark it as correct Commented Jan 9 at 12:02
  • "Why didn't you post ist as a SO answer?" Because I wasn't sure it would work for you, that simple. :-) Commented Jan 9 at 12:05

1 Answer 1

2

Use git log --ext-diff:

git log --ext-diff --follow --patch binaryfile
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.