Add csv diff capabilities to your local git configuration
Pull request Compare This branch is 1 commit behind theodi:gh-pages.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Add csv diff capabilities to your local git configuration (on unix-style platforms like OSX or Linux).

Once installed, you'll get decent results diffing CSV files when you use git diffcsv file.csv.


git >= 1.7.12


Just pop this into a terminal:

curl -L | bash

You can now diff CSVs nicely using git diffcsv.

Try it out

git clone
cd test-data
git diffcsv 1ebfdfe184ca258c5c7b3336c58c0ae2e7403c55 data.csv

Compare to running standard git diff to see the difference it makes!

What's going on?

The script will drop the following into your ~/.config/git/attributes file:

*.csv   diff=csv

and the following into your ~/.gitconfig

    ui = true
[diff "csv"]
    wordRegex = [^,\n]+[,\n]|[,]
  diffcsv = diff --word-diff

It shouldn't affect anything that's already there, unless you already have a CSV line in your gitattributes.

You can verify this behaviour by looking at the source for