Using xlCompare as excel git diff tool
Step by step instructions to use xlCompare with git
Excel files are binary files - old XLS format is a set of streams and records in the Biff format, modern XLSX is a ZIP file with a set of XML files inside. For the git this is binary files that can't be processed like text documents.
xlCompare fills this gap and allows to get the difference between two Excel files in the Git console window.
Below is a simple integration procedure that connects git with xlCompare.
Step 1 - Install xlCompare on your computer
For this you need to visit Download page, download the setup and run it on your computer.
Step 2 - Create exceldiff.cmd file
It is not important where this file is located. For example, we've created it in the Documents\xlCompare folder.
Create text file in the Windows Explorer. Paste following contents:
"C:/Program Files/Spreadsheet Tools/xlCompare/xlCompare.exe" -git %2 %5
and rename it to exceldiff.cmd
IMPORTANT: make sure that file extension was changed from .txt to .cmd
Step 3 - Edit .git/config file
Add following lines to the .git/config file in your repository:
[diff "xlcompare"]
command = C:/Users/{user-name}/Documents/xlCompare/exceldiff.cmd
command = C:/Users/{user-name}/Documents/xlCompare/exceldiff.cmd
IMPORTANT: make sure that path that corresponds to command is valid on your computer
Step 4 - Connect Excel files in git with xlCompare
This is final step in our guide. Create .gitattributes file in the root of your repository. Possible this file already exists.
Add following line to the end of the file:
*.xls* dif=xlcompare
It points git to use xlCompare with Excel files.
Start using xlCompare with git diff
That's all. You've connected your xlCompare with Excel files in the git repository.
Now git diff command shows difference for 2 Excel files in the git console window.
Do I need a license for git diff Excel tool?
No. xlCompare works with git without license. You can install it and use it for free.
License is required only if you compare Excel files in non-console mode by opening xlCompare window.
Using xlCompare in command line mode
xlCompare allows to compare and merge Excel files in the command line mode. Complete list of commands you can find on this page:
Integrate xlCompare into SVN
xlCompare can be integrated into SVN as an external diff viewer for Excel files. You can use graphic interface to visualize differences between versions of your Excel files.
Using xlCompare with GitHub Desktop
Unfortunately xlCompare can't be used with GitHub Desktop application.
GitHub Desktop doesn't support external diff tools. There is a feature request, that is not implemented:
I have a question about xlCompare
Please, describe your question or inquery in the form below. We will be happy to respond you!