13

I want to manage Excel files in one of my repositories. Diffing them is a problem (they are binary files). However, there is a nice tool for diffing them: https://github.com/na-ka-na/ExcelCompare

I wanted to set it up using .gitattributes

*.xls diff=excel
*.xlsx diff=excel

And in the .git/config:

[diff "excel"]
    textconv = excel_cmp.bat

The command excel_cmp.bat file1.xls file2.xls works very well. However, the setup I use above seems to try to convert the excel files to text using excel_cmp.bat and then diffs the text output.

How do I setup the diff tool to diff two files - and not to convert to text first and then diff the text output?

EDIT:

In the above setting, what git seems to do is to diff the output of excel_cmp.bat <file1> and excel_cmp.bat <file2>. But what I want is excel_cmp.bat <file1> <file2>. How can I set this up?

2
  • Does the diff tool do that regardless of whether you use it in git ot not? Perhaps you should contact the asuthor on github. Commented Nov 19, 2013 at 11:17
  • In my current setting, the difftool is called by git with just one parameter. It expects two. Commented Nov 19, 2013 at 12:21

2 Answers 2

6

Okay, what I was looking for was the following in my .gitconfig:

[diff "excel"]
    command = excel_cmp.bat
Sign up to request clarification or add additional context in comments.

1 Comment

Where did you place the excel_cmp.bat file?
0

We've built an open-source Git command line extension for Excel workbooks: https://www.xltrail.com/git-xltrail (the repository is hosted on GitHub: https://github.com/ZoomerAnalytics/git-xltrail) which might help you. It's a simple installation process and does not require any manual plumbing work.

In a nutshell, the main feature is that it makes git diff work on any workbook file formats so that it shows the diff on the workbook's VBA content (at some point, we'll make this work for the worksheets content, too).

1 Comment

Support for Linux/LibreOffice?

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.