Writing code without using version control is the equivalent of swinging on a trapeze without a net. Sure, if you execute each move flawlessly, you’ll be fine. But, one wrong move and you’ll fall to your death. Okay, coding mistakes rarely lead to injury or death–of the programmer anyway–but I think you see my point.

There are loads of version control systems out there. Subversion, however, is the weapon of choice for most people working with Ruby on Rails. If you are unfamiliar with Subversion, the Subversion book is a good place to start (print version available on Amazon). The first part of this book gives a good overview of what version control is all about, so those totally unfamiliar with the concept can jump right in.

As for Ruby on Rails applications, they can just be checked into version control like anything else. But, there some files and directories that don’t really need to be under version control. There is an easy, step-by-step guide on using Subversion with Rails at the Rails wiki. Following these instructions takes less than five minutes and will keep your repository free of extraneous files (e.g. log and temp files).

With your Rails application under version control, you can rest easy knowing that you have some recourse when your latest code update breaks everything. Just don’t forget to commit your changes on a regular basis or this is all for naught. Also, remember that the Rails generator scripts accept an --svn option which will automatically add generated files to your repository. This will save you the step of adding these files manually later on.

In addition to giving you a sort of coder’s safety net, using Subversion gives you the ability to automate application deployment with Capistrano if you wish. So, now you have two excellent reasons to get your application into Subversion. By the way, if you are looking for a place to store your repository, check out CVSDude. They offer several monthly plans, including a free one.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.