Getting svn+ssh client access in Windows

The following steps should help if you are using an svn commandline client and you get an error like:

svn: OPTIONS of 'http://YOURSVNDOMAINANDPATH': could not connect to server

Or if you get,

Network connection closed unexpectedly

in NetBeans or TortoiseSVN. UPDATE: The steps below turn out to fix the problem only in the commandline client, not in TortoiseSVN nor in Netbeans, sorry.

I had been using svn through Eclipse+SVNKit without much problem, but when I had to use NetBeans for a new collaborative project, I couldn’t get svn working even though I was using the same repository as with Eclipse. Switching from Netbeans to TortoiseSVN and a commandline svn client didn’t do any better. It seems a fair number of people have the same problem, and it seems due to all of these programs using a common config file and that file configures ssh support off by default. If you need to access an svn repository whose url starts with “svn+ssh://” and you’re using Windows, this advice is likely to be of use to you.

  1. Install your SVN client (e.g. NetBeans including SVN, TortoiseSVN, or CollabNet’s commandline SVN client)
  2. Download ssh commandline client plink
  3. Add the path to plink to your Path environment variable
  4. Make sure Windows isn’t hiding your AppData folder: In Windows7 in WindowsExplorer, select Organize | “Folder and Search Options” | View, and select “Show hidden files, folders, and drives”.
  5. Edit

    so that the following is uncommented:

    ssh = plink -l YOURUSERID -pw YOURPASSWORD


  6. Change the commandline to the directory where you want the SVN contents to be savedFor example,

    H:> C:
    C:> cd UsersdavidDesktopProjectsNetbeansWorkspace
  7. You should now be able to make a local copy of the SVN contentsFor example, if your SVN is running on a server at DOMAIN:PORT, and the repository on that server is at /home/svn/repos, and the folder you want a local copy of is PROJECTFOLDER, then use

    C:LOCALPROJECTS> svn co svn+ssh://DOMAIN:PORT/home/svn/repos/PROJECTFOLDER