Subversion: Getting started 1
This article will walk you through the steps of installing and configuring a Subversion server on Microsoft Windows. Subversion is an excellent solution for .NET teams who are frustrated with the limitations and deficiencies of Source Safe and Team Foundation Server.
To test your subversion repository, you should make sure that you have installed the latest version of TortoiseSVN. You can download it here.
You must be logged in to your server as administrator. It needn’t actually be Windows Server that you are using, it could just as well be Windows 2000 Professional or Windows XP, but I shall refer to it as a server.
We need to create folders for the subversion binaries and your repository data. I recommend the following folder structure:
C:\Subversion
C:\Subversion\bin
C:\Subversion\data
You can use different folders to suit your taste (or to keep with existing conventions), but you will need to alter the commands I give.
We will download the latest version of Subversion in a zip package from tigris.org. Installer packages may be available, but I cannot vouch for their quality. I have found the command line version to work extremely well.
You should visit the Subversion Win32 download page [subversion.tigris.org] and download the most recent svn-win32-x.y.z.zip file. It’s usually the last file listed, and as of writing is svn-win32-1.4.3.zip.
You should extract the entire contents of the zip folder to a temporary location. Inside the svn-win32-1.4.3 folder is a bin folder. The contents of bin need to be copied to C:\Subversion\bin. You can now delete the temporary folder.
We should add the subversion\bin folder to our ‘path’. Right click My Computer and choose Properties. Open the Advanced Tab and click Environment Variables. In the bottom panel (System variables) scroll down and find Path. Double click it, and append the value:
;C:\Subversion\bin
Note the semi-colon – that seperates this path from the rest of the configured setting.
Now we can try it out. Open a command prompt window (you can find the Command Prompt in Start, Programs, Accessories)
svn --version
Should print "svn, version 1.4.3 (etc)". If you get an error then something is probably wrong with the Path setting.
Now we shall create our first repository. We shall call it ‘test’.
svnadmin create C:\Subversion\data\test
Let’s run a Subversion server from the console. This server will stop as soon as we close the console, press CTRL + C or log out of our session.
svnserve -d -r C:\Subversion\data
To test that it is running, you can use Tortoise. If it is installed, right click anywhere on your desktop and choose TortoiseSVN -> Repo-browser. In the window that pops up, enter the URL: svn://localhost/test.
Dobule clicking the only visible folder should cause the ‘plus’ icon to disappear. This is because there are no contents. Right click the folder and try creating a sub-folder. After receiving a message that it created a folder remotely, you should get an error that Authorisation failed.
By default, subversion will only allow read-only anonymous connections. To change these settings you should use Windows Explorer to examine the contents of the folder C:\Subversion\data\test\conf
Inside that folder, you will notice a file ‘svnserve.conf’. You can use Notepad to open this file and make changes. If you remove the # that is placed before anon-access (# means ignore this line) and change the word read to write, you will be able to make changes to the repository without entering a password. This probably isn’t what you want, and you will normally use anon-access = read or anon-access = none.
We are creating a typical and basic configuration, so you should remove the # character from the lines auth-access = write and password-db = passwd. You can now save and close the file.
‘passwd’ is another file in the conf directory. This is where we define our user accounts. If you open that file, also in Notepad, you will see more lines that are disabled by #. These are example users and should be deleted.
Beneath the [users] tag you should enter your logins in the form: username = password.
E.g.
adrian.oconnor = Hatstand
Now when you use TortoiseSVN -> Repo-browser to create a folder, it will prompt you for a username and password (assuming your console window is still open and the server is still running).
It is important that you do not use anonymous access to allow write access because it leaves you with no way of seeing who made each commit in the log. By requiring a username, even if you leave passwords blank, your log messages will indicate who added those files.
If all is working well at this point, it is time to install svnserve as a service. This will ensure that it can start when your server boots up and will run even when no user is logged in.
Re-activiate your Command Prompt and enter CTRL + C. Svnserve will stop. Now enter the following command:
sc create Subversion start= auto binPath= "C:\Subversion\bin\svnserve --service -r C:\Subversion\data" depend= TcpIp DisplayName= "Subversion Server"
You will now have a Subversion Server service listed in your services control panel. Seeing as you already have a console open, you can start it from there:
net start Subversion
Congratulations! You have a fully usable subversion installation. You will now want to learn how to import your existing codebases and work with subversion repositories. I shall deal with those matters in future articles, but there are plenty of other resources on the internet, including the very good (and rather comprehensive) Subversion book, which is freely available on-line.

Very useful information. Thanks !