Scroll to content

Installing and Configuring SVNServe and TortoiseSVN on Windows

After you’ve been working with code for a while, source control is a godsend. It provides a way of tracking changes, prevents conflicts and generally saves your bacon. Here’s how to set it up on Windows 7.

Installation

First grab the latest SlikSVN and TortoiseSVN packages for your platform – x86 and x64 versions are available. Install both packages and restart your machine.

Setting up the SVN service

A lot of people tend to run into problems with this one and assume that TortoiseSVN is somehow incompatible with the version of the SVN binaries from the SlikSVN package. As always, it’s all in the setup. If the svnserve service isn’t set up correctly, you may encounter the following error when you try to browse your repository using TortoiseSVN:

Can't connect to host localhost: No connection could be made because the target machine actively refused it.

This is because unless explicitly stated, svnserve will listen for IPv6 connections where the IPv6 protocol is supported, which is true of Windows Vista, 7 and Server 2008. In order to get TortoiseSVN connecting properly, you need to set up the svnserve service as follows (from an Admin command prompt, assuming your binaries are installed at C:\SVN):

sc create svnserve binpath= "C:\Program Files\SlikSvn\bin\svnserve.exe --service --root C:\Users\Chris\SVN --listen-host 0.0.0.0" displayname= "Subversion" depend= tcpip start= auto

The important bit being the --listen-host 0.0.0.0, which tells svnserve to listen for IPv4 connections. Now start your service:

net start svnserve

And when you open up svn://localhost in your repo-browser everything should be working perfectly.

This entry was posted in code and tagged , , , , . Bookmark the permalink.

17 Responses to Installing and Configuring SVNServe and TortoiseSVN on Windows

  1. Thanks, very useful article – it can be found easily because of all the keywords 🙂

  2. Thanks for response, yes the port is open and the service is listening, if I stop the service it gives me a can’t connect to host message but if it is started it gives me always “No repository found”. but the repository exists because I can get through file:/// I have spent hours and hours and I am very frustrated. I think I’ll give up, do you know an alternative repository soft for Windows?

    Thanks.

  3. Are you using TortoiseSVN, command line client or an IDE?

    Is the version of your SVN client the same as the version that created your repository?

    Personally I quite like SVN, but you could try Git.

  4. Hi Chris
    No words to express my sincere thanks as got struck for long hours in trying to get svn://localhost up and running using windows service. Your tip –listen-host 0.0.0.0 added to the service entry did all the trick. Great and Big Thanks.

  5. Hello, i’m also having this issue.
    I tried your command, but the “net start svnserve” doesn’t work. It says there is a system error #3.

    Have you any advice plz ?

    Thanks in advance.

  6. Hello again,

    Sorry for my poor question, i’m not very familiar with all this.
    Actually i don’t understand where do you get your “c:\svn\bin\svnserve.exe”.
    When i create a repository (with the tortoise context menu “create repository here”, there is no ‘bin’ folder.
    I only got conf/, db/, hooks/ and locks/.

    thanks in advance.

  7. Alfred, c:\svn\bin is where I installed my SVN binaries. I’ll rewrite the guide to make it a bit clearer.

  8. when i tried same command “sc create svnserve binpath= “c:\svn\bin\svnserve.exe –service –root c:\svn –listen-host 0.0.0.0” displayname= “Subversion” depend= tcpip start= auto”

    i got eror “It says there is a system error #3.”

    you have any solution plz.

Leave a Reply

Your email address will not be published. Required fields are marked *