As I said in an earlier post, version control seems to have moved forward a long way in a relatively short time and I feel like I’m lagging behind. In previous project I’ve worked on we’ve used Sourcesafe and TFS. Sourcesafe is now universally reviled – no real support for branching(!), it’s possible (well, really easy) to permanently delete files that actually makes rolling back to old versions impossible, an apparent limit of 5gb, and worse of all it occasionally decides to corrupt your files. It’s easy to find articles from as far back as the early 2000’s warning of the dangers of using Sourcesafe.
Having said all that, I’ve had far more problems using TFS than I ever experienced using Sourcesafe. Having thought I was making a big upgrade from Sourcesafe, it came as a real shock the first time I needed to roll a project back, and realised there apparently no way to do it. It’s hard not to lose faith in a system when you have to install extensions to perform what I’d consider one basic functionality. TFS also seems to be built on an incredibly confusing model – I still regularly finding myself getting the latest version of some code, then having to get the latest ‘specific’ version. I have no idea why.
Worst of all TFS is slow. Really, really slow. And trying to use it whilst you’re having network problems is a joke – you might as well shut your machine down and get a coffee – there’s no way any works getting done if you’re not connected.
So if I’m not using TFS (and I’m wouldn’t be even if it was the best option out there – it costs a fortune and it turns out all the better choices are free or close to free) what are the options? Developers I’ve worked with swear by Subversion and maybe a couple of years ago this was a valid choice. But everything now seems to have moved towards Distributed Version Control systems, and Subversion is stuck in the old model of having a single, central version of the code.
What does a distributed version control system give us? Basically it means that as a developer I have my own independent copy of the entire history of the project. It exists locally on my machine, and there’s no need to connect to a server whenever I want to do things like check-in changes or rollback to earlier versions of the code. In the old, non-distributed, model I had to code locally and (ideally) make sure my code was bug-free before inflicting it on the other developers. This meant it was often the correct decision to work locally for long periods of time – in other words you’re encouraged to code without using the benefits of source control.
Distributed systems mean you can check-in without fear of breaking other developer’s systems. Each time you reach a sensible point you can check-in your work into your local repository and it has zero impact on other developers. Once you’ve completed a piece of work you can push from your local repository to the central repository, and request that other users pull it down to their local repository.
The second obvious benefit to localised repositories is speed – because there’s no need to talk to a server (unless you’re pushing to or pulling from the central repository) everything happens locally. When the network goes down, or you decide to do a bit of coding on a plane, it has no impact of your ability to work and carry on using source control.
There seem to be two good choices for a distributed version control system – Git and Mercurial. I’ve installed a played around with both to get a feel for both of them, and honestly there doesn’t seem to be much to differentiate them. The general consensus seems to be that Git is marginally faster, but Mercurial has a more mature toolset especially if you’re using Windows and want to integrate with Visual Studio and an easier learning curve.
I’ve read a ton of articles comparing both systems and there doesn’t seem to be any clear consensus over which is superior. Git ‘feels’ more modern and has complete manual online for free (http://git-scm.com/book). It was easy to install tooling for both – tortoisehg for mercurial (http://tortoisehg.bitbucket.org/) and git extensions for git (http://code.google.com/p/gitextensions/). I’d tried Fogcreek’s flavour of Mercurial called Kiln (http://www.fogcreek.com/kiln/) which was pretty slick, and is free for startups, although probably quite pricey to add additional developers. It as pretty fantastic visualisation of branching (the wonderfully named ‘electrified dag’) and integrates nicely into Fogbugz, a bug-tracking system I’m fairly keen on using). Git is free for open-source projects, although as I want a private repository for this project I’ll have to fork out $7-a-month if I want to host from Github (https://github.com/).
In the end I’ve decided to go with Git. With source control up and running, it’s time to start building.





















































































































