Sunday, June 28, 2009

Dropbox as source code repository

I have just started to use Mercurial as my SCM on my latest project and so far it seems great. When you have a functioning unit of change you commit it to your development local (or remote) repository and when you have an entire feature ready you can push it to your "central" repository for testing. In theory repositories should not have half finished non-compiling work in them.

But often I move from my Desktop to my laptop in the middle of development while everything is still up in the air. I would also like a backup of my work in progress without having to commit to the repository. This is where Dropbox comes in.

Install Dropbox from www.getdropbox.com and it creates a folder that is always synchronised to the server as long as you are connected to the internet. It is free for up to 2GB of storage, private unless I choose to share files, and has simple revision control to revert back or download an older version from the web interface. Brilliant and simple.

I created a symbolic link from ~/Dropbox to my project folder and suddenly every time I save a file it is synchronised with the version on the server. I don't need to remember to commit small changes and always have the latest version when I change dev machines.

The best part is that I am no longer tempted to check in half backed code.