LibreOffice: How to save in Git friendly format?

20

5

LibreOffice saves into files that are zip files. Zip files are generally suboptimal to use with Git: A small change in the document can change most of the zip-file, thus making it impossible for Git to reuse parts which results in the Git repository grows with the full size of the zip file instead of just the few changes.

Is there a way in which I can tell LibreOffice to save in a Git friendly format?

E.g. by saving as a zip file with no compression (ala .tar) or simply saving the document as a dir containing the same files as the unpacked zip file would result in.

Ole Tange

Posted 2017-11-01T08:33:44.087

Reputation: 3 034

Answers

20

Is there a way in which I can tell LibreOffice to save in a Git friendly format?

You can save your files as flat XML (fodt) instead of odt:

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.

Source LibreOffice and Version control


Further Reading

DavidPostill

Posted 2017-11-01T08:33:44.087

Reputation: 118 938

The option discussed in the last link (to add newlines) appears to have been dropped in LO -- I can't find it in the Load/Save settings. – retorquere – 2018-04-07T07:55:53.760

@retorquere Indeed. Looks like it was removed. Answer updated to remove that link. – DavidPostill – 2018-04-07T15:17:22.757