If you’re using TortoiseHg, (if you’re not, you should stop reading now to go install it), your default installation should put your Mercurial.ini file in your %userprofile% folder.
Make your [ui] section edits to point to a file (name is up to you):
[ui]
...
ignore = %userprofile%\.hgignore
...
Finally, make sure you have an .hgignore compatible file. This is what I’m using right now:
syntax: glob
*.o
*.lo
*.la
#*#
.*.rej
*.rej
.*~
*~
.#*
.DS_Store
*.suo
*.user
*.webinfo
[Bb]in
*/[Bb]in
[Oo]bj
*/[Oo]bj
*.[Bb][Aa][Kk]
*.~??
*[Tt][Mm][Pp]
_vti_txt
*/_vti_txt
_vti_script
*/_vti_script
_vti_pvt
*/_vti_pvt
_vti_cnf
*/_vti_cnf
_private
*/_private
.~*
*.~*
[Rr]elease
*/[Rr]elease
[Dd]ebug
*/[Dd]ebug
[Aa]nkh.[Ll]oad
*/_ReSharper*
_ReSharper*
*resharper*
*.Cache
*.StyleCop
*.ReSharper
obj/
bin/
*.ncb
*.suo
_ReSharper.*
*.resharper.user
#1 by Alex Tran on May 20, 2010 - 9:20 pm
Quote
Aha! Just what I was looking for! Thanks!
#2 by mo on January 10, 2011 - 2:55 pm
Quote
Isn’t this quite dangerous, though? It applies to all repositories you try and commit to using tortoise, so someone else might have added files that are meant to be version controlled, but actually match a pattern you use, then you’ll never see it in your commit dialog.
#3 by KIEUN MUN on January 24, 2011 - 10:37 pm
Quote
Wow, Thanks!
#4 by admin on January 29, 2011 - 9:46 am
Quote
@mo: True, it can be dangerous, but in my experience this filter properly excludes items that shouldn’t be committed in source code to begin with. For example, I don’t want to commit .NET files that are built, by default in a “bin” folder. This list is meant to help other Windows developers using Microsoft-based IDE’s.
Do you have a suggestion of an item to remove or problem with the current list?
#5 by Justin Stolle on March 30, 2011 - 4:35 am
Quote
Thanks for this list. I would also add [Tt]humbs.db
#6 by Nathan Bedford on August 22, 2011 - 2:41 pm
Quote
Wow…I was helping Nick (the new tech guy) get his global ignore set up, and did a Google search for “mercurial global ignore”. And this is the first site I found.
Pretty amazing.