The Computer Oracle

LibreOffice: How to save in Git friendly format?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Dreamlands

--

Chapters
00:00 Libreoffice: How To Save In Git Friendly Format?
00:38 Accepted Answer Score 41
01:31 Answer 2 Score 1
01:44 Answer 3 Score 3
02:33 Thank you

--

Full question
https://superuser.com/questions/1264379/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#git #libreoffice #fileformat

#avk47



ACCEPTED ANSWER

Score 41


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




ANSWER 2

Score 3


ReZipDoc is a tool that uses git clean (and optionally smudge) filters for ZIP based files stored in git (ODT is basically a ZIP file).

IT simply re-zips the ODT without compression, and tells git to treat ODTs as text files. Apart from included images, the data within an ODT, and thus the files within the ODT ZIP, are mostly text based. Thus this approach works nicely with git delta compression. LibreOffice its-self has no problem reading uncompressed ODT files, and thus there is no downside to this approach, apart form having to setup ReZipDoc in the local repositories of all collaborators.

In theory, the final size of the git repo should be more or less the same as if using FODT, provided LibreOffices formats the text parts consistently in both cases.




ANSWER 3

Score 1


I have written a bash script that enhances Libreoffice docs into git friendly format - see https://github.com/timwiel/libreoffice2git