Using subversion over ssh on a non standard port

Aug 22 2009 Author: Brandon Orther

I recently needed to use a subversion repo on a server that didn't use the default ssh port of 22. I found a great a simple solution in subversion's ability to setup custom tunnels. What this means is I can setup svn+[custom tunnel] to work like svn+ssh but with my own custom params. To add a custom subversion tunnel open the file located in ~/.subversion/config and look for the section labeled tunnels. For my example I want to use port 23432 and I will make my tunnel name ssh-app. So my added tunnel definition will be:

ssh-app = $SVN_SSH ssh -p 22022

Now we can use the following command to get my repo that is located in /var/repos/my-app

svn co svn+ssh-app://my-repos-host.com/var/svn/my-app my-app