Version control for DOCX and PDF?

There are two different concepts here - one is "can the version control system make some intelligent judgements about the contents of files?" - so that it can store just delta information between revisions (and do things like assign responsibility to individual parts of a file).

The other is 'do I have a file comparison tool which is useful for the types of files I have in the version control system'. Version control systems tend to come with file comparison tools which are inferior to dedicated alternatives. But they can pretty much always be linked to better diff programs - either for all file types or specific ones.

So it's common to use, for example, Beyond Compare as a general compare tool, with Word as a dedicated Word document comparer.

Different version control systems differ as to how good people perceive them to be at handling 'binaries', but that's often as much to do with handling huge files and providing exclusive locking as it is to do with file comparison.


http://tortoisehg.bitbucket.io/ includes a plugin called docdiff that integrates Word and Excel diff'ing.


This article outlines the solution for Docx using Pandoc While this post outlines solution for PDF using pdf2html.


You can use Beyond Compare as external diff tool for hg. Add to/change your user mercurial.ini as:

[extdiff]
cmd.vdiff = c:/path/to/BCompare.exe

Then get Beyond Compare file viewer rule for docx.

Now you should be able to compare two versions of docx in Beyond Compare.