HowTo: svn+ssh on Windows
The problem: Windows doesn't have an inbuilt SSH client, so trying to check out files from a Subversion repository over SSH doesn't work out of the box. I've just spend half an hour looking for a way round this, and here it is [as ever, you follow my advice at your own risk]:
- I couldn't manage to get it working using PuTTY. Please leave a comment if you have.
- Install Cygwin, making sure to include the openssh package
- Edit the C:Documents and Settings(yourusername)Application DataSubversionconfig file to include a line reading
ssh = c:/(cygwin root path)/bin/ssh.exe -i "C:/privatekeypath"
- You can omit the -i option and the bit after it if you don't have SSH key authentication set up. If you're using it, though, make sure you use forward slashes in the path to the key file. Note that the private key needs to be in OpenSSH compatible format. If you have key authentication set up in PuTTY, you can export your private key to an OpenSSH compatible version using PuTTYgen.
- You should now be able to check out repositories in the usual way from a command prompt:
svn co svn+ssh://[email protected]/path/to/repository/ destination-dir
If you exported your PuTTY key as described above, you shouldn't be prompted for your password on hosts where the corresponding public key is in place.
Since writing this post, I've had Tortoise SVN recommended to me, and it Just Works out of the box if you use the PuTTY saved session name in the URL, i.e. if the PuTTY session is called "mybox", svn+ssh://mybox/path/to/repo seems to work correctly.