Why Use Subversion? Two Reasons: Revert and Branches

I’ve seen a few posts and blog comments were people were reluctant to implement some kind of version control primarily because they develop by themselves and didn’t see any value.

Two things I use in Subversion that makes my development easier are Branches and the Revert command.

So the last few days I’ve been messing around with some CFDocument stuff as well as doing a lot of experimental jQuery work.

Revert
According to the SVN documentation:

Reverts any local changes to a file or directory and resolves any conflicted states.

What’s neat with Subversion is I can open my print.cfm - and try out several cfdocument ideas - code them up - save them, try em out and if they don’t work - in CFEclipse (using the Subclipse plugin) I simply right-click on the file, click Team > Revert and my file is back to a known working state. No renaming or making a backup of the file before tinkering with it… no hitting CTRL+Z (undo) a million times. Back to square one with a few clicks. You may revert a single file or an entire directory.

Branches
With my jQuery code - I’m developing a HTML version of an existing PDF user manual. I’m using jQuery to build a fancy collapsible table of contents. I’m doing this in steps while I work through the book - post questions to the mailing list, etc. I don’t want to develop this in my main code - so I’ve created a ‘branch’ in Subversion - again from the SVN docs:

Branch - a line of development that exists independently of another line, yet still shares a common history if you look far enough back in time. A branch always begins life as a copy of something, and moves on from there, generating its own history.

So I’ve made a branch of the existing user manual code (my /manual directory) and I can develop and experiment on that ‘branch’ while keeping the existing PDF manual current in my main code base.

If my jQuery experiments work out - I will eventually merge my branched code into the working code base - or I can simple trash that branch and continue on using the PDF version. Again - no undoing, renaming, or major reorganization of my main code base is required.

So you can see - I’m doing all of this with my local development code - there is no team involved here - and I still see a benefit of using version control. If you are a solo developer - download it and start using it - I guarantee you will kick yourself for not trying it out sooner.

2 Comments

  1. Posted August 21, 2007 at 8:18 am | Permalink

    I couldn’t agree more, but let’s be clear that there is a learning curve. Be patient and take the time. You won’t be able to plug and play, but once you establish a certain level of proficiency you’ll never be able to go back.

    Subversion and source control in general make life *much* easier over time.

  2. Bence Vörösmarti
    Posted October 25, 2007 at 11:26 am | Permalink

    Once you start looking at logs and Diff old revisions with your working copy you start using all “single-user” functions of subversion.

    On a win32 based computer, using TortoiseSVN you can set up your own repository and manage it completely from GUI, and don’t even need to install Subversion and a server for it.

    There’s jut no excuse not to use it. Much better than keeping a million backups.

Creative Commons License

Copyright © 2007 thecrumb.com. All rights reserved.