Friday, January 30, 2009

Versioning Project Files and Documents

Have you ever started a project, created something usable that you liked, only to lose it somehow? (I usually end up deleting the wrong files, or making irreversable changes to a file). During my days of professional work, I picked up some useful techniques for effectively versioning projects.

For many of us the phrase, "Save and save often" has been burned into our brains for years now. This is a useful technique, but does not help at all, if you accidentally save over a file. There are some ways to avoid this, or version things automatically (eg. Time Machine for OS X Leopard), but this really is not all that useful for versioning files so much as keeping backups.

If you're creating a website (works for any other type of project) and you develop it enough have a beta version, then that would be version 1. You could have backed up version 1 several times, but you still only have version 1. Now, you made a significant change to the design or functionality of it, so you want that to be beta version 2. Where do you store beta version 2? In it's own folder? FTP it to a random server?

The best way that I have used, and which seems to be an industry standard, is using Subversion (or SVN) to store and version your projects. Subversion itself is simply a type of server that allows you to store files and keep backups in a specific structure. A typical user will never interact with the server itself directly. There are plently of applications out there, both paid and free, that will allow you to interface with this server very easily.

You might ask, where is this server located? Well, there are plenty of places that offer SVN services. The first free one that comes to mind is Google Code Hosting. The main benefit, of course, is that it's free. Although, you have a limit of 10 projects that you can store at one time. You must also choose a license for your project, which sometimes is not a good thing if you don't want others to have access to it in any way.

There are a few paid services also, the one that seems to be most prevalent with the companies that I've worked with is BeanStalk, mostly due to its tight integration with 37Signals' other products like basecamp (for project/time management). Beanstalk has a free personal version, but this version is basically a joke (20 Mb storage space, and 1 project maximum). This isn't much of an option since even tiny projects will acrue more than 25 MB of space in a very short period of time.

The service that I use is actually a localized version. This is 100% free, and has 'theoretically' unlimited storage space and an unlimited amount of projects. The way this works, is you download a server (OSX has one built in - although this is a slightly older version of SVN than the most recent) that will run and can allow you to send (check in) projects to it to be versioned and download them back (check out). This will store the files directly on your hard drive in a specified archive space.

To actually manage these files that you are saving versions of, there are several applications out there. The first, and most widely used at the moment, is for PC users. It is called Tortoise SVN. Tortoise is really great if you use a PC; it has very tight integration with explorer, so you don't even notice its there unless you need to manage stored files. Tortoise is free and open source.

For Mac users, the best seems to be an app called Versions, created by a couple companies called Pico and Sofa. Versions is a very powerful application that has built in support for most SVN services, and allows you to create your own local SVN repositories through the interface. This makes it very easy to create versioned projects for anything you're doing. Versions retails for about $50, but for any Mac user it's well worth the relatively small investment.

Versioning is most often used in web development, coding, design, or simple animation. Typically video projects will not be versioned with SVN due to the file size that would be necessary to save so many versions. However, you can version the project files in certain applications that store video files seperately, which can be very useful. SVN is incredibly useful and should be use for every project that involves code, especially code that may be plain text.

For web programmers and designers, I have found that most editor that you can use for the code have very nice integration with SVN servers. Dreamweaver($400) has support for it (though not local support), Eclipse(free) has greate support, and the best that I've used is Coda($100). Coda has very tight integration with locally stored SVN files, and is also well worth the investment to get it running. It beats out dreamweaver by leaps and bounds, but it's for Mac users only.

If there are any other questions about how to get started using SVN, please leave a comment and I'll try to answer them.

No comments:

Post a Comment