This section was inspired by Martin Fenner's .
To configure git diff:
-
.
-
Tell git how to handle diffs of .docx files.
-
Create or edit file ~/.gitconfig (linux, Mac) or "c:\Documents and Settings\user.gitconfig" (Windows) to add
[diff "pandoc"] textconv=pandoc --to=markdown prompt = false [alias] wdiff = diff --word-diff=color --unified=1
-
In your paper directory, create or edit file .gitattributes (linux, Windows and Mac) to add
*.docx diff=pandoc
-
You can commit .gitattributes so that it stays with your paper for use in other computers, but you'll need to edit ~/.gitconfig in every new computer you want to use.
-
Now you can see a pretty coloured diff with the changes you have made to your .docx file since the last commit
git wdiff file.docx
To see all changes over time
git log -p --word-diff=color file.docx