Mercurial ignore file for Umbraco
Posted on 05 April 2012 by Pete Duncanson
Mercurial allows you to list which files you want it to ignore (the ones that should not be in source control). Here is the one we use for our Umbraco sites.
Update: We've now moved this to BitBucket so others can fork it/add to it/etc.
https://bitbucket.org/Offroadcode/mercurial-ignore-file-for-umbraco/overview
Or you can install it as a nuget package:
https://www.nuget.org/packages/HgIgnore.For.UmbracoCMS
/Update
I'm hoping to get this in to a source control site so others can add to it but for now here is the ignore file we use in house.
#
# Offroadcode's Mercurial Ignore file
# visit /blog/2012/4/5/mercurial-ignore-file-for-umbraco/ for updates/additions
# Thanks!
#
##### File globs to match ####
syntax: glob
# Data folders/files
*/ExamineIndexes/*
www/App_Data/umbraco.config
*/App_Browsers/*
*/App_Data/TEMP/*
*/_systemUmbracoIndexDontDelete/*
# Dll's and related C# crud
*/bin/Debug/*
*/obj/Debug/*
*/obj/*
*.pdb
*.user
*.DS_Store
# Resharpener
*_ReSharper*
# ImageGen
*/Cached/*
www/media/*/Cached/
# Misc crud
*.orig
*/Thumbs.db
*/log.txt
# For safety's sake
web.config
###### Regular Expression matches #####
syntax: regexp
# None yet!
Save the above into a file called ".hgignore" in the root of your project and HG will do the rest. Tip: you can't create files that begin with a leading dot via the UI, you will probably have to use the command line or a text editor.
We will add to this as we go a long but try to keep it generic. If you have any rules you like to add in please let us know via the comments and I'll update.
Currently it handles Resharper files (there are 100's of these!), data files which Umbraco generates and ImageGen Cache folders etc.
One that might surprise you is that we ignore the web.config file. We find it best to check this in as web.config.dev or web.config.live to avoid the wrong one ever going live. It does mean you have to remember to copy/rename the right one when you first check out (or have it in a build script if thats your bag) but better that then accidently goosing a live site!
Any thoughts or additions let me know.
blog comments powered by