File : <repository>/.git/config
or $HOME/.gitconfig
[diff "odf"]
textconv = odt2txt
binary = true
If setting previous configuration in $HOME/.gitconfig, just add the following
[core]
attributesfile = $HOME/.config/git/info/attributes
File : <repository>/.gitattributes
or $HOME/.config/git/info/attributes
*.ods diff=odf
*.odt diff=odf
*.odp diff=odf
From link