LibreOffice and Version control
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
All version control systems (Subversion, Bazaar, Mercurial, CVs) and so on have in common that they keep track of the changes that are made to a document providing something like an unlimited undo function. Since they have to look only at the parts of the document that have actually changed this means astonishingly little amount of data.
By default the documents created with LibreOffice are compressed, though, which is good since it keeps them at a reasonable size on the local hard disk. Actually the compression is a nice feature since if you change the ending of an open document file to .jar you get an archive containing all images and other objects included in the file in their original format.
The drawback is that if you change just one word in a document chances are high that the compressed version of the document changes completely - which leaves the version control system with a huge amount of data. But don't despair:
LibreOffice contains the feature to save documents in a flat XML format instead:
If a document is saved as .fodt file it keeps the same data the .odt file would contain (but note of some exceptions, like tdf#63642 and tdf#126772). 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.
Making version information appear in your documents
Most version control systems contain a mechanism that automatically copies version information (the version number, the URL of the file etc.) about a document into the file. For subversion documentation about this mechanism can be found on the Svn:keywords page of this wiki.