Can version control tool deal with rich text document?
Question: Here the "rich text" may be a regular Word document, or a notebook of
Mathematica.

By now, I use git to control my Matlab code and a few python code. But it
looks like the rich text file cannot be control by git.

Is there a solution to accomplish this task?

Thanks a lot!


Answer: To provide a short answer to your question, version control systems can
version virtually any time of file, including rich text documents. Your
ability to effectively inspect the diff depends on the internal representation
of the document in the versioned file.

"Rich Text" documents can be versioned in Git, like any other file. The right
question is probably "how easy is to visually inspect the diff between two
versions".

The answer depends on how the file is encoded and stored. If it's a plain
binary file, such as an executable, then git will be able to store the
different revisions, but the diff view will be meaningless.

In order to take advantage of text diffs, the files must be stored as some
kind of text file. It's important to keep in mind that using a text file
doesn't necessary mean you are limited to provide "Rich Text". After all, the
HTML markup is a good demonstration.

As far as I remember, the latest Office versions adopt a storage format (docx)
that in reality is a Zip package. If you unzip the content, part of the
information are stored in XML files (I may be wrong, it has been a while since
I used one of these files).

