Cocoa Geek


Version Control Systems

Posted in General Development by andrew on the June 7th, 2008

There seems to be alot of talk in the dev community of Version Control Systems (VCS) at the moment. Since this seems to be quite a fashionable thing to talk about at the moment i figured i would give it a go.

Why do we need VCS’s?

A VCS is a piece of software that allows the management and revisions of data and files. This can be any kind of information by typically text files are the easiest to manage and the differences between versions can be more easily tracked.

In the case of developers these are great tools that we can use to control revisions of projects. Small teams and solo developers can benefit from being able to more cohesively control current source in a centralized location and being able to test experimental code with our worrying about ruining already functioning code.

Trunks of code can typically be produced, in other words when version 1.0 is released a new trunk for 1.1 can be started still allowing you to patch the old code for as long as you need. Most importantly this can also provide a great way to back-up each point in the code as you go along, typically just from a simple command in the terminal.

VCS’s for the mac?

Subversion

The most commonly seen VNC, and the one that comes as a default install with the Developer Tools is Subversion. Subversion has been around for a long time and was initially built to supersede CVS. It has a huge feature set and is run from in the terminal with the ’svn’ command. There are loads of great resources out there for learning Subversion (http://svnbook.red-bean.com) but basically there is one master copy of the source called the repository.

With regards to controlling and accessing this repository there is support with svn itself through the terminal - however if you prefer a graphical approach there is some support in xCode itself. Personally i don’t think xCode is very good at controlling your source management options. Luckily there are some third party apps out there to do this for you.

SvnX is a great tool for accessing and updating your repository it also allows multiple “check outs” and keeps a log of all your working copies. Its very easy to use and also quite well documented. Earlier this week the open beta for Versions came out. This looks a stunning piece of software for use with subversion making the whole process of working locally with the source code easy - although it looks like it will only be in open beta until july!.

Bazaar

If you have checked out any of my source code you will notice that i’m not using subversion on this site. i’m using Bazaar. Bazaar is a VCS built entirely in python. This is a relative upstart in the world of VCS’s however was developed in association with the Ubuntu project in order to allow easy update of packages.

Although not installed by default on OS X the install process is relatively straight forward. Bazaar doesn’t use a repository type system, instead this is what is know as a distributed system where there are multipe branches of a your source code which Bazaar will later merge if required. As far as i know at the moment there are no GUI’s for it either - so although its easier to set up and manage initially for someone who wants a GUI Subversion may be the better option. Whatever you decide to use VCS’s are important - even to the solo developer having the ability to drop back to the code or database you were using last week is priceless. Try them out and let me know what you think!

Leave a Reply