Using colordiff and the Subversion CLI

A guide on how to use colordiff to achieve coloured diffs on the Subversion CLI

Looking for a new simple way to plan your day? Get organized with Five.Today

My policy is to use the CLI interfaces of version control systems whenever possible, as this means I can move from computer to computer and still be productive without worrying about what version control clients are installed there. As I am running diffs before I commit anything to Subversion or Git, it is kinder on my eyes to have them coloured in order to highlight the code changes. This can be achieved using the colordiff command in Linux.

Before we begin, make sure you have that command installed:

$ yum install colordiff

To run a regular diff using the Subversion CLI, I ran the following command to get this output:

$ svn diff view/renderers/html/

Now let us try that again, only this time piping the output from svn diff to colordiff:

$ svn diff view/renderers/html/ | colordiff

I think you will find that the colours will really help while scanning through your diffs.

Looking for a modern PHP framework to build your new project? Please consider using the Alpha Framework

John Collins

I have been writing about web technology and software development since 2001. I am the developer of the Alpha Framework for PHP, and the Five.Today personal productivity app. I love open source, technology, and economics.

Installing Ansible on Linux

Git concepts simplified

Developing off the Alpha trunk