|# download docx2txt by Sandeep Kumar|
|wget -O docx2txt.pl http://www.cs.indiana.edu/~kinzler/home/binp/docx2txt|
|# make a wrapper|
|docx2txt.pl $1 -' > docx2txt|
|chmod +x docx2txt|
|# make sure docx2txt.pl and docx2txt are your current PATH. Here's a guide|
|mv docx2txt docx2txt.pl ~/bin/|
|# set .gitattributes (unfortunately I don't this can't be set by default, you have to create it for every project)|
|echo "*.docx diff=word" > .git/info/attributes|
|# add the following to ~/.gitconfig|
|binary = true|
|textconv = docx2txt|
|# add a new alias|
|wdiff = diff --color-words|
|# try it|
|# create my_file.docx, add some content|
|git add my_file.docx|
|git ci -m "Initial commit"|
|# change something in my_file.docx|
|git wdiff my_file.docx|
Thanks! This is perfect for quickly viewing the differences between two docs and I find myself using it a lot.
I'm using git for repositories of docx files, so I took things a step further and wrote a git merge driver for the Mac which uses Word itself to resolve merge conflicts by opening the common ancestor and showing both local and remote differences using tracked changes. This way I can complete the merge by accepting or rejecting each change and making any other minor fixup edits.
Check it out: http://github.com/jasmas/wordMerge
I have Mac and Linux systems. And I got it to work on Linux Mint. without changing the instructions. Thanik you for sharing this.