Geeks With Blogs
Robert Bernstein's Blog Adventures in Windows, .NET, and C++

This took me a little bit to figure out, so hopefully this will save someone else some work.

Your mercurial configuration file should be named "mercurial.ini" and should live in %userprofile%, e.g. C:\Users\Rob\mercurial.ini.

You may name your global ignore file anything you want, e.g. hgignore.ini, and place it anywhere you like.  I prefer to keep it with my mercurial.ini file, so it also lives in %userprofile%, e.g. C:\Users\Rob\mercurial.ini.

Then you place a line in your mercurial.ini file that points to your ignore file:

[ui]
username = Rob
ignore = ~/hgignore.ini
merge = bcomp

[extensions]
extdiff =
 
[extdiff]
cmd.bcomp = C:\Program Files (x86)\Beyond Compare 3\BComp.exe
opts.bcomp = /ro
 
[tortoisehg]
vdiff = bcomp

[merge-tools]
bcomp.executable = C:\Program Files (x86)\Beyond Compare 3\BComp.exe
bcomp.args = $local $other $base $output
bcomp.priority = 1
bcomp.premerge = True
bcomp.gui = True

The "~/" specifies your home directory.  Note that even though it uses the "/", this works fine on Windows.

Here's an example hgignore file that I borrowed.  See the links incorporated in it for the sources.  Note that I have commented out a few entries, i.e. using "#", for items that I like to check into Mercurial, e.g. *.exe and *.pdb.

# Ignore file for Visual Studio
# http://blogs.planetcloud.co.uk/mygreatdiscovery/post/Mercurial-ignore-file.aspx
# http://stackoverflow.com/questions/34784/mercurial-setup-for-visual-studio-2008-projects

# use glob syntax
syntax: glob

# Ignore Visual Studio files
*.obj
#*.exe
#*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vshost.*
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.tlog
*.idb
*.sdf
*.opensdf
*.embed.*
*.intermediate.*
*.lastbuildstate
*_manifest.rc
*.ipch
*.lib
*.sbr
*.scc
#[Bb]in
#[Dd]ebug*/
obj/
#[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml

Good luck!

Rob

Posted on Friday, July 16, 2010 10:46 AM Mercurial | Back to top


Comments on this post: Mercurial (Hg) Global Ignore File on Windows

# re: Mercurial (Hg) Global Ignore File on Windows
Requesting Gravatar...
Thank you.

This was worked for me.
Left by Kishor on Nov 19, 2011 5:08 PM

# re: Mercurial (Hg) Global Ignore File on Windows
Requesting Gravatar...
Thanks very much - great help.
Left by Dave Irving on Oct 26, 2012 6:46 AM

# re: Mercurial (Hg) Global Ignore File on Windows
Requesting Gravatar...
Thank you for sharing!
Left by diryboy on Feb 09, 2014 12:56 AM

# re: Mercurial (Hg) Global Ignore File on Windows
Requesting Gravatar...
Thank you for your valuable information. I think this is really a great help for all Windows users who have no much awareness about this function. So you have done a great thing. I appreciate you for what you have done! hotels catalina island
Left by Paul on Sep 28, 2015 12:04 AM

# re: Mercurial (Hg) Global Ignore File on Windows
Requesting Gravatar...
Could you please take out those "<span class="skimlinks-unlinked">" items inside your code blocks?
Left by HTML Parsing Error on Feb 22, 2016 5:27 AM

Your comment:
 (will show your gravatar)


Copyright © Rob | Powered by: GeeksWithBlogs.net