##// END OF EJS Templates
hgignore.5.txt: improved description of matching...
Henri Wiechers -
r9127:35c3f942 default
parent child Browse files
Show More
@@ -1,92 +1,98 b''
1 HGIGNORE(5)
1 HGIGNORE(5)
2 ===========
2 ===========
3 Vadim Gelfer <vadim.gelfer@gmail.com>
3 Vadim Gelfer <vadim.gelfer@gmail.com>
4 :man source: Mercurial
4 :man source: Mercurial
5 :man manual: Mercurial Manual
5 :man manual: Mercurial Manual
6
6
7 NAME
7 NAME
8 ----
8 ----
9 hgignore - syntax for Mercurial ignore files
9 hgignore - syntax for Mercurial ignore files
10
10
11 SYNOPSIS
11 SYNOPSIS
12 --------
12 --------
13
13
14 The Mercurial system uses a file called `.hgignore` in the root
14 The Mercurial system uses a file called `.hgignore` in the root
15 directory of a repository to control its behavior when it finds files
15 directory of a repository to control its behavior when it searches
16 that it is not currently managing.
16 for files that it is not currently tracking.
17
17
18 DESCRIPTION
18 DESCRIPTION
19 -----------
19 -----------
20
20
21 Mercurial ignores every unmanaged file that matches any pattern in an
21 An untracked file is ignored if its path relative to the repository
22 ignore file. The patterns in an ignore file do not apply to files
22 root directory, or any prefix path of that path, is matched against
23 managed by Mercurial. To control Mercurial's handling of files that it
23 any pattern in `.hgignore`.
24 manages, see the hg(1) man page. Look for the "-I" and "-X" options.
25
24
26 In addition, a Mercurial configuration file can point to a set of
25 For example, say we have an an untracked file, `file.c`, at
26 `a/b/file.c` inside our repository. Mercurial will ignore `file.c` if
27 any pattern in `.hgignore` matches `a/b/file.c`, `a/b` or `a`.
28
29 In addition, a Mercurial configuration file can reference a set of
27 per-user or global ignore files. See the hgrc(5) man page for details
30 per-user or global ignore files. See the hgrc(5) man page for details
28 of how to configure these files. Look for the "ignore" entry in the
31 of how to configure these files. Look for the "ignore" entry in the
29 "ui" section.
32 "ui" section.
30
33
34 To control Mercurial's handling of files that it manages, see the
35 hg(1) man page. Look for the "-I" and "-X" options.
36
31 SYNTAX
37 SYNTAX
32 ------
38 ------
33
39
34 An ignore file is a plain text file consisting of a list of patterns,
40 An ignore file is a plain text file consisting of a list of patterns,
35 with one pattern per line. Empty lines are skipped. The "`#`"
41 with one pattern per line. Empty lines are skipped. The "`#`"
36 character is treated as a comment character, and the "`\`" character
42 character is treated as a comment character, and the "`\`" character
37 is treated as an escape character.
43 is treated as an escape character.
38
44
39 Mercurial supports several pattern syntaxes. The default syntax used
45 Mercurial supports several pattern syntaxes. The default syntax used
40 is Python/Perl-style regular expressions.
46 is Python/Perl-style regular expressions.
41
47
42 To change the syntax used, use a line of the following form:
48 To change the syntax used, use a line of the following form:
43
49
44 syntax: NAME
50 syntax: NAME
45
51
46 where NAME is one of the following:
52 where NAME is one of the following:
47
53
48 regexp::
54 regexp::
49 Regular expression, Python/Perl syntax.
55 Regular expression, Python/Perl syntax.
50 glob::
56 glob::
51 Shell-style glob.
57 Shell-style glob.
52
58
53 The chosen syntax stays in effect when parsing all patterns that
59 The chosen syntax stays in effect when parsing all patterns that
54 follow, until another syntax is selected.
60 follow, until another syntax is selected.
55
61
56 Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
62 Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
57 the form "`*.c`" will match a file ending in "`.c`" in any directory,
63 the form "`*.c`" will match a file ending in "`.c`" in any directory,
58 and a regexp pattern of the form "`\.c$`" will do the same. To root a
64 and a regexp pattern of the form "`\.c$`" will do the same. To root a
59 regexp pattern, start it with "`^`".
65 regexp pattern, start it with "`^`".
60
66
61 EXAMPLE
67 EXAMPLE
62 -------
68 -------
63
69
64 Here is an example ignore file.
70 Here is an example ignore file.
65
71
66 # use glob syntax.
72 # use glob syntax.
67 syntax: glob
73 syntax: glob
68
74
69 *.elc
75 *.elc
70 *.pyc
76 *.pyc
71 *~
77 *~
72
78
73 # switch to regexp syntax.
79 # switch to regexp syntax.
74 syntax: regexp
80 syntax: regexp
75 ^\.pc/
81 ^\.pc/
76
82
77 AUTHOR
83 AUTHOR
78 ------
84 ------
79 Vadim Gelfer <vadim.gelfer@gmail.com>
85 Vadim Gelfer <vadim.gelfer@gmail.com>
80
86
81 Mercurial was written by Matt Mackall <mpm@selenic.com>.
87 Mercurial was written by Matt Mackall <mpm@selenic.com>.
82
88
83 SEE ALSO
89 SEE ALSO
84 --------
90 --------
85 hg(1), hgrc(5)
91 hg(1), hgrc(5)
86
92
87 COPYING
93 COPYING
88 -------
94 -------
89 This manual page is copyright 2006 Vadim Gelfer.
95 This manual page is copyright 2006 Vadim Gelfer.
90 Mercurial is copyright 2005-2009 Matt Mackall.
96 Mercurial is copyright 2005-2009 Matt Mackall.
91 Free use of this software is granted under the terms of the GNU General
97 Free use of this software is granted under the terms of the GNU General
92 Public License (GPL).
98 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now