How to deal with Word Files in Git Systems

Setting up a diff tool to manipulate Word Files : Rakali.

Posted by Jonathan DEKHTIAR on Friday, 2016 February 26

Share on: Facebook Twitter LinkedIn HackerNews Google+


How to deal with Word Files in Git Systems

Setting up a diff tool to manipulate Word Files : Rakali.


I'd like first of all to acknowledge Martin Fenner for the method and the development.
You can find extended blog post about this here : link

So let’s get to businesss !

Prerequisites

In order to be able to parse doc and docx file in Git you will need to install the following tools.

1. If it’s not done yet, you should install git:

Click on this link to download and install: git-scm.com

2. For the next phase of the tutorial, you will need to install ruby:

2.1. Debian or Ubuntu:
sudo apt-get install ruby-full
2.2. CentOS, Fedora, or RHEL:
sudo yum install ruby
2.3. Mac OS X :
2.3.1 Install Homebrew:

Click on this link to download and install: brew.sh

2.3.2 Then Install Ruby:
brew install ruby

3. Then install Rakali:

You may find all the information you need on the official Github Repository

gem install rakali

4. Create two files in your git project’s root folder :

4.1. Create, at the git project root folder, the file: ".gitattributes"
# .gitattributes file in root folder of your git project
*.docx diff=pandoc
*.doc diff=pandoc
4.2. Create, at the git project root folder, the file: ".gitconfig"
# .gitconfig file in your home folder
[diff "pandoc"] #we declare the diff tool
textconv=pandoc --to=markdown
prompt = false
[alias]
wdiff = diff --word-diff=color --unified=1

5. Commit the two files and you’re done. Enjoy !


Category: Agile

Tags: Git  Word  Versioning  Agile  DOC  DOCX  Office 

Share on: Facebook Twitter LinkedIn HackerNews Google+


Comments !