Version Control Rules

I was a non-believer in version control for a while. Then about two and a half years ago I took over a decent sized project (around 70,000 LOC) and knew I'd be in trouble without something to help me keep track of it all. So I started using CVS.

Nothing but good things to say. Yeah, CVS has some shortcomings (many of which are addressed in SubVersion), but version control in general is something no one should be without. It does the obvious things, of course, like letting you go back and look at any past version of a file. However, what I find really valuable is some of the codebase management stuff.

For example, say you've got a live version of your site, and you're working on a big update. However, you realize that there's a bug (or the client wants something tweaked) on the current site, and it can't wait until the new version. So you go fix it on the live site. The next step is to replicate the change in the new version. Not a big deal if it's adding an "s" to a word that wasn't pluralized, but if it's a bigger change spanning multiple files, it's a lot harder. However, if you've got your project in version control, it's a snap. You just merge the changes from the live branch to the development branch, and BAM! you're done.

A simpler case. Say you work on your workstation at the office, but you also do some work on the road with a laptop. Every time you switch computers, you need to make sure you have the most recent codebase in the right places. That can mean lots of file copies, and chances are good, some accidental overwrites. If you're using version control, you just check out the code onto both machines, and when you switch, hit "update", and you magically have the most recent version from the repository without any accidental overwrites, and any places where you might have had an overwrite occur is nicely marked for you to deal with.

Anyway, if you're not using some sort of version control, I'd highly recommend starting. I won't lie to you, there is a bit of a learning curve, but six months from now, you'll be thanking yourself for that little bit of pain and suffering, becuase your life will be so much easier.

2 responses to “Version Control Rules”

  1. Troy Murray

    I've never used CVS before, but after reading your blog posting I'm curious about it. Not sure which app I should look at though, CVS or SubVersion.

  2. Barney

    I've not used SubVersion much, but it definitely seems to be a superior product to CVS. That's to be expected since it's also much, much newer.

    However, it's still greatly lacking in the GUI client area. There are many GUI CVS clients to choose from, but SubVersion doesn't have much. That's changing, however, and at a pretty quick pace. Once there's some good GUIs, I'll be switching over for sure.