Skip to content

Instantly share code, notes, and snippets.

@hkuno9000
Last active December 30, 2023 13:47
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save hkuno9000/f9244d923ebf69de11d4 to your computer and use it in GitHub Desktop.
Save hkuno9000/f9244d923ebf69de11d4 to your computer and use it in GitHub Desktop.
How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

  1. Download the xdoc2txt tool from: http://ebstudio.info/home/xdoc2txt.html#download
  2. extract "xdoc2txt.exe" and locate it on your PATH folder
  3. edit your gitattributes as A:
  4. edit your gitconfig as B:

A: append following texts to "~/.config/git/attributes" or ".git/info/attributes"

*.xls	diff=xdoc2txt
*.xlsx	diff=xdoc2txt

B: config "~/.gitconfig" or ".git/gitconfig"

git config [--global | --local] diff.xdoc2txt.textconv 'xdoc2txt.exe -8'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment