Subversion version control on Windows

Having version control is one of the sound practices of a good programmer.  Version control can be done manually, but is quickly a very administrative and error-prone task, so many development organisations try to use automated systems, such as Microsoft’s Visual SourceSafe or other applications. There are also open-source counterparts, such as the old and trusty CVS, or the newer Subversion.
What is interesting, however, is that many system administrators and architects do development too, but without any  version control.  A set of scripts is not as elaborate as an accounting application, but without proper versioning, even the best  administrator risks losing track of changes, lost time on debugging.  And many places do not offer any form of version control for system administrators!

In this post, I’ll explain how to run your own Subversion version control server to control your script development.  This is an update to this post for Subversion 1.4.5


First of all, get the latest Windows compiled version of Subversion on their website.  This post covers the current 1.4.5 version, but should work for all 1.4.x versions. Install the package with the basic Win32 binaries.

After installation, open a command line window and type in the following:

svnadmin create "c:Documents and SettingsSubversion Repository"

Navigate to the directory you just created.  Uncomment the following lines in the confsvnserve.conf file:

anon-access = read
auth-access = write
password-db = passwd

Uncomment the following lines in the confpasswd file:

harry = harryssecret
sally = sallyssecret

Make the svnserve service by using the following command one one single line:

sc <computername>
  create svnserve
  binpath= "c:Program FilesSubversionbinsvnserve.exe --service --root
  "C:Documents and SettingsSubversion Repository"" 
  displayname= "Subversion Repository"
  depend= Tcpip

Notice that all <options> of the SC command have a <space> after the = sign.  Microsoft has a nice summary up on all SC options.

Notice also how the Repository path has been “escaped” by using “.  You need to do this when your repository path contains spaces.

Type the following to get the service started:

net start svnserve

Next, make your first project:

svn mkdir svn://localhost/myproject

Subversion will create some default folders, and will open notepad with svn-commit.tmp where you can put in a comment.  Save the file, close it and the following will appear in your command line window:

Authentication realm: <svn://localhost:3690> dc1f5697-44ac-5745-849e-e86ad8f60265
Password for 'wooter': **********
Authentication realm: <svn://localhost:3690> dc1f5697-44ac-5745-849e-e86ad8f60265
Username: sally
Password for 'sally': ************

Committed revision 1.

As you can see, you first get asked for the password of your Windows user, and next one of the users defined in confpasswd.


Next, run the TortoiseSVN installer. Install the package with default settings.

Select a folder where you want to start your first version controlled project:


Type in your repository URL and click OK:


Create a new file in that directory, and add the file to your Subversion server


Although you “added” the file, the file has not been checked into Subversion yet.  To commit all changes, right-click on the file or folder and select “SVN Commit”:


Now you can maintain your scripts in version control.




Leave a Reply

%d bloggers like this: