Setting Up Subversion for Development on Windows
By Akash Mehta2008-07-02
Setting up a Subversion server on Windows
We have a number of options for installing an SVN server under Windows. One of them involves integrating with Apache, which offers some advantages in terms of integration with existing files. However, it requires some additional configuration - and, of course, a working install of Apache. Instead, we're going to use an easy to use server package endorsed by Collabnet, the company behind Subversion. The VisualSVN Server allows us to quickly install a Subversion server just like any other application under Windows, then manage it via a familiar interface - a snap-in for the MS Management Console (mmc).
Installing the server
Head over to the download page of VisualSVN Server and grab the latest copy; I'm working with 1.5. Run through the install procedure till you see this screen:

You can leave these settings as they are, and you can always change them after installation, but it's worth giving them some thought at this point.
There are two options you may consider for configuration; the first is repository location. If your projects tend to grow in size, and you typically store code on a seperate partition as a result, you may wish to choose a different drive for your repositories as well. This can also help manage backups; you can backup your repositories just by making a copy of the server's repository folder. If you regularly backup a particular partition, placing your repositories there is always a good idea.
The second consideration is authentication method. We'll be using simple Subversion authentication here. However, if you will only ever access your repositories locally via your Windows machine, you may find it easier to use Windows authentication. In this case, when you login to the server to make code changes, you can use your existing login credentials for the local machine.
Once these two options are out of the way, continue with the installation process till the end.
Creating our first repository
Once VisualSVN Server is installed, open up the server manager. If this doesn't happen automatically after the install process, you can find it in your Start menu under "VisualSVN". You should see something like this:

The server management interface is simply a snap-in for the standard Microsoft Management Console; the interface will be quite familiar if you've delved into the administrative tools on your Windows machine.
Your interface will be slightly different, as we haven't yet setup any repositories - so let's create one now! Click "Create new repository...", name our new repository "test" and click OK.

By creating the "default structure", the server will create three folders in our repository: trunk, branches and tags. These are designed to organise your code more effectively. Your main working copy is always stored in the trunk, while forking your project for major experimental changes is generally done by creating a new folder under branches. When you reach a stable version of your project, ready for release or just internal use, you can store that state in a "tag" so that you can easily recreate a copy of the code at a particular milestone when needed.
We'll also need to create a new user so that we can access the repository. Head back to the main server management page and create a new user named "test". (If you chose to use Windows authentication, you can skip this step.)

Now, we have an SVN repository ready to go!
Tutorial Pages:
» Introducing Subversion
» Setting up a Subversion server on Windows
» Working with Subversion
» Further reading
