OpenDocumentFormat versioning with Git

You can very easily keep OpenDocument (LibreOffice, OpenOffice and, at a push Microsoft Office) documents under version control in a Git repository.

You need the odt2txt (Archlinux package) whichis a simple converter from OpenDocument Text to plain text.

With that installed, configure Git to use it as a diff engine:

Firstly, configure git to use odt2txt by adding to ~/.gitconfig

[diff "odf"]
  textconv=odt2txt

Secondly, in the repository, create or add to $GIT_DIR/info/attributes:

*.ods diff=odf
*.odt diff=odf
*.odp diff=odf

And that's it. My initial observations are that this works but git diff doesn't show non-text differences (such as modifying a chart colour). The fact the file is changed is recognised however.

Also, a stand-alone command-line utility oodiff allows command-line diff activities:

$ ./oodiff foo.ods bar.ods