30
30
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
31
31
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
35
The Mercurial system uses a file called \fB.hgignore\fP in the root
35
The Mercurial system uses a file called \fC.hgignore\fP in the root
36
36
directory of a repository to control its behavior when it searches
37
37
for files that it is not currently tracking.
40
40
The working directory of a Mercurial repository will often contain
41
41
files that should not be tracked by Mercurial. These include backup
42
42
files created by editors and build products created by compilers.
43
These files can be ignored by listing them in a \fB.hgignore\fP file in
44
the root of the working directory. The \fB.hgignore\fP file must be
43
These files can be ignored by listing them in a \fC.hgignore\fP file in
44
the root of the working directory. The \fC.hgignore\fP file must be
45
45
created manually. It is typically put under version control, so that
46
46
the settings will propagate to other repositories with push and pull.
48
48
An untracked file is ignored if its path relative to the repository
49
49
root directory, or any prefix path of that path, is matched against
50
any pattern in \fB.hgignore\fP.
50
any pattern in \fC.hgignore\fP.
52
For example, say we have an untracked file, \fBfile.c\fP, at
53
\fBa/b/file.c\fP inside our repository. Mercurial will ignore \fBfile.c\fP
54
if any pattern in \fB.hgignore\fP matches \fBa/b/file.c\fP, \fBa/b\fP or \fBa\fP.
52
For example, say we have an untracked file, \fCfile.c\fP, at
53
\fCa/b/file.c\fP inside our repository. Mercurial will ignore \fCfile.c\fP
54
if any pattern in \fC.hgignore\fP matches \fCa/b/file.c\fP, \fCa/b\fP or \fCa\fP.
56
56
In addition, a Mercurial configuration file can reference a set of
57
per\-user or global ignore files. See the \%\fBhgrc\fP(5)\: man page for details
57
per\-user or global ignore files. See the \fI\%\fBhgrc\fP(5)\fP man page for details
58
58
of how to configure these files. Look for the "ignore" entry in the
61
61
To control Mercurial\(aqs handling of files that it manages, see the
62
\%\fBhg\fP(1)\: man page. Look for the \fB\-I\fP and \fB\-X\fP options.
62
\fI\%\fBhg\fP(1)\fP man page. Look for the \fC\-I\fP and \fC\-X\fP options.
65
65
An ignore file is a plain text file consisting of a list of patterns,
66
with one pattern per line. Empty lines are skipped. The \fB#\fP
67
character is treated as a comment character, and the \fB\e\fP character
66
with one pattern per line. Empty lines are skipped. The \fC#\fP
67
character is treated as a comment character, and the \fC\e\fP character
68
68
is treated as an escape character.
70
70
Mercurial supports several pattern syntaxes. The default syntax used
94
94
follow, until another syntax is selected.
96
96
Neither glob nor regexp patterns are rooted. A glob\-syntax pattern of
97
the form \fB*.c\fP will match a file ending in \fB.c\fP in any directory,
98
and a regexp pattern of the form \fB\e.c$\fP will do the same. To root a
99
regexp pattern, start it with \fB^\fP.
97
the form \fC*.c\fP will match a file ending in \fC.c\fP in any directory,
98
and a regexp pattern of the form \fC\e.c$\fP will do the same. To root a
99
regexp pattern, start it with \fC^\fP.
102
102
Here is an example ignore file.
120
Vadim Gelfer <\%vadim.gelfer@gmail.com\:>
122
Mercurial was written by Matt Mackall <\%mpm@selenic.com\:>.
125
\%\fBhg\fP(1)\:, \%\fBhgrc\fP(5)\:
120
Vadim Gelfer <\fI\%vadim.gelfer@gmail.com\fP>
122
Mercurial was written by Matt Mackall <\fI\%mpm@selenic.com\fP>.
125
\fI\%\fBhg\fP(1)\fP, \fI\%\fBhgrc\fP(5)\fP
128
128
This manual page is copyright 2006 Vadim Gelfer.
129
129
Mercurial is copyright 2005\-2010 Matt Mackall.