Our Blog

News, thoughts & useful links

Contact: Skype , email or call
+44 (0) 131 556 6818

Checkout SVN repository on another host using SSH on a custom port

May 15th, 2008 by Anton

Let’s say you want to checkout from your svn repository that is running on the remote host and on that host the port used for ssh is not the default (port 22).

You cannot use a custom port in the following command:

svn co svn+ssh://username@example.com/home/username/repository_path

What you need to do is edit the following file: ~/.subversion/config and add (under [tunnel] section) a similar line to:

myremotessh= ssh -p 1122

What this does is sets up a custom protocol that you can use in your command to ssh to a custom port number. So, to use the above setting we’d have to run something like this:

svn co svn+myremotessh://username@example.com/home/username/repository_path

This way, if you want to use svn+ssh on port 22 you can still do, while setting up custom protocols for hosts that have ssh running on custom ports.



Comments are closed.