Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

programming and human factors by Jeff Atwood * Apr 5, 2008 Seng up Subversion on Windows

When it comes to readily available, free source control, I don't think you can do beer than Subversion at the moment. I'm not necessarily advocang Subversion; there are plenty of other great source control systems out there ‐‐ but few can match the ubiquity and relave simplicity of Subversion. Beyond that, source control is source control, as long as you're not using Visual SourceSafe . And did I menon that Subversion is ... free?

Allow me to illustrate how straighorward it is to get a small Subversion server and client going on Windows . It'll take all of 30 minutes, tops, I promise. And that's assuming you read slowly.

The first thing we'll do is download the latest Subversion Windows binary installer . At the me of wring, that's 1.46. I recommend overriding the default install path and going with something shorter:

c:\svn\

Note that the installer adds c:\svn\bin to your path, so you can launch a command prompt and start working with it immediately. Let's create our first source repository, which is effecvely a system path.

svnadmin create "c:\svn\repository"

Within that newly created folder, uncomment the following lines in the conf/svnserve.conf file by removing the pound character from the start of each line:

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

Next, add some users to the conf/passwd file. You can uncomment the default harry and sally users to play with, or add your own:

harry = harryssecret sally = sallyssecret

As of Subversion 1.4, you can easily install Subversion as a Windows service , so it's always available. Just issue the following command:

sc create svnserver binpath= "c:\svn\bin\svnserve.exe --service -r c:\svn\repository displayname= "Subversion" depend= Tcpip start= auto

It's set to auto‐start so it will start up automacally when the server is rebooted, but it's not running yet. Let's fix that:

net start svnserver

1 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Note that the service is running under the Local System account . Normally, this is OK, but if you plan to implement any Subversion hook scripts later, you may want to switch the service identy to an Administrator account with more permissions. This is easy enough to do through the tradional Windows services GUI.

Now let's verify that things are working locally by adding a root‐level folder in source control for our new project, aptly named myproject .

set SVN_EDITOR=c:\windows\system32\notepad.exe svn mkdir svn://localhost/myproject

It's a lile weird when running locally on the server, as Subversion will pop up a copy of Notepad with a place for us to enter commit comments. Every good programmer always comments their source control acons, right?

Enter whatever comment you like, then save and close Notepad. You'll be prompted for credenals at this point; ignore the prompt for Administrator credenals and press enter. Use the credenals you set up earlier in the conf/passwd file. If everything goes to plan, you should be rewarded with a "commied revision 1" message.

2 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

svn mkdir svn://localhost/myproject Authentication realm: Password for 'Administrator': [enter] Authentication realm: Username: sally Password for 'sally': ************ Committed revision 1.

Congratulaons! You just checked your first change into source control!

We specified svn:// as the prefix to our source control path, which means we're using the nave Subversion protocol. The Subversion protocol operates on TCP port 3690 , so be sure to poke an appropriate hole in your server's firewall, otherwise clients won't be able to connect.

Now that the server's good to go, let's turn our aenon to the client . Most people use TortoiseSVN to interact with Subversion. Download the latest 32‐bit or 64‐bit Windows client (1.4.8.12137 as of this wring) and install it. The installer will tell you to reboot, but you don't have to.

Now create a project folder somewhere on your drive. I used c:\myproject . Tortoise isn't a program so much as a shell extension. To interact with it, you right click in Explorer. Once you've created the project folder, right click in it and select "SVN Checkout..."

Type svn://servername/myproject/ for the repository URL and click OK.

3 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Tortoise now associates the c:\myproject folder with the svn://servername/myproject path in source control. Anything you do on your local filesystem path (well, most things‐‐ there are some edge condions that can get weird ) can be checked back in to source control.

There's a standard convenon in Subversion to start with the "TTB folders" at the root of any project :

Because Subversion uses regular directory copies for branching and tagging (see Chapter 4, Branching and Merging ), the Subversion community recommends that you choose a repository locaon for each project root ‐‐ the "top‐most" directory which contains data related to that project ‐‐ and then create three subdirectories beneath that root: trunk , meaning the directory under which the main project development occurs; branches , which is a directory in which to create various named branches of the main development line; tags , which is a collecon of tree snapshots that are created, and perhaps destroyed, but never changed.

Of course, none of this means your developers will actually understand branching and merging , but as responsible Subversion users, let's dufully add the TTB folders to our project. Note that we can batch up as many changes as we want and check them all in atomically as one unit. Once we're done, right click the folder and select "SVN Commit..."

4 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

In the commit dialog, indicate that yes, we do want to check in these files, and we always enter a checkin comment‐‐ right? right?

You'll have to enter your server credenals here, but Tortoise will offer to conveniently cache them for you. Once the commit completes, note that the files show up in the shell with source control icon overlays:

5 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

And now we're done. Well, almost. There are a few sengs in Tortoise you need to pay special aenon to. Right click and select "TortoiseSVN, Sengs".

1. See that hidden ".svn" folder? These folders are where Subversion puts its hidden metadata schmutz so it can keep track of what you're doing in the local filesystem and resolve those changes with the server. The default naming convenon of these folders unfortunately conflicts with some fundamental ASP.NET assumpons. If you're an ASP.NET 1.x developer, you need to switch the hidden folders from ".svn" to "_svn" format , which is on the General opons page. This hack is no longer necessary in ASP.NET 2.0 or newer .

2. I'll never understand why, but by default, Tortoise tries to apply source control overlays across every single folder and drive on your system . This can lead to some odd, frustrang file locking problems . Much beer to let Tortoise know that it should only work its shell magic on specific folders. Set this via "Icon Overlays"; look for the exclude and include paths. I set the exclude path to everything, and the include path to only my project folder(s).

Unfortunately, since Tortoise is a shell extension, seng changes may mean you need to reboot. You can try terminang and restarng explorer.exe, but I've had mixed results with that.

And with that, we're done. You've successfully set up a Subversion server and client . A modern client‐ server source control system inside 30 minutes ‐‐ not bad at all. As usual, this is only intended as the gentlest of introducons; I encourage you to check out the excellent Subversion documentaon for more depth.

I find Subversion to be an excellent, modern source control system. Any minor deficiencies it has (and there are a few, to be clear) are more than made up by its ubiquity, relave simplicity, and robust community support. In the interests of equal me, however, I should menon that some influenal developers ‐‐ most notably Linus Torvalds ‐‐ hate Subversion and view it as an actual evil . There's an emerging class of distributed revision control that could eventually supercede exisng all the centralized source control systems like Subversion, Vault, Team System, and .

I'm skepcal. I've met precious few developers that really understood the versioning concepts in the simple

6 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

centralized source control model. I have only the vaguest of hopes that these developers will be able to wrap their brains around the vastly more complicated and powerful model of distributed source control. It took fi een years for centralized source control usage to become mainstream, so a lile paence is always advisable.

Posted by Jeff Atwood

« Mousing Surface Theory Help Name Our Website »

7 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Comments

I believe the distributed vs centralized source control system debate all revolves around the working environment that the developers use. The various features of distributed source control systems that "are great" that have been menoned ‐‐ like the ability to have mulple repositories for test vs development vs each person, etc, that's not the providence of a distributed source control system, it's a feature of a good source control system with good branching support. I do that in Perforce all the me ‐‐ development vs test vs release, with occasional labeling.

I believe that developers like Linus and other developers operate in a more disconnected, more distributed environment than, well, anyone has in the past. A single repository doesn't make any sense for them, which, well of course means that every source control system that existed in the past doesn't work for them. Like all good so ware developers, the went off to write their own tool.

The one feature that they really get is the ability to run disconnected from a server and sll commit, which is nice, but not always required for all developers.

However, I worry that, for projects that don't actually need a distributed system, like say, a "group of people in a single office working on so ware", I worry that a distributed source control system would just be a excuse for people to follow bad team development paerns. Sure, they'd all have change control for their own checkins, but I rue when "merge day" appears and everyone breaks each other's code.

I'd also add that a centralized source repository makes it easy to meet other business (not necessarily development‐centric) requirements ‐‐ single point for backups, long term tracking of code, configuraon control, etc etc.

I use Perforce at work. I like it. I have seen connual addions of features in the 3 years I've been using it, I've had excellent support, and the only me I would think of using anything else is if I had no money and mulple developers, at which point I'd probably use Subversion.

ALex on April 6, 2008 2:42 AM

The fact that you think dvc systems are somehow _more_ complicated than the original centralized model amusingly proves your own point, but not how you intended.

The real reason we'll be stuck with subversion for years to come is that most mediocre developers wont take the me to learn new tools and new ways of doing things, and therefore will never grok distributed .

Codemonkeys w, unfortunately.

dude on April 6, 2008 2:52 AM

8 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

HI, with this notepad popup when you commit something ‐ did you try to specify ‐m flag with a message eg svn commit ‐m "test"? atleast, on unix it takes care of that.

alexei on April 6, 2008 2:56 AM

"When it comes to readily available, free source control, I don't think you can do beer than Subversion at the moment."

Except by using the much superior .

Nicholas Wright on April 6, 2008 2:56 AM

I did a post about seng up SVN without a server that you'll find helpful.

hp://www.sleepoverrated.com/2008/04 /06/GuerillaDevelopmentSetupSourceControlIn60Seconds.aspx

I recommend people use VisualSVN Server too it gives you hps easily

Sco Cowan on April 6, 2008 3:21 AM

how about hp://bazaar‐vcs.org/?

svn was single‐central‐repo model source control

I'd prefer something more distributed

chakrit on April 6, 2008 3:40 AM

I really like SVN plugin for Visual Studio integraon by PushOK so ware. It's cheaper than VisualSVN ($29.99) and its a MSSCCI provider, so it uses the same source control window that comes with VS. Plus all MSSCCI aware applicaons will automacally just work.

hp://www.pushok.com/so _svn.php

Ben L on April 6, 2008 3:43 AM

I rue when "merge day" appears and everyone breaks each other's code.

I watched the rest of Linus' talk at hp://www.youtube.com/watch?v=4XpnKHJAok8 . Git *enforces* per‐developer personality‐driven p2p branches. This is great for ego‐driven people like Linus who have a lot of power, fame, and personality. That makes sense. :)

9 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

I'm really intrigued by Linus' claim that merging becomes extraordinarily simple in Git. He's absolutely right about that‐‐ the problem with branches isn't the branching, it's the merging.

Sll, I'm unclear why merging would be inherently "easy", except for trivial diffs where there's no overlap in the lines that were edited. It seems the tooling could be improved on the SVN side to make this happen, if that's all he's referring to.

The social aspects of distributed source control are prey compelling, though. It "works more like people work" is arguably true.

Jeff Atwood on April 6, 2008 3:44 AM

I've tried to introduce Subversion at work, to replace Visual Source Safe. Our problem is however that we deal with Microso Reporng Services reports. A change to a report will usually restructure the whole file, shuffling bits and pieces around and creang total pain when merging. Not to menon that reports can get quite big (5000‐6000 lines) and it annoys me greatly that subversion inserts it's ' 1.2' merge tags into them.

Exclusive locks are, I think, the beer opon in these cases. Is there anything I could do to subversion to make my life easier when dealing with these cases?

Ilici on April 6, 2008 4:20 AM

I guess it all depends on what type of so ware you are trying to control. At a previous employer our code was mostly binary files. Although IT hated it we had lile trouble with VSS. And SVN was a nightmare. Just that one experience soured my opinion towards "free" open‐source so ware almost irrepairably.

PaulG. on April 6, 2008 4:39 AM

One nice thing about Git is that it does not leave .svn turds in all you directories.

Jeff Hawkins on April 6, 2008 4:43 AM

Seng up svn in Apache is more complicated, especially under Windows. Sll a great arcle! :)

Alex on April 6, 2008 5:02 AM

Have you tried any distributed source control? I've recently switched from Subversion to , and I'm very happy about the change.

The most important reason was the ability to clone the repository to my laptop, do some checkins there

10 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

(without network access, on a plain, train, etc.) and resync with just one command when I'm back home. Distributed model seems cool even for a single developer :)

Also I don't like the way Subversion deals with branches and tags (i.e. by "cheap copy"). It simply doesn't work well for me, e.g. if one checkouts a repository with many tagged and branched versions, the workspace becomes much bigger than it should be. To avoid it, one needs to selecvely checkout parts of the repository, I find it quite annoying.

Czajnik on April 6, 2008 5:05 AM

Has anyone tried any of the Visual Studio.net plugins for Subversion?

Tim Almond on April 6, 2008 5:10 AM

"One nice thing about Git is that it does not leave .svn turds in all you directories."

That's a good point ‐ I've really goen used to (in linux) typing rm ‐rf `find . ‐type d ‐name .svn` to clean out a chunk of code so it's ready to share.

Is there an easy way to do the same on the windows command line?

(That aside, thanks for the tutorial. I'm a big fan of svn in general, and that looks very useful.)

John Fiala on April 6, 2008 5:14 AM

"I've met precious few developers that really understood the versioning concepts in the simple centralized source control model. "

Probably a lot of them VS.Microso devs? Brought up with Visual BASIC and SourceSafe. I understand why they wouldn't understand.

Diego on April 6, 2008 5:18 AM

@Tim Almond

I use AnkSVN. It works great as a simple indicator of changed files within the IDE, but it seems bit clunky to actually use beyond the Diff and Add commands, IMHO.

I sck to TortoiseSVN for all other needs.

Jibbers42 on April 6, 2008 5:19 AM

Sorry if I seem to not understand something, but if you're going to use TortoiseSVN anyway, why not simply right‐click on a folder and select "TortoiseSVN‐Create Repository Here..."? I have done this

11 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

mulple mes, and have had no issues whatsoever.

XTremeEd on April 6, 2008 5:20 AM

Local System account is actually not a limited account. It has EXTREMLY high access to your local machine, but no access across the network.

Marn Liesn on April 6, 2008 5:24 AM

Seng up svn in Apache is more complicated,

What does that get us? Some kind of web UI? Use of port 80?

clone the repository to my laptop, do some checkins there (without network access, on a plain, train, etc.) and resync with just one command when I'm back home.

What is the difference between what you describe, and working tradionally offline, then checking in when you get back into the office? If a "checkin" occurs on your local machine, and nobody else in the world knows about it.. did it really happen? Maybe I'm not understanding the disncon here. I sll need to watch the rest of Linus Torvalds' presentaon on this topic ( hp://www.youtube.com /watch?v=4XpnKHJAok8 )

Also I don't like the way Subversion deals with branches and tags

True, that part is a lile gheo‐‐ you shouldn't be able to check a change into a "tag", but you can. The tag is sort of an illusion‐cum‐convenon in Subversion; it's really a branch.

There is no perf penalty for creang hundreds of branches, though. They're only ultra‐lightweight pointers unl a change occurs under that branch.

Has anyone tried any of the Visual Studio.net plugins for Subversion?

No, I haven't. But there are two that I know of:

hp://ankhsvn.open.collab.net/ hp://www.visualsvn.com/

This is sort of a religious issue. Some developers believe source control should *never* be done inside the IDE, and I've started to see their point a er dealing with the many, many bugs in the Team Explorer Visual Studio integraon point of Team System.

Jeff Atwood on April 6, 2008 5:24 AM

@Tim:

We looked into SVN plugins when we moved to SubVersion last year, and a er trying a few we found

12 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

VisualSVN ( hp://www.visualsvn.com/) to be the clear winner ‐ VERY nice integraon with Soluon Explorer, and context menus to quickly find out a current file's history, or diff between two versions, etc.

It may be a lile pricey for some at $49 a seat, but I definitely think it's worth the money. Hope that helps :o)

Andrew on April 6, 2008 5:29 AM

clone the repository to my laptop, do some checkins there (without network access, on a plain, train, etc.) and resync with just one command when I'm back home.

What is the difference between what you describe, and working tradionally offline, then checking in when you get back into the office? If a "checkin" occurs on your local machine, and nobody else in the world knows about it.. did it really happen?

The difference is that you can keep a trace of the different checkins you did and you can go back when you want on your local repository. And then you can checkin to the main repository in the end.

Christophe Thiriot on April 6, 2008 5:43 AM

Seng up svn in Apache is more complicated, What does that get us? Some kind of web UI? Use of port 80?

Well, it can get you per‐directory permissions, a web UI (to browse at least) and a few other things. I've got it setup on our Linux server, and it hosts to (mostly) Windows clients.

Ankh is nice, but somehow it feels rather clunky. I sck to Tortoise, or the command line for anything substanal. On Linux, I use either kdesvn or the command line.

I'd sll like to switch to a distributed VCS if only for my own convenience, but too many people don't even grok basic branching and tagging... It'd be torture on them.

shash on April 6, 2008 5:45 AM

hp://svn1clicksetup.gris.org/ ‐ 1clicksetup, all i need for my svn happiness, server+client

pragmag on April 6, 2008 6:00 AM

What is the difference between what you describe, and working tradionally offline, then checking in when you get back into the office?

I think this comes down to your philosophy if when to commit your code. Personally I like to make fairly small, incremental changes. I find that this helps when you make a mistake and need to back‐track and, more importantly, when you need to merge into another branch.

13 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

With subversion you can't really do this without having your own local repository in addion to the central one. This gets messy.

Stephen Darlington on April 6, 2008 6:32 AM

Great tutorial !

could you do the same tutorial for installing and configuring on windows...

Jacques PYRAT on April 6, 2008 6:32 AM

What does that get us? Some kind of web UI? Use of port 80?

Many organisaons don't allow to open any ports except for the standard 80, 443, etc. And screw web UI, we've got Trac for that :)

Alex on April 6, 2008 6:35 AM

@Nicholas Wright: If you *want* it centralized, SVN is the best you can find. There are other dozen open source SCM so ware but they're all distributed.

Nicolas on April 6, 2008 6:38 AM

@John Fiala: "svn export" is what you need.

Nicolas on April 6, 2008 6:39 AM

hp://www.visualsvn.com/server/ ‐ simple setup for svn + apache and it's sweet

Damian on April 6, 2008 6:43 AM

@Ilici: use exclusive locks, *or* find a tool that would merge them correctly.

Nicolas on April 6, 2008 6:43 AM

We've used Subversion for nearly four years and are on the whole very happy with it (~16 developers, plus QA, plus other groups using it for non‐ files). The biggest limitaon we've hit is the rather poor tooling related to merges, though it seems svn 1.5 will have considerable improvements here.

14 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

We found seng up the repository to use Apache as the server indispensable to permit browsing of checked in files. We don't use this as much for source code as for other documents (specs, certain test data, etc.). It makes for easy integraon to wiki pages, for example, and also makes it easy to for people to "check out" (peruse) specific directories/files (e.g. spreadsheets, Word docs) without _checking them out_. If the repository purely serviced development needs we likely wouldn't leverage this as much, though I've found it useful to quickly look at code in branches/tagged versions that I don't have acve in my workspace.

Most of our development is in Java and we make use of the Subclipse Eclipse plug‐in, though I personally just prefer to handle svn tasks outside the IDE. We also have used Ankh for our VStudio/C++ work and it seemed to work reasonably well.

Although we don't have a distributed development team, an advantage I can imagine to distributed version control, where needed, is actual revision support locally. If I were doing substanve development work without more or less constant access to the repository I would want something more than the file system and the IDE's "local history" feature for revision control. This is a key difference I see between just "working offline" and having revision control support locally. Linus pitches this as one of the chief requirements a distributed revision control system is meant to address.

Clearly the needs of a large and largely uncontrolled distributed project are quite different than the needs of tradionally managed teams ("uncontrolled" in the sense that anyone can join and start nkering, even if official versions go back through some approval process). Linus claims that unl he used BitKeeper he didn't even believe that revision control was necessary or useful, which I find quite revealing either about how he likes to work or the type of work he's done or both.

Jeremy on April 6, 2008 6:44 AM

I always thought that "SYSTEM" is the *most* powerful account...

Mantas on April 6, 2008 6:44 AM

I agree, hp://svn1clicksetup.gris.org/ is a great way to get started with SVN.

Alternaves for a Windows subversion‐server: * hp://www.assembla.com/ Web hosted workspace with SVN, wiki (TRAC), chat, and much more (free for personal use) * hp://buildix.thoughtworks.com/ Live‐cd or ubuntu‐install with SVN, project management, Cruise Control for connuous integraon and TRAC as a wiki and bug‐tracker

As clients I recommend TortoiseSVN or the well done subclipse plugin for Eclipse (hp://subclipse.gris.org/).

Seng up SVN in Apache is more complicated, What does that get us? Some kind of web UI? Use of port 80?

15 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Yes, with the apache integraon you are able to browse your repository with a web interface. FishEye (hp://www..com/so ware/fisheye/) is another great (but commercial) web UI for CVS and SVN. TRAC (as menoned above) also has a integrated repository browser.

Florian Potschka on April 6, 2008 6:44 AM

A lot of Svn users are moving to Git. I haven't tried it myself, but I thought I'd menon it, since this is the first blog posng I've read in a long me promong the old hotness ;‐)

awh on April 6, 2008 6:45 AM

by the way, is it just me or does your CAPTCHA always display the word "orange"?

Mantas on April 6, 2008 6:46 AM

Jeff, I agree with you about distributed source control that it is not easy to see the difference with centralized source control. I tried Mercurial for some me and had the same issues.

Actually, this if o en a misunderstanding of what a source control system is. I think all programmers will agree with me that source control system allows: ‐ to work on a common source code ; ‐ to keep an history of the changes ; ‐ to back up your work.

The order I choose is intenonnal, this is the way people understand source control. First I can share with others, then I save history, and then I feel safe because my code base lives in a secured server.

With distributed source control, the goal is primarily to keep an history of the changes. Sharing the code is secondary. Backing it up is not even a feature.

The trick is that history is not the source control feature that is the most used. Just compare the number of update/commits on the last revision with the number of updates on older revision. Mainly, working with a source control is just updang on the morning and comming before leaving. Browsing through history is not a daily acvity.

That is why it is so confusing to switch to distributed source control. With distributed source control, history is the main thing. They considered this feature so important that they allow you to browse your history while being offline. You can share with others later.

There is some advantage to that. First, this is much harder to break the build. You don't have to push untested code or quick and dirty fix "just to save them" because you can save the history locally, do all the tesng another day, and finally merge the whole history back with others.

Merge are easier too. With SubVersion, when a conflict occurs, you MUST resolve it before comming

16 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

your changes. But you may not understand the conflict and you really really don't have me to fix that right now. Because distributed source control keeps a whole repository locally, merging is not mandatory when a conflict occurs. You can keep the two versions and choose to resolve the conflict later. Or even ask the programmer that introduced the conflict to fix it.

That being said, I do think that all these so ware got the problem wrong. What I really want is my computer to keep an history of all the change I do, silently, without having to choose whenever I need an history point.

SubVersion or Mercurial both think that I am smart enough to know when I need to save my changes. They are wrong. I am dumb, an idiot. When I write a funcon, deletes it, quit my editor, and then want my funcon back, I am an idiot. An idiot in need of a really smart so ware to keep track of my all my changes.

(Sorry for the long post and any english mistakes.)

Vincent on April 6, 2008 6:48 AM

Well just in me.. I very recently adopted Subversion for our project. It was just the right choice for our team size(about 3 :)).. Even though the way it manages some aspect of source control differenlty, it was sure very easy to install and work with in Windows. The way in which it shows the status of files in windows explorer through icon overlay is a nice liel useful feature.

Manoj on April 6, 2008 6:48 AM

I also use VisualSVN Server. It's free and lets you set up a repository that's slightly different than what described here.

1) It uses Apache on Windows, and automacally creates an SSL (self‐signed) cerficate for you, so you can run it over HTTPS. (By doing it the way described in this arcle, you have no encrypon ‐‐ everything is out in the open) 2) It stores the password in hashes, not plaintext, by using the Apache htpasswd authencaon mechanisms. 3) It uses SVN authz files, which allow you have _granular_ control over a user's permissions for each directory inside each repository. And it provides the ability to control this in the GUI.

It has a great graphical interface, too. It's an MMC snapin, so it really makes it feel like it's a honest‐ to‐goodness Windows service.

And did I menon that it's free? :)

maman206 on April 6, 2008 6:51 AM

Subversion is a great ulity and surprisingly simple as well on Unix/Linux. Highly recommended!

17 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Cheers.

Patrick on April 6, 2008 6:52 AM

"If a "checkin" occurs on your local machine, and nobody else in the world knows about it.. did it really happen?"

Well, that's the point. You can hack your feature locally, even use git to transfer between different machines, and the upstream does only need to know your complete feature patch, not the history to there.

Conversely it is also useful to review the history when offline. Granted, truly offline places are geng scarce.

And I indeed don't want every developer to wrap its head around distributed version control right now. Fortunately the git people seemingly are integrang a CVS server so you can offer boths models at the same me.

Andreas Krey on April 6, 2008 6:55 AM

Bro ‐ all this echo and no menon of Visual SVN server?

hp://www.visualsvn.com/server/

Ma on April 6, 2008 6:58 AM

Great ming Jeff thank you very much. Our so ware project (final year uni) is underway and our supervisor asked if we needed any tools installed on our drive. I brought up Subversion. The rest of my team have no idea what source control is. I have never used source control before, although I've done some reading. I figure it's a good me to get pracsing with real life tools for when we finally graduate and enter the work force.

Source control has not been menoned or taught in any of our classes, or even recommended in our project assignment. It's thanks to reading this blog many arcles ago I leart of the greatness of SC.

Cheers again.

`Josh on April 6, 2008 7:14 AM

For all Eclipse users try this plugin: Subclipse I've been using TortoiseSVN, too, but Subclispe integrates seamlessly into the IDE, which is prey nice.

hp://subclipse.gris.org/

18 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

jan.g on April 6, 2008 7:26 AM

Ruby on Rails Moving Source Repository to Git: hp://blog.wired.com/monkeybites/2008/04/ruby‐on‐rails‐m.html

Hseyin Tfekilerli on April 6, 2008 7:26 AM

Another fan of PushOK here ‐ I've used Ankh before that and seen VisualSvn, and IMHO the PushOK so ware really beats them because of the MSSCCI integraon. In English, that means you can check in a new project and not worry that it is also going to check in the dll's and pdb's and so on.

The only thing that I've noced that PushOK will do (on a mul‐file check‐in on a mul‐project soluon) is commit each project to a separate revision number. If you check in using Tortoise from the soluon root, you get it all in one revision number.

PushOk also supply a piece of so ware to monitor file changes if e.g. you use Tortoise to update files. It is designed to fix the mismatch between MS Locked‐check‐out development and SVN's unlocked, everyone checks‐out files (then potenal merges on commit). It is a lile flaky, however... but this has proven an issue with Ankh and VisualSvn too.

Nij

Nij on April 6, 2008 7:33 AM

Jeff, there's an easier way to get SVN running and it gives you an integrated Trac instance as a bonus: download the free Trac/SVN JumpBox here‐ hp://www.jumpbox.com/app/trac

It sets up in under a minute. You can use it without registering. And the other benefit is it's a self‐contained, portable arfact that you can leave behind with a client when you finish a project.

sean

Sean Tierney on April 6, 2008 7:35 AM

I just wanted to menon that those spaces a er the equal signs in the sc command for creang the Windows service are REQUIRED. Kind of a weird looking command, if you ask me; guess it has to do with how it parses input from the command line.

I remember I wasted a good 20 minutes on that one the first me I was installing Subversion a few years ago.

Nicholas Piasecki on April 6, 2008 7:36 AM

19 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

I've used subversion for years ‐ I have the server on a linux box running behind apache. Advantages of running behind Apache?

1) As another said, it's easy to set up permissions per‐repository, or to have mulple access groups for a reposiory. For me this isn't the main reason (though of course I do serve the svn repos password protected over ssh) for using Apache.

2) This is my main reason ‐ I can access my repositories from any computer with web access, so reduces dramacally any need to carry files around on a key drive.

Anthony Roy on April 6, 2008 7:42 AM

Don't install crap into the system drive root.

fudge on April 6, 2008 7:54 AM

"If a "checkin" occurs on your local machine, and nobody else in the world knows about it.. did it really happen?"

From what I got from Linus's video, there's a lot more to the "offline in an airplane" scenario. You can have for example, a local feature being tested for two weeks in your own lile test bed/tesng department, then when its ready, merge it to the "main" repository. You'll be able to say, we have this feature and we have been tweaking (local comming) and tesng it solidly for two weeks, etc etc. There's some more distributed SCM advantages explained there, such as having the test department having their own repository, expanding your trust sphere when merging by reducing your trusted merge vectors (linux kernel dev talk), merging is more importanng than branching, etc. Provocave ideas.

I doubt the human factor, but it sounds very technically encing.

Linus's intense hatred towards centralized SCM (and not specifically Subversion, I hope) is In My Opinion (IMO), the view that it is slowing the so ware development process progress.

promong the old hotness ;‐)

Yeah, Subversion is the old "black" for me, ever since the 1.0.x days. Very dependable. Backups are totally easy (svnadmin dump repository onefile and you are done) and easy to understand. Also TortoiseSVN really is a great visual client. I always set up my Windows based SVN servers via Apache 2.x, because typing svn:// in emails just gets weird looks. I don't know how to install those fancy HTML interfaces, though. Seems I'll need to check out my opons again.

I'm moving towards git, myself. I have a number of personal projects on it. The recent news that Ruby on Rails is moving to git from Subversion, as well as git public mirror repositories of GNU projects is also encouraging. The unofficial windows port, msysgit is usable if you like the command‐line. Plus it comes with git‐svn, a tool that bridges the gap between a Subversion server and git client, so you don't have to change your server infrastructure (?) right away.

20 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Groking merging history is sll difficult for me. Luckily there are some visual tools. For example (javascript required): hp://repo.or.cz/git‐browser/by‐commit.html?r=git.git

Sll, git feels a lile wobbly on the Windows plaorm (core.autocrlf :‐( ), so I'm keeping my Subversion around for a lile while longer.

piyo on April 6, 2008 7:57 AM

Another advantage of using Apache is that you can configure it to use Windows Authencaon (or LDAP), rather than maintaining separate user name and password lists.

Kevin Dente on April 6, 2008 7:58 AM

VisualSVN is worth the money, sits on top of tortoise so you have source control in and out of the IDE.

There is also a free VisualSVN server for windows which will setup SVN w/Apache and provide a GUI management tool. It also handles using windows/acve directory accounts for logins.

Michael C. Neel on April 6, 2008 8:07 AM

WHAT?! Recommending starng with Subversion, in 2008?! WHAT WHAT WHAT?!!!

Even for my extremely simple needs (no merging or spling, just a straight line of modificaons), Git has been vastly easier than SVN. It is much beer at handling deleted and new files, and it is much beer at realizing when files have been renamed or moved, even when they've also been modified greatly. SVN whimpers and cries from these things.

If you've only used CVS/SVN all your life, maybe scking with it could be a good idea (for now). But if you're just starng out, it would be wiser IMO to go with something more modern. Why take on outdated baggage if you don't have too?

James Jusn Harrell on April 6, 2008 8:12 AM

A few comments:

* You set up the standard svnserve daemon. This is great for just your machine, but should not be used for mulple users. I use svnserve for my projects at home, but I prefer to use either svn+ssh or hp under Apache. Of course, this makes it much more difficult to setup under Windows since Windows does not include ssh (and all clients need it) and Apache can be tricky to setup under Windows. This is one place where both Mac and Linux beats Windows. Linux and the Mac comes standard with Apache, ssh, and Subversion. Nothing to download. Nothing to install.

21 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

* Many sites put branching under their project instead of the root of the server. This just makes more sense, and it is something that is menoned in the official Subversion book. For example: svn://svnserver /FooProj/trunk instead of svn://svnserver/trunk/FooProj.

* Developers really like the way Subversion branches because branches are visible and it is easy to compare one version from another. Perforce also uses the same method for branching. At first, I was very leery of that. In all of the other version control systems I used, branches were internal to the file. You checked out the file and specified the branch you want. However, developers (especially ones that never used version control) like the visible branching system beer.

* Tags (Labels) are a problems with Subversion because, as you menoned, someone could checkout a tag and make modificaons. I have a checkin hook that does some nice security funcons. It is similar to the one that comes with Subversion, but mine also allows you to create groups, make sure aributes are set on parcular files, and prevents people from messing up tags. You can create a tag, but you can't checkout the code off a tag and check it back in.

* One good thing about Tags and Subversion: Tags are not needed as they are on most version control systems. Subversion doesn't version files, it versions the enre source tree. Every checkin you do modifies the enre source tree. You talk about build 1238 which is the 1,238th revision of the source tree. That means you don't need to label every build. You only need to label releases.

* Seeing you set your editor to Notepad has made you lose a great deal of respect in my eyes. No developer should ever use Notepad for any purpose whatsoever. There are many excellent free line editors out there that don't munge your files.

* Why use Apache? Because Apache can be setup as secure, you can use Port 80 which is normally allowed through firewalls, and Apache has a beer security system than svnserve. I usually setup my Subversion server to use Apache. You can even use SSL cerficates (hps) which allows you to do work without seng up a VPN.

* I am not a fan of "Git" because it doesn't do several things I consider important in source control. It is popular because the Linux team uses it. However, the Linux team does things very differently from most development organizaons. What Git really allows is you to turn your checkout into another repository. For example, I do a checkout from the Git repository, then I can modify the code and do checkins and checkouts on my local machine. I can use branches, etc. When I am done, I check in my final changes back into the main Git repository. Even beer, I could actually allow other people to do checkins and checkouts from my repository. So, I can checkout from the main GIT repository, then setup a GIT server on my system and allow my team to use the GIT repository on my system. Once we are finished, I can check everything back into the main GIT repository. Very neat trick. You can use SVK which is a Subversion add on that does a similar trick.

* I recommend that you take a look at Perforce. It is a commercial source control system, but you can use it for free for personal projects since you're allowed two users and five clients. (Users can have mulple clients which are just views into the repository). It is easier to setup than Subversion on Windows, and comes with its own built in GUI. In fact, two GUIs. One is p4win which is a Windows only GUI. The other is p4v which is a standard GUI that works across all versions of Perforce (Unix, Linux, Mac, and Windows).

22 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

* Yes, there are many commercial systems out there, but the advantage of open source version control is quite simple: I don't have any licensing issues. I don't have to track who has what license, I don't need a license key, and I don't have to get some bureaucrat in accounng to approve a new license whenever our department gets another developer. Plus, it is easy to jusfy the "expense" when it costs the company nothing to use.

David W. on April 6, 2008 8:15 AM

We use Trac with our SVN server, so management occasionally uses the log for themselves and for generang acvity reports for clients. Since a few developers never seem to want to detail their changes, we use a pre‐commit hook to reject commits without comments. The hook requires grep.exe from the GnuWin32 project. Blog formang may make this look ugly, but just toss this into pre‐commit.bat in the "hooks" directory of your repository (edit paths accordingly):

@echo off rem Add path to Subversion executable set path=%path%;c:\Program Files\Subversion\bin

rem Add path to grep.exe set path=%path%;C:\Program Files\GnuWin32\bin

SVNLOOK.exe log ‐t "%2" "%1" | grep.exe "[a‐zA‐Z0‐9]" nul || exit 1

exit 0

Ralph on April 6, 2008 8:34 AM

To integrate SVN with Visual Studio, I use something like this, which is completely free: hp://garrys‐ brain.blogspot.com/2006/11/visual‐studio‐2005‐and‐tortoisesvn.html It actually integrates with TortoiseSVN, not SVN itself. But it works well enough for me.

For VS2003, which is what I use most, I set up a bunch of "External Tools" commands that point to TortoiseSvn. I have one for "Diff", "Log", "Update", Commit", and probably others. Then I just add them to the toolbar. You can even add the matching TortoiseSVN icons to the buons if you want.

In a nutshell, no need to buy anything to integreate SVN into Visual Studio ‐ it's super easy.

Joe on April 6, 2008 8:46 AM

You should try mercurial one day.

X on April 6, 2008 8:48 AM

23 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

+1 on visualSVN, it absolutely rocks. Not having your SCC available inside the IDE , is like having custard cremes without the custard.

Aside #1 ‐ there is a fully integrated installer for Apache+SVN on the VisualSVN site.

Aside #2 ‐ I've got a 500GB Synology NAS box, with the SVN client installed on it, its perfect, requires no PC and just sits on your network serving away. Ideal for small teams that want a self contained SCC box. I detail the SVN setup on my blog, here

hp://runtothehills.org/rob/archives/25

although i did that well over a year ago, so the NAS box firmware may have changed (though i'm sll geng comments that everything is ok.) Cheers! Rob

Rob on April 6, 2008 8:51 AM

For source control on my personal project (as in, I'm the only one who accesses the repository), I've found Git to blow SVN away (for my purposes). The main reason, is because it is distributed, I don't have to set up a repository on my local machine. I love how easy branching is. But like I said, this is only my experience ‐ I have no idea how SCMs or DSCMs scale up.

Bernard on April 6, 2008 9:00 AM

Just to reiterate the previous comment, *please* correct the blog post, as Local System is effecvely root == can do anything locally. Local *Service* (yes, the names are unfortunately very similar) is a very restricted account.

hp://msdn2.microso .com/en‐us/library/ms677973(VS.85).aspx

One advantage of running under the LocalSystem account is that the service has complete unrestricted access to local resources. This is also the disadvantage of LocalSystem because a LocalSystem service can do things that would bring down the enre system.

hp://msdn2.microso .com/en‐us/library/ms684188(VS.85).aspx

[LocalService] has minimum privileges on the local computer and presents anonymous credenals on the network.

James Manning on April 6, 2008 9:10 AM

SVK ( hp://svk.bestpraccal.com) is a good free ulity for SVN for distributed teams or individuals. Allows individuals or branch offices to host their own mirror of the SVN repository. Works really well for

24 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

branch offices because it really reduces the bandwidth used for otherwise redundant bits transfered by mulple users. Also provides a built‐in distributed backup. :)

Allan N on April 6, 2008 9:13 AM

Does anyone know of a svn plugin (like ankh) that works in sql server 2005 (or 2008)? I have heard that ankh works in the bi tools but I'm specifically hoping to find something that works in the sql server management studio.

Tim Costello on April 6, 2008 9:34 AM

@Tim

I second the recommendaon for VisualSVN. I couldn't even get Ankh to work, but have been using VisualSVN for months and am very happy with it. Plus it leverages Tortoise so you don't have to learn a completely new UI for the same things.

Craig K. on April 6, 2008 9:36 AM

"I'm skepcal. I've met precious few developers that really understood the versioning concepts in the simple centralized source control model."

That speaks a lot to the kind of people you choose to work with. The concept of working with someone who doesn't understand an appreciate distributed version control systems is just... wow. (And I'm not an old grey‐beard or MIT Ph. D, I'm a kid a couple years out of a Java School)

Bre on April 6, 2008 9:39 AM

@craig Are you using VisualSVN in SQL (Management Studio) or in Visual Studio?

Tim Costello on April 6, 2008 9:42 AM

I've been using Subversion for a couple of years on an ASP.NET 2.0 project. I do not host the server myself, however, although it is easy to do. I use www.cvsdude.com (I am not affiliated with this company) and it is awesome. I'm automacally backed up off‐site and I can manage user permissions, modules, etc. through a nice web interface. There's also a nice web view of all of the repositories for doing diffs, history, etc. I'll gladly pay a monthly fee to avoid any potenal headaches with running my own server...

Robert on April 6, 2008 9:50 AM

25 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Has Git support for windows/Cygwin improved any? I've considered trying it for personal projects since everyone has had so many good things to say about it's branch/merge/tracking model.

But since I sll work in windows land and afaik Git support for it is sll crap, I've been looking more towards Mercurial for my DVCS needs, though I haven't started on a new project recently so haven't properly implemented one on my systems "properly" yet, though hg is on my laptop waing for use ;).

Patrick Sulliva on April 6, 2008 9:57 AM

For poeople who want a place to put some personal code I can recommend assembla.com. They allow 500MB of free subversion hosng, which is the most I have seen of any free svn hosng service. They also have a Trac integraon which is nice.

Torkel on April 6, 2008 10:22 AM

I (and my team) switched from CVS to SVN about three years ago. Now I'm considering switching to either git or Mercurial. Anybody just starng to use SVN now is well behind the curve.

The cool thing about a distributed code control system is that it has all the capabilies of a centralized system, PLUS the ability to do commits and branches and history without talking to the server. Sure, projects like the Linux kernel depend on it since they're inherently decentralized, but even centralized projects can benefit from being able to work without contacng the server.

Of course, I'm strongly in the "commit each conceptual change" school of thought, rather than the "commit each day's work" school of thought. It's important to me to see the steps along the way, and to be able to undo those steps individually. I use the commit history constantly, as well as the annotate/blame facility.

Also, Subversion's merge capabilies are painful to work with, while git and mercurial are designed to make merging easy. It's great that Subversion made branching easy, but it's nearly useless when merging a branch back to the trunk is such a pain. And even reverng a change is more painful in Subversion than it really should be.

Jeff, you may be interested in these links:

A guy who'd earlier explained why a href="hp://ww2.samhart.com/node/47"all distributed version control systems suck/a switches from Subversion to Mercurial: hp://ww2.samhart.com/node/49

Happenings in the version control system world (cvs, svn, mercurial/hg, bzr, git, as of March 1 2008): hp://blogs.gnome.org/newren/2008/03/01/happenings‐in‐the‐vcs‐world/

rfunk on April 6, 2008 10:38 AM

A er working with subversion for awhile now, I understand exactly why Linus has that opinion... I've

26 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

come to the conclusion that subversion may somemes be worse than no source control.

Brian Knoblauch on April 6, 2008 10:42 AM

I set up Subversion on Windows 2003 about a year ago. I also had a Fedora VM (in VMWare Server) running Subversion on the same machine. I tested both from a client computer running Tortoise. The Fedora version ran faster. It was disgusng how much slower SVN was on Windows compared to Linux. Small commits were about the same speed, but large checkouts and updates were much slower on Windows. Another developer ended up discovering the same thing in his tesng.

I don't know if this is an intrinsic problem with Windows (doubt it), or a problem with the SVN binaries for Windows (prolly). We ended up running SVN out of a VM.

There are two remote backup strategies that can be used with this scenario (that we considered). First, one can simply back up the enre VM to the remote backup device. The second strategy is to use NFS or an SMB share in the VM to backup just the SVN repository directories in the VM to the remote backup device. The nice thing about the first method is that it is very easy to stand‐up an SVN server when an emergency strikes, or just to stand up a backup when needed. VMs are so easy to use anymore, and VMWare Server is free. You can even download a very light‐weight Linux/Subversion "appliance" VM image from VMWare. Some food for thought when seng up SVN.

Oh, and I loved using Subversion. I have used VSS (oh my god), Vault and CVS, and Subversion is beer than all of them. I am back in CVS land now, which is also a very good repository.

Joe on April 6, 2008 11:00 AM

Subversion is a great tool. If a server setup is what you are looking for then running it atop a linux box will do higher jusce. For windows there's Virtual SVN for server setup hp://www.visualsvn.com /download.html

OpenSource Rocks!

Ajo Paul on April 6, 2008 11:09 AM

Thank for the great post. Its a great help!!! Love the blog.

VX

VelkyMX on April 6, 2008 11:20 AM

SVN really screwed up tags. They should be mnemonics for revisions, like they were in CVS, or like the magic revision name "HEAD" is. So instead of:

svn diff ‐‐summarize $REPO/tags/some_random_tag $REPO/trunk

27 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

You could do:

svn diff ‐‐summarize ‐r some_random_tag $REPO/trunk

It appear a small difference, but it is conceptually much cleaner. You also wouldn't be able to accidentally tag just part of trunk, which is possible now with the copy cop‐out.

Meh.

Rich on April 6, 2008 11:27 AM

I forgot to menon a big reason I'm considering switching from Subversion to a distributed system. O en one of us will embark on a set of changes that will break things unl done and tested. The right way to do this would be to start a branch, but as I menoned before, merging is painful in Subversion. It's certainly scary enough that the rest of my team doesn't want to touch it.

So one of two things happens: either they go ahead and commit as they go, breaking things for everyone else, or they don't commit anything unl they're finished, so there's no history of what they're doing.

With a distributed system, branching and merging would be trivially easy, and everyone could make their private changes locally, then push up to the shared server when they think everything is good. And no history is lost.

rfunk on April 6, 2008 11:29 AM

With respect, this seems years too late. ;) hp://svn1clicksetup.gris.org/ solved this in September of 2005. Not to menon VisualSVN Server.

Sco Hanselman on April 6, 2008 11:30 AM

I've actually spoken with SVN developer Brian Fitzpatrick, and he said that SVN will indeed be geng distributed features similar to “the Mercurial model.”

Learning DRCSs is easy and as simple as watching a few Google Tech Talks (Google being a SVN user themselves with Google Code):

hp://humani.st/learning‐distributed‐revision‐control‐systems/

Distributed revision control is simple. It's just a repository of non‐distributed repositories. "Push" and "pull" are essenally the only two new commands to merge between repositories. Everything else is the same as SVN (of course this is a wild simplificaon).

Luke Hoersten on April 6, 2008 11:39 AM

28 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

For those interested, my reasons for using git are (though I usually use it with git‐svn with the main repository in SVN): ‐ everyone has the full history of the project always. ‐ This makes searching for the cause of a regression and some other things easy even when offline. ‐ Especially for OpenSource projects it also means it is near impossible to loose your history (there are thousands of backups). ‐ I can have branches with hacks that are not suitable to be published and the merging with new features from the main branch usually works quite well. ‐ Even though I have the full history, it uses less disk space and is faster than SVN (having to do manual compacon occasionally is a bit annoying though) ‐ For reading it works just fine over plain hp without anything special (so I only need ordinary web space to publish it), and wring works well via ssh. So all you need for a fully funconal, public repository is web space and a shell account ‐ something e.g. every student, at least around here, has.

Reimar on April 6, 2008 11:55 AM

thanks! man really interesng and educang arcle.

trial blazer on April 6, 2008 12:05 PM

I use Subversion and have done so for the past three years. I have taken a look at GIT, but since I'm spoiled with TortoiseSVN I haven't really seen any reason to switch.

GIT is much more advanced, and branching/merging in SVN is clearly not what the thing was built for.

But in a case of "worse is beer", I sck with SVN. It does everything I need and I can easily convince myself that I don't need anything it doesn't supply.

tcliu on April 6, 2008 12:17 PM

I am glad that there are many individual developers who download Git and say "it works great for me". The first job of any source control tool should be to make sure that no source ever gets lost, and secondly, that you have the tools you need to go back and figure out what the hell you broke.

However, like I said above, the second stage of source control is when you start using the tools to interact with other developers, and, if you're, err... lucky?, non‐developers. Git seems to work quite well for the anarcho‐meritocracy of open source development. No need to worry about angry "Core Team" developers withholding commit access here!

Now, a more tradional development environment though, I'm really thinking Git lacks the "management" features of other tools. Of course it does, that's the whole point!

ALex on April 6, 2008 12:33 PM

29 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

I don't think it's possible to have a context‐free debate about source control: it's very dependent on what plaorm/languages/tools you are using, the development environment, the development process (if there is one) etc.

I haven't used AccuRev ( hp://www.accurev.com/webinars/20061004_scm_accurev45.html) in producon, but it looks like it rocks to me.

Now I just need to persuade management to fork out the bucks!

Ben on April 6, 2008 12:42 PM

VisualSVN + VisualSVN Server FTW. The server even lets you do Windows authencaon with the latest version.

John S. on April 6, 2008 12:45 PM

I think every developer that sets up a svn a few mes ends up wring the exact blog post you just did Jeff :) I know I did a few months back and there are dozens out there that read almost exactly like this one. Of course the only difference betweens yours and others is that you probably have a few more eyeballs on it and geng the source control word out there for every developer is key.

Personally I love svn and set it up on my Windows Home Server, which makes a great repository server. Couple that with how easy it is to integrate with all the CI servers out there and it's a winner.

Shawn Oster on April 6, 2008 1:00 PM

I have just given this a go I have been thinking about source control for a while but not got round to it as I am one of just 2 developers usually working on separate applicaons. However obviously the advantage is you make a mistake or need some old code back that you removed you have it.

I successfully setup this on my home computer my queson now is, if I install subversion at work and tortoiseSVN can I just copy the repository directory to work and use and update it. Then take it back home replacing the old one and repeat as I go.

I regularly take my work home and can't map a network drive or anything like that to share between the two. Alternavely is there somewhere on the net I could store it.

Thanks in advance.

pete on April 6, 2008 1:08 PM

Also I have several different folders in different locaons should I use a separate repository for each of these. For instance I have visual studio 2008, ms access apps, visual basic 6 apps, documents. Or is there

30 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

a beer way.

pete on April 6, 2008 1:12 PM

Yes, all that is great (I use Visual Svn Server to make the server installaon more palletable for the groups I consult for), but I have one queson:

What is the purpose of ascii‐RickRoll.txt?

Wait, I already saw the music video. Don't make me relive the 80s.

Chris Brandsma on April 6, 2008 1:14 PM

I have been using SVN happily for a long me. It's what CVS should have always been (revision number per file? WTF).

I sll don't see the point of distributed SCMs. I guess I will keep staying away from them unl I see the need. For now, they feel like a soluon for a problem I don't have (just like almost all C++ features *used* to be, to me).

Nicolas on April 6, 2008 1:26 PM

Heck, even branches looked to me like a disorganized way to work, unl one day I needed one, and I got enlightened :) Maybe some day the same will happen with distributed source control...

Nicolas on April 6, 2008 1:27 PM

Just read the arcle, and set up SVN+Tortoise for my future development works. Fantasc stuff. =)

A word of warning, though: Jeff, you might want to re‐check your link to the Tortoise site, since it's missing the last T. I woke up thinking slow (blonde‐girl‐slow, actually), and I refreshed like five mes before figuring out the domain was .net and not just .ne like it's posted. =p

Sll, cheers on the awesome work.

Fernando on April 6, 2008 1:28 PM

Is nobody going to comment on ascii‐rickroll.txt?

Mike on April 6, 2008 1:41 PM

Not wishing to be a nitpicker... but regarding "If you're an ASP.NET developer, you need to switch the

31 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

hidden folders from ".svn" to "_svn" format, which is on the General opons page."

That was only for *Visual Studio* 2003 and earlier: a href="hp://blog.dotsmart.net/2008/02 /19/moving‐on‐from‐svn_asp_dot_net_hack/"hp://blog.dotsmart.net/2008/02/19/moving‐on‐from‐ svn_asp_dot_net_hack//a

Duncan Smart on April 6, 2008 1:45 PM

"What is the difference between what you describe, and working tradionally offline, then checking in when you get back into the office?"

I think they call that change management. ;)

Generally it gives you more control. I tend to make checkins in a way so that I can apply single patches in the trunk or in some parcular branch. Try sorng out all those lile changes for several unrelated things ‐ which easily happen even on a short two day business trip ‐ when your back in the office and you'll understand.

Unwrien rule for me is one check in ‐ one change. This makes all those lile bugs I might have introduced much more traceable.

Vinzent Hoefler on April 6, 2008 1:47 PM

1) Tightly controlled development will remain the providence of centrally managed source control.

You can sll centrally manage source code with Git.

Quite. There's nothing stopping anyone from using Git just like Subversion. There's even a module for using it with Subversion repositories.

What Git buys you is more opons. That's the thing that got me so jazzed about it.

T.E.D. on April 7, 2008 2:09 AM

With respect, this seems years too late. ;) hp://svn1clicksetup.gris.org/ solved this in September of 2005.

I saw that, but then I saw the latest package was January 2007 ‐‐ so I assumed it was out of date. Is it normal not to have a release in 14 months?

Also, be sure to read Bill de hra's excellent response to this post:

hp://www.dehora.net/journal/2008/04/06/what‐a‐dvcs‐gets‐you‐maybe/

Jeff Atwood on April 7, 2008 2:10 AM

32 of 33 27/07/2011 12:30 Coding Horror: Setting up Subversion on Windows http://www.codinghorror.com/blog/2008/04/setting-up-subversion...

Source_Control = "YAWN"

Joe Beam on April 7, 2008 3:05 AM

Subversion is OK as a VCS, although I find it a bit clumsy in some areas.

The big problem with it is the clients ‐ I have never found a good one. The best is the Subclipse plugin for Eclipse, IMO, although I prefer a standalone client. Clients integrated into IDEs have a habit of being too helpful :‐)

TortoiseSVN is a PITA. It shows the wrong view. I can already see the files on my computer, thanks very much. What I need in a VCS client is the ability to see what's in the repository, what branch I'm in, file history etc at the same me as seeing what I've changed on my machine (which is the least important view in some ways). The only way to get that sort of thing in TortoiseSVN is painful and clunky.

Unless something is checked in, it doesn't exist in the project. The repository is where you build release versions from, where your connuous integraon gets its code, and so on. So management of that is key. I want to see what's happening to it, and with TortoiseSVN, that's too difficult and too poorly done.

Jim Cooper on April 7, 2008 3:50 AM

a href="hp://blogs.vergoso ware.com/teamsystem/archive/2006/01 /16/Seng_up_a_Subversion_Server_under_Windows.aspx"hp://blogs.vergoso ware.com /teamsystem/archive/2006/01/16/Seng_up_a_Subversion_Server_under_Windows.aspx/a

copyer on April 7, 2008 4:11 AM

I use RapidSVN as a client, up to now the best (as I don't only develop in one ide and don't like tortoise's funny icons)

Regards

Jorge Diaz Tambley on April 7, 2008 4:12 AM

More comments» Post a comment

To comment, please sign in using TypePad, Twier, Facebook or OpenID.

Content (c) 2011 Jeff Atwood . Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved.

33 of 33 27/07/2011 12:30