« Back to blog

SVN URL shortcuts

Typing repository URL's are not fun in subversion, most of them are really long and if you want to commit multiple files or merge, sometimes you have to type them more than once.


If you run svn info, you will notice the line that begins with URL:

Why don't we grab the contents of this line after the word URL: (so we are grabbing the URL itself), and put it in a shortcut.

so, create an alias in your .bashrc file:

alias sitesvn="svn info | egrep '^URL: (.*)' | sed s/URL\:\ //"

Now you can use a shortcut:

svn ls $(sitesvn)/trunk


Note: this might not work on *all* URL's, depending on how you have the SVN root setup.

Posted July 15, 2010