Tags

Archives

 Altering iPhones (newer)
(older) Naked Tony 

Eclipse and Subversion over SSH


This post was published on Monday 27 August 2007.

I use subversion for my version control - and I have recently had to set up Eclipse to access the subversion repository on my new server. This proved trickier than expected, largely because of bad instructions all over the internet!

Many of them provide instructions for setting up a tunnel in putty, or through TortoiseSVN. Both are unnecessary with the right Eclipse setup.

These instructions assume you have setup a repository on your SVN server, and have imported files into it. For instructions on how to do this, please go here:

SVN QuickStart

First, you need to install WebTools (WTP) and Subclipse in Eclipse. I use the PHP Development Tools (PDT) plugin to edit PHP scripts - the PDT ‘all-in-one’ package comes with WTP pre-installed. Instructions for installing Subclipse can be found here:

Subclipse Update

Once you have everything installed, open Eclipse and go to the Window... Preferences.

Navigate to Team > SVN and set ‘SVN interface’ to ‘SVNKit (Pure Java)’. Click OK.

Now go to Window...Open Perspective...Other... Select ‘SVN Repository Exploring’ and click OK.

In the ‘SVN Repository’ window, right-click and select New... Repository Location.

The URL is in the format:

svn+ssh://username@server_ip_address/path/to/repos/username is the username you use to log onto your server over SSH
server_ip_address is pretty obvious.. I find IP addresses work better than domain names
/path/to/repos/ is the full filesystem path to the repository (e.g. /home/ben/svn/)

Click ‘Finish’ and you will be taken to the ‘Enter SSH Credentials’ page.

Your username will be pre-filled. Select ‘Use password authentication’, and enter your password. Ensure that the port information is correct. The default is 22, but if your server is behind a firewall it is likely to be something different. Check ‘Save Information’ if you want to, and click OK.

Eclipse will now load your repository in the ‘SVN Repository’ window. For instructions after this point, check out the SVN QuickStart (the link is earlier in the post).