Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git (or Hg) plugin for dealing with Microsoft Word and/or OpenOffice files

Has anyone come across a Git or Hg plugin for "meaningful" diffs/merging/branching of OpenOffice or Microsoft word files.

I know I can 'checkin' .doc files but both Git and Hg treat them as binary blobs. I'd like to be able to do all (or at least many) of the normal revision based operations on the text of the file.

And yes, I do know that I should be using Latex or converting files back-and-forth between RTF. I'm just looking for a more "native" solution since I'm trying to manage collaboration between techies and "management people".

This is related to my question on Biostar here: http://biostar.stackexchange.com/questions/1749/writing-collaboration-with-source-control-and-microsoft-word

Thanks.

like image 907
JudoWill Avatar asked Jul 20 '10 17:07

JudoWill


People also ask

Can you use Git with Microsoft Word?

Git and GitHub do commits on pretty much any file type for writing, although it works best with plain text. If you write in Microsoft Word, it'll work, but you won't be able to see your past commits on the command line or in GitHub.

What free software can open Word documents?

Install LibreOffice, a free and open-source office suite. This is an alternative to Microsoft Office. LibreOffice Writer, which is included, can open and edit Microsoft Word documents in DOC and DOCX format. Upload the document to Google Drive and open it in Google Docs, Google's free web-based office suite.


1 Answers

How about:

  1. Save your Word docs in XML.
  2. Commit your XML Word files.
  3. Diff using an external XML diff tool. For example:

    $ git difftool -t xmldiff c3d293 498571

Transforming the XML files to have one element per line should make the check-in process run efficiently and also allow the external XML diff tool to process quickly.

References:

  • http://www.kernel.org/pub/software/scm/git/docs/git-difftool.html
  • http://www.logilab.org/projects/xmldiff
like image 90
aparkerlue Avatar answered Sep 20 '22 14:09

aparkerlue