.hgignore itself is version controlled. I've added some object dirs i want to ignore but i do not want to commit these changes to .hgignore. What do i do?
Asked
Active
Viewed 4,642 times
14
-
possible duplicate of [hg local ignore](http://stackoverflow.com/questions/996562/hg-local-ignore) – dimo414 Jun 10 '15 at 03:25
-
The title is really misleading. OP wants to _extend_ hgignore without putting the additional ignores into it. – Jürgen A. Erhard Nov 14 '22 at 02:13
2 Answers
15
Add the following to the repo's .hg/hgrc
:
[ui]
ignore = /path/to/repo/.hg/hgignore
and create a new file .hg/hgignore
beside it. This new file will be untracked, but work the same as the versioned .hgignore
file for this specific working copy. (The /path/to/repo
bit is unfortunate but necessary to make it work when invoking hg
from within a subdir of the repo.)
Source: Mercurial Tips and Tricks

Vadim Kotov
- 8,084
- 8
- 48
- 62

Zr40
- 1,910
- 18
- 20
9
Ironically enough, you can also just add
syntax:glob
.hgignore
To the .hgignore file itself.

Tim Keating
- 6,443
- 4
- 47
- 53
-
2if the rep is already tracking .hgignore you would need to forget it first – jk. Jun 14 '11 at 07:48