Post Pic

Ignore redundant Umbraco package installation directories using Mercurial HG .ignore file

I’m collaborating on a project at the moment where I’m using a slightly different setup to my usual to see how I go with including the entire Umbraco installation in the repository, usually I just include any custom(ised) elements and use the post build to copy them into an Umbraco installation.

I am still taming the setup however Tom Fulton drew my attention to the fact I was committing the garbage that Umbraco fails to remove during the package installation process which are directories in the App_Data folder that have a guid for a name. Tom said he’d not yet worked out how to exclude them easily without explicitly ignoring each one and so not being one to turn down a challenge I thought I would beat him to it.

The solution it seems is quite simple, the .hgignore file also accepts a regex syntax so the simple addition of the following to your .hgignore file does the trick:

syntax: regexp

b[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}b

Umbraco Certified Developer
SagePay Approved Partner
Creative Market