Search code examples
gitlibreofficegit-diff

How can I get useful git diff of files saved by Libre Office Writer, with output in the command line?


Default version of git diff for default .odt files is not showing what was changed

Binary files i/filename.odt and w/filename.odt differ

Is there a way to show what was really changed and keep file directly editable by Libre Office?


Solution

  • You could also use the flat xml format proposed by Libreoffice.

    The .fodt file format. See Libreoffice and version control or this answer that provides good links.

    From the link:

    If a document is saved as .fodt file it keeps the same data the .odt file would contain. Only that this time the data is represented as human-readable text (which makes the work much easier for the version control system) and not compressed. So saving a document as flat xml makes it possible to keep server space requirements and network load low at the relatively low cost of wasting a few kilobytes on the local hard disks.

    Note that tiny changes will often still result in massive diffs, so it is not fully solving the problem.