I’ve managed to set up a Subversion repository on my 1and1.co.uk hosting now, and even got it working directly from eclipse. This may or may not work on other shared hosts. It was pretty simple, and here’s how I did it:
- Use PuTTY to connect to your server
- If you haven’t already got Subversion (type “svn” to check), follow this guide to install it.
- Set up an SVN repository:
svnadmin create [repository name]
- Import your existing files:
svn import name-of-folder file:///path/to/repos -m 'First Import'
That’s the repository set up, now to set up Eclipse PDT.
- You need an SSH client for this – I use TortoisePlink which is built into TortoiseSVN. You can either go down the private key route and have password-less SSH logon, or alternatively the simpler (and much less secure) way is to include the -pw option on TortoisePlink. If you are not concerned about security, then do this. If not, there are plenty of guides on setting up a password-less SSH logon.
- Open the Subversion config (on Vista, that is C:\Users\[username]\AppData\Roaming\Subversion\config) and in the [tunnels] section, add this line:
ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe -pw [your-password]
- Once you’ve done that, right click the PHP Explorer, select Import. In the SVN folder, select “Checkout Projects from SVN”.
- The URL to your SVN repository should be:
svn+ssh://[1and1-username]@[hostname]/[full-path-to-repository]
- You can find the full path by typing navigating to the repository directory in PuTTY, and typing “pwd” if you don’t already know.
- For 1and1, I just use the default website (sNNNNNN.websitehome.co.uk) rather than any of my domains, but I expect it would work with any of the domains you have set up with the destination as your home directory.
- Clicking next should load up the list of folders in the repository and you can select one, or the entire repository to checkout.
- Change any options you want changed, and then Finish to import it. You should now see a new (or existing project if you already had one) project in your PHP Explorer, ready for you to use with Subversion enabled.
This list is the steps that I took to do this, and I sourced my information from these various places. This should hopefully help anyone get through the problems of setting up a repository on 1and1 who uses Eclipse PDT.
- Nick Sergeant
- P J Hile
- “Ramblings”
- Mark Grabanski – you might find this one useful for adding an auto-update hook to SVN
