Mercurial: Globally Ignore Files

mikeycgto picture mikeycgto · Jul 11, 2011 · Viewed 11k times · Source

I know about .hgignore and how I can ignore files on a project-by-project basis. I want to ignore stuff for all Mercurial repositories.

Is there something I can stick in .hgrc? Or put a .hgignore in my $HOME path (I tried that already but maybe I did something wrong).

Answer

Joel B Fant picture Joel B Fant · Jul 11, 2011

You can add a path to a global or per-user ignore file in the [ui] section of your global/user hgrc or Mercurial.ini:

[ui]
ignore = ~/.hgignore

On Windows:

[ui]
ignore = %USERPROFILE%\.hgignore