Skip to content

Instantly share code, notes, and snippets.

@gabraganca
Forked from 17twenty/gist:4985374
Created April 9, 2013 11:22
Show Gist options
  • Save gabraganca/5344943 to your computer and use it in GitHub Desktop.
Save gabraganca/5344943 to your computer and use it in GitHub Desktop.
To get Git to diff between your odt/odp/ods files you will need to do the following things:
Install a conversion tool
$ sudo yum install odt2txt
Create your git config info directory if it's not already there
$ mkdir -p ~/.config/git/info
Add in attributes (you can paste this straight in or edit the file accordingly)
$ cat > ~/.config/git/info/attributes <<DELIM
*.ods diff=odf
*.odt diff=odf
*.odp diff=odf
DELIM
Add a Git diff filter (again, you can paste this straight in or edit the file accordingly)
$ cat >> ~/.gitconfig <<DELIM
[diff "odf"]
binary = true
textconv = odt2txt
DELIM
And that's it. Job done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment