Mercurial on Windows Tip: Global Ignore File

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 Comment so far

  1. Alex Tran on May 20th, 2010

    Aha! Just what I was looking for! Thanks!

Leave a Reply