Coloured svn diff

The output of svn diff can sometimes be hard to read, especially when there are a lot of changes to read through.

I also realise that you might think I’m a dinosaur for still using svn because git has nicely coloured diffs out of the box but talk to any WordPress plugin developer and they’ll have to use svn at some stage. On the other hand, if you’ve used svn for years you may not even realise you need coloured diffs.

I found a neat solution to that. Pipe the output of svn into colordiff.

This Bash function, svndiff, should be placed in the .bashrc in your home directory (or .zshrc or whatever shell you use, it’ll probably be similar)

function svndiff () {
    svn diff $@ | colordiff | less -R;
}

Log out and log back in or do source ~/.bashrc from the command line to get it working.

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close