January 4, 2010

Color your diffs

Filed under: Uncategorized — pfritz @ 2:00

I’m using the command “svn diff” very often to control my already done changes for the subversion repo I’m working on. To be exactly I’m using “svn diff | colordiff” because it simplifies reading those diffs enormous. Since colordiff is a simple wrapper around the good old diff, I was wondering if it is possible to change the diff command used by subversion to something else. And yes it is! After some googling I found out the solution to define an alias to use colordiff, but an alias is not what I want. There must be a neater solution. Looking into the config file ‘.subversion/config’ I uncomment and changed the line starting with diff-cmd to ‘diff-cmd = colordiff’ and now the output of ‘svn diff’ is colored. Isn’t that nice? What I haven’t found out yet, however, is how you can change it back to normal diff if you want to prepare a normal patch without colors. I’ll report it to you if I find it out.



  1. There is also colorsvn which is helpfull for other svn commands. It’s a simple wrapper around svn. But it doesn’t colorize diffs! You can found it at

    Comment by raoulh — January 4, 2010 @ 13:42 | Reply

  2. You can specify the diff command on the command-line:

    svn diff –diff-cmd diff file.c

    Comment by Gavin Costello — January 27, 2010 @ 21:13 | Reply

    • Nice, that works đŸ™‚

      Comment by pfritz — January 27, 2010 @ 22:11 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: