Installing and Setting up Subversion (SVN) Under Windows XP
Sunday, March 18. 2007
For a long time I've wanted to start using Subversion. I see all the benefits of using such a system, but I haven't taken the time to learn it. I've installed it (v1.3.2) a long time ago, but I never really did anything with it -- it was simply so I could interact with SmartSVN (a SVN client) to download others' repositories. I think it's about time I start using it in a more meaningful way on my own projects. In order to do this, I thought it would be best to start from scratch (and therefore uninstalled all previous, remotely related software). (For further learning on SVN, please visit Red-Bean's SVN Book online.)
So, it had been so long since I've done anything with Subversion, where was I to begin? I've read about all the great and wonderful things SVN can offer, but...how do I get it, how do I install it, and then how can I access it?
Edit: UPDATE! If you don't want to do all the work yourself, you can now use an all-in-one installation package. VisualSVN Server/ will install Apache, Subversion, and a management console for the Windows' platform.
Perfect timing! Shane Bauer, a Microsoft Certified Engineer (MCE) in ASP.NET, decided to take time out of his day to answer someone else's question on the matter in a forum that I frequently visit. (Link to the topic.) If you'd prefer pictures (but ignore the "run as service" portion) follow the steps on Vertigo Software's instructions.
The following is basically a cut and paste of Shane's post, simply because it was well written:
Well, now it's time for me to go figure out how to integrate Apache 2.2 with SVN, if at all possible...or get Trac installed since I have that too.
So, it had been so long since I've done anything with Subversion, where was I to begin? I've read about all the great and wonderful things SVN can offer, but...how do I get it, how do I install it, and then how can I access it?
Edit: UPDATE! If you don't want to do all the work yourself, you can now use an all-in-one installation package. VisualSVN Server/ will install Apache, Subversion, and a management console for the Windows' platform.
Perfect timing! Shane Bauer, a Microsoft Certified Engineer (MCE) in ASP.NET, decided to take time out of his day to answer someone else's question on the matter in a forum that I frequently visit. (Link to the topic.) If you'd prefer pictures (but ignore the "run as service" portion) follow the steps on Vertigo Software's instructions.
The following is basically a cut and paste of Shane's post, simply because it was well written:
Subversion is a great product. In fact, I hooked it up to Apache in my home environment as well as my work's environment. After using it for a while my only reaction is: wow. Subversion is awesome. Adding Apache just makes in that much nicer.
Setup is actually pretty straightforward. To use SVN in standalone mode (without Apache), just download the installer (I used svn-1.4.2-setup.exe).
Installing Subversion
- Double-click on the installer and run through it. Shouldn't take too long. Once installed, add an environment variable for SVN_EDITOR. You can do this by right-click on my Computer > Properties. Go to advanced. Hit the Environmental Variables button. Just add another in there called SVN_EDITOR with a value of C:\windows\notepad.exe
Creating a Repository
- Now you need to create a repository. Go to the command prompt (Start > run > cmd). type "svnadmin create D:\Programming\MySVNRepos". (Change the path to whatever path you want to use.) The repos is basically a special directory that will hold your files as well as various subversion config options.
Modifying Security and Authentication Settings
- Next up, you need to modify the permissions and users. Navigate to the folder you just created. In my example, I used D:\Programming\MySVNRepos". In this directory, you will find a few folders. One folder will be called conf. Navigate to it and double-click on the svnserv.conf file. Opening it with notepad will be fine.
- The svnserv.conf file in a configuration file for the svnserv executible. For our purposes, just uncomment out the following lines:
- Save your changes. And double-click on the passwd file in the same directory. The file stores all usernames and passwords in the format:
$username = $password
- Make sure the [Users] line is uncommented and you can just add a new line for your username and password. For example, if you wanted your username to be josh and your password to be testing, just create a line like this:
josh = testing
- Save it and you're done configuring.
Serving Your Repos for the First Time
Now, you can test it out. Go to the command prompt again and type:
Change the path to your specified path. Once this is done, the daemon should be listening and waiting for requests.
Creating your First Project folder
- Next, we can create a project folder in subversion. To do this, open up a new command prompt. We can't use the old one as our daemon will shutdown. Once you're in the new window, type the following:
- Once you type this in, notepad will appear (assuming you set the SVN_EDITOR variable at the very beginning). This is basically used for the log so you can just leave it be for our test example and close it out.
- After you close out notepad, subversion will ask for your username and password. However, keep in mind, it may also ask for your computer's Admin password. If it does, you can simply type in your computer's admin password. Once you hit return, you can then go ahead and type in your subversion username and then your subversion password. Your subversion username and password is exactly what you typed in the passwd file. (i.e. user: josh pass:testing)
- If you've successfully typed in your username and password, it should say Commited Revision 1. This is a good thing.
Finishing Up
- After that's completed, you're basically done. Your subversion repos has been setup. However, we have a few problems.
- You probably don't want the command window up all the time when running your subversion daemon.
- Accessing subversion via command prompt is ok, but it could be better.
Running svnserv as a Windows Service
If you're running XP (Win2k, Win2k3, or Vista), you can tell the process to run as a service. Stop your existing svnserv daemon by closing out of the existing command prompt window. Now, go to the command prompt (again). Type:
Ed. Note: The key/value pairs must be in the form key=_value where the underscore is representative of a space. Also, if you mess up here and the service is still installed, you will need to uninstall the service. You can do so by using sc delete svnrepos (or whatever service name you used). You will need to log off and back on for the service to be completely uninstalled. Also, the "Subversion Repository" is simply a label, you may also call this whatever you'd like.
This simply creates a new service in Windows. Of course, you will need to replace "D:\Programming\MySVNRepos" with the path to your repos that you created. Assuming that you install subversion in the default location, you should just have to run that. Now, just start it by typing:net start svnrepos
You're done. If you want to change some service settings, such as turning on auto start, just go to Start > run. Type services.msc. Find the service with the Display Name set to "Subversion Repository", right-click on it and select Properties. You can change a few different things in there.
Download TortoiseSVN
Go to tortoisesvn.tigris.org and download TortoiseSVN. The tool is essentially a Windows shell extension that allows you to execute SVN commands from Windows Explorer. It's, honestly, the only subversion tool you really need if you're on a Windows computer. Once you install this, you can then view your repos via a tree view type situation.
For example, go to start > run and type:svn://localhost
If your service/daemon is started, you should be able to expand the nodes to view your projects and files. You can also create new folders and do a plethora of different tasks in it as well. Also, if you go into Windows explorer, and right-click on any folder, you'll see a new TortoiseSVN submenu, with a few different options. You can then easily import an entire project folder into subversion with ease.
That's It!
Well, now it's time for me to go figure out how to integrate Apache 2.2 with SVN, if at all possible...or get Trac installed since I have that too.
Trackbacks
Trackback specific URI for this entry
Comments
I was able to integrate with Apache 2.2.3
Here's the additional articles needed to complete the installation:
Win32 - SVN + Apache + Tortoise SVN + SVN Notify How-To (but uses wrong libraries):
http://svn.haxx.se/users/archive-2006-05/att-0593/SVN-Apache-SVNNotify-HowTo-En.pdf
Getting the right libraries for Apache 2.2.X
http://subversion.open.collab.net/servlets/ProjectForumMessageView?forumID=42&messageID=783
The SVN libraries compatible with Apache 2.2.x (mentioned in the article above, but really hard to find) are located here:
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100&expandFolder=8100&folderID=91
http://subversion.tigris.org/files/documents/15/36104/svn-win32-1.4.3.zip
Thanks for all your details, it helped a lot.
Here's the additional articles needed to complete the installation:
Win32 - SVN + Apache + Tortoise SVN + SVN Notify How-To (but uses wrong libraries):
http://svn.haxx.se/users/archive-2006-05/att-0593/SVN-Apache-SVNNotify-HowTo-En.pdf
Getting the right libraries for Apache 2.2.X
http://subversion.open.collab.net/servlets/ProjectForumMessageView?forumID=42&messageID=783
The SVN libraries compatible with Apache 2.2.x (mentioned in the article above, but really hard to find) are located here:
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100&expandFolder=8100&folderID=91
http://subversion.tigris.org/files/documents/15/36104/svn-win32-1.4.3.zip
Thanks for all your details, it helped a lot.
Thanks for the detailed instructions. I'm having hardtime configuring Openssh with SVN on the server side. Here's my configuration - Subversion 1.44 on Windows 2003.
Has anyone tried configuring SSH on SVN+Windows2003 server? Can you please pass on the instructions. Appreciate your help. Thanks.
Has anyone tried configuring SSH on SVN+Windows2003 server? Can you please pass on the instructions. Appreciate your help. Thanks.
Arun, I apologize for not seeing your reply sooner. I still have not worked with Subversion all that much, even if I know I need to and keep saying I will. However, the following links may be of help to you:
someone with similar problems - mailing list archive
probably not as helpful - forum topic
probably a good bet
someone with similar problems - mailing list archive
probably not as helpful - forum topic
probably a good bet
Ing,
I can only presume it has something to do with a user in the Administrator's Group not actually having the full rights as the real Administrator under Vista. I unfortunately do not have Vista installed on any of my PCs yet so am unable to test this out to find a workaround. However, you may find the following project to be helpful:
SVN Automated Windows' Install
I'm not sure if it's Vista compatible, but it can't hurt to try.
I can only presume it has something to do with a user in the Administrator's Group not actually having the full rights as the real Administrator under Vista. I unfortunately do not have Vista installed on any of my PCs yet so am unable to test this out to find a workaround. However, you may find the following project to be helpful:
SVN Automated Windows' Install
I'm not sure if it's Vista compatible, but it can't hurt to try.
You're quite welcome, Srinivas. If you reformat and get stuck and don't want to have to go through all of these steps, I would highly recommend VisualSVN, a free SVN server that is Windows based, using services and even installs its own administrative (GUI) tool to manage users, groups, and repositories. It's fully compatible with TortoiseSVN, though I haven't tested it against external Linux/Unix/OSX shell-based commands.
The link here for the Windows binaries has become stale. The Subversion community volunteers who formerly maintained these binaries no longer do, as there are now professionally built and tested (and still free!) binaries available from a variety of places, such as
http://www.open.collab.net/downloads/subversion/
Also, these particular binaries include a fully integrated Apache server, the ViewVC repository browser, and a handy web-based admin console as well.
http://www.open.collab.net/downloads/subversion/
Also, these particular binaries include a fully integrated Apache server, the ViewVC repository browser, and a handy web-based admin console as well.

I found the following very useful information on how to set up SVN on a Windows 2003 server. I found it http://life.mysiteonline.org/archives/67-Installing-and-Setting-up-Subversion-SVN-Under-Windows- ...
Tracked: Apr 20, 06:52
?? ???? ???????? ?? ???? ???, ????? ???? ?? ???????, ????? ?????? ??? ????? ???????? - ?? ?????? ?????
Tracked: May 18, 05:49
אם נושא הגיבויים לא חשוב לכם, כנראה שאתם לא מתכנתים, ובגלל שהבלוג הזה מיועד למתכנתים - אז החלטתי לכתוב
Tracked: Jun 19, 08:56
Tracked: Mar 07, 00:40