Hg in Control
If you have a set of files that you need to synchronize across multiple computers and you’d also like to be able to edit these files on the different computers then you have a problem. This problem is called the Version Control Problem. The problem isn’t just a matter of keeping the files on each machine in sync it’s also a matter of figuring out which copy of the file on each machine represents the latest copy as well as merging the different versions into a final “uptodate” file. Tools like SyncToy and Unison will only get you so far; they can provide two-way synchronization but that’s pretty much it.
A better solution is to use a real bonafide revision control system. Specifically the best RCS out there: Mercurial. Mercurial is a distributed revision control system — this is just a way of saying it super-rocks compared to a centralized RCS like Subversion — that provides a robust, easy-to-use solution to the version control problem.
If you have an Ubuntu box lying around take five minutes to install Mercurial on it. Next you’ll want to create a repository using the and “publish” it — that is make it available it to remote clients over the web. The easiest way to do this is to throw:
/etc/mercurial/hgrc. Beware this means anybody and everybody and Skeletor has write-access to your repo. Only do this if you’re working on a protected network. Or look into the secure alternative repository publishing strategies. Starting the server is as easy as:
$ hg serve --name "my-repo" -d -p 8001 --pid-file ../my-repo.pid
Stopping the server is just a matter of killing the process.
Once you’ve got your repository on the web the “hard” part is over. Grab a Mercurial client like TortoiseHg and clone the repo on wherever you like.
Of course if you’re not familiar with version control systems you’ll likely want to learn how to actually use Mercurial. You’re in luck because there’s plenty of great documentation out there. Check out:
- Hg Init: a Mercurial tutorial by Joel Spolsky
- Mercurial: The Definitive Guide
by Bryan O’Sullivan
- A tutorial on using Mercurial