Since I started using Mercurial a few months ago I’ve fallen in love with it. There was a bit of a learning curve for getting up and running but I found that the Tortoise tools are really intuitive and eliminated some of the pain. Most importantly though, Mercurial addresses the single biggest problem I had when working away from home – no repository access.
So far (and I still have a lot to learn so this isn’t necessarily saying much) I’ve really only found one annoyance – there’s no default .hgignore file. For the uninitiated, the .hgignore file contains a list of file name patterns that identify the files that should not be tracked in the repository. Since there’s no default file we need to create (or copy) one for each new repository.
Visual Studio creates a slew of files that shouldn’t be tracked and I know that on the vast majority of my projects I’m going to at least start with the same set of ignore patterns. For the most part I’ll be able to just copy the file from another repository but for future reference I’m including the contents of my current file here.
syntax: glob *.suo *.obj *.pdb *.user *.vspscc *.bak *.cache *.log *.lib [Bb]in [Dd]ebug*/ obj/ [Rr]elease*/ [Tt]est[Rr]esult* [Bb]uild[Ll]og.* *.[Pp]ublish.xml [Bb]uild[Pp]rocess[Tt]emplates/* Published/* [Tt]humbs.db [Uu]pgrade[Ll]og*.[Xx][Mm][Ll] _[Uu]pgradeReport_Files*/ *.build.csdef [Pp]ackage/* aspnetdb_log.ldf *[Vv]isual[Ss]tate.[Xx][Mm][Ll]
I cobbled this together from a variety of sources including my memory and a few sites. There are also some random tweaks for good measure. Most of these entries are pretty standard. The only item I’ll really call out is the last one which is created by NUnit for a test project.
This basic file has been serving me pretty well so far but my home environment is pretty simple. If anyone has any suggestions for modifications to this list I’d love to hear them.