Last Updated: February 25, 2016
·
638
· oz123

Tame Subversion to be like git (well, just a bit)

I must work on svn, and at times git-svn is a no go (mostly because of office politic, no because of a technical reason).
So here is how you can make svn diff behave like git diff --color. Put the following function in your bashrc or bash_profile:

function svndiff(){
    svn diff "$@" | colordiff | less -r
}

This will always make colored diff with or without file name given. You can use it simply by typing inside your work directory from the shell:

$ svndiff 

The above will show all the differences. To show the changes in one or more file, give them further:

$ svndiff file1 file2 ...