PrimitiveType

Version contol with SVN

As I have always worked as a one-man team, I have never felt the need to use version control software. However, I have recently started working with other programmers and have had to take on their company practices, which includes using the version control software Subversion, or SVN (homepage: http://subversion.tigris.org/).

SVN aims to take over the user base of the popular version control system, Concurrent Versions System, or CVS. The idea is that the code for a project is stored in a central repository and SVN keeps track of changes to it such that it can retrieve the state of the code at any version along its development path. Developers can "checkout" the code, which means they download it to their system, and make changes which they can then "commit", or upload back into the repository. If a mistake is made, the developer can revert files to earlier states.

SVN is flexible enough to allow two or more developers to work on the same file at the same time. If, when the developers attempt to commit their changes, a conflict is detected, it forces the developers to fix this before they can commit.

In SVN (and other systems) the main body of code that is under constant development is called the trunk. The trunk can be tagged at any moment to create a labeled snapshot of the code at that point. A tag can be used to mark a stable release for deployment of the code (eg. version 1.0 of the application). The code may also be branched away from the trunk, to work on experimental features, for example.

I have been learning to use SVN from the command line via an SSH session. As with many command line programs, the SVN client and its options can be cumbersome to learn at first, but I have found that the interface is intuitive enough not to have to keep consulting a manual.

The company I work with have installed a browser-based system called Trac (homepage: http://trac.edgewall.org/) to help them with their project management. A nice feature of Trac is that it integrates with SVN and can be used to browse the source of a project online.

So far I have enjoyed the experience of working with SVN and will probably use it for my own projects from now on too. The peace of mind in being able to revert to earlier working versions of an application is very comforting, and SVN facilitates making backups and deploying to different locations too. The extra work involved in installing the software, setting up a project and learning the commands is worth those benefits. SVN can be used to store and version other documents too, including images and media files.

There is a good SVN book (published by O'Reilly) available for free on the internet, and a print copy is available from Amazon.