Created
February 19, 2013 12:20
-
-
Save 17twenty/4985374 to your computer and use it in GitHub Desktop.
Git diff odt files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Sourcetree can show the diff of a odt. But i will struggle to unstage hunks or merge conflicts. You can also save your document as .fodt (xml style) and this will have mostly text and only a few binary parts