A .hgignore
file in each subrepo would serve as the specialized one for that subrepo. Then you can use the main repo's .hgignore
as the main one by including this in each subrepo's hgrc
file:
[ui]
ignore.main = \absolute\path\to\mainrepo\.hgignore
The reason why doing ignore = .hgignore
didn't work for you in your global .hgrc
(and won't in repo hgrc
) is that having simply .hgignore
is a relative file path and its resolution to an absolute path depends on the current working directory used when invoking hg
. Examples:
- If you're in
\repos\main\
and invoke hg st
, it will look for \repos\main\.hgignore
. Same thing if you invoke hg st -R nested
, because the current working directory is still the same.
- But if you were in
\repos\main\nested\
and then invoked hg st
, the config would now be looking at \repos\main\nested\.hgignore
.
If you want to specify a global .hgignore
that is in your home directory, you would need to specify it with a non-relative path (or at least much less relative):
[ui]
ignore = ~\.hgignore