##// END OF EJS Templates
hgignore.5: expanded description...
Martin Geisler -
r9182:3a319bc8 default
parent child Browse files
Show More
@@ -1,98 +1,106 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 searches
15 directory of a repository to control its behavior when it searches
16 for files that it is not currently tracking.
16 for files that it is not currently tracking.
17
17
18 DESCRIPTION
18 DESCRIPTION
19 -----------
19 -----------
20
20
21 The working directory of a Mercurial repository will often contain
22 files that should not be tracked by Mercurial. These include backup
23 files created by editors and build products created by compilers.
24 These files can be ignored by listing them in a `.hgignore` file in
25 the root of the working directory. The `.hgignore` file must be
26 created manually. It is typically put under version control, so that
27 the settings will propagate to other repositories with push and pull.
28
21 An untracked file is ignored if its path relative to the repository
29 An untracked file is ignored if its path relative to the repository
22 root directory, or any prefix path of that path, is matched against
30 root directory, or any prefix path of that path, is matched against
23 any pattern in `.hgignore`.
31 any pattern in `.hgignore`.
24
32
25 For example, say we have an an untracked file, `file.c`, at
33 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
34 `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`.
35 any pattern in `.hgignore` matches `a/b/file.c`, `a/b` or `a`.
28
36
29 In addition, a Mercurial configuration file can reference a set of
37 In addition, a Mercurial configuration file can reference a set of
30 per-user or global ignore files. See the hgrc(5) man page for details
38 per-user or global ignore files. See the hgrc(5) man page for details
31 of how to configure these files. Look for the "ignore" entry in the
39 of how to configure these files. Look for the "ignore" entry in the
32 "ui" section.
40 "ui" section.
33
41
34 To control Mercurial's handling of files that it manages, see the
42 To control Mercurial's handling of files that it manages, see the
35 hg(1) man page. Look for the "-I" and "-X" options.
43 hg(1) man page. Look for the "-I" and "-X" options.
36
44
37 SYNTAX
45 SYNTAX
38 ------
46 ------
39
47
40 An ignore file is a plain text file consisting of a list of patterns,
48 An ignore file is a plain text file consisting of a list of patterns,
41 with one pattern per line. Empty lines are skipped. The "`#`"
49 with one pattern per line. Empty lines are skipped. The "`#`"
42 character is treated as a comment character, and the "`\`" character
50 character is treated as a comment character, and the "`\`" character
43 is treated as an escape character.
51 is treated as an escape character.
44
52
45 Mercurial supports several pattern syntaxes. The default syntax used
53 Mercurial supports several pattern syntaxes. The default syntax used
46 is Python/Perl-style regular expressions.
54 is Python/Perl-style regular expressions.
47
55
48 To change the syntax used, use a line of the following form:
56 To change the syntax used, use a line of the following form:
49
57
50 syntax: NAME
58 syntax: NAME
51
59
52 where NAME is one of the following:
60 where NAME is one of the following:
53
61
54 regexp::
62 regexp::
55 Regular expression, Python/Perl syntax.
63 Regular expression, Python/Perl syntax.
56 glob::
64 glob::
57 Shell-style glob.
65 Shell-style glob.
58
66
59 The chosen syntax stays in effect when parsing all patterns that
67 The chosen syntax stays in effect when parsing all patterns that
60 follow, until another syntax is selected.
68 follow, until another syntax is selected.
61
69
62 Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
70 Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
63 the form "`*.c`" will match a file ending in "`.c`" in any directory,
71 the form "`*.c`" will match a file ending in "`.c`" in any directory,
64 and a regexp pattern of the form "`\.c$`" will do the same. To root a
72 and a regexp pattern of the form "`\.c$`" will do the same. To root a
65 regexp pattern, start it with "`^`".
73 regexp pattern, start it with "`^`".
66
74
67 EXAMPLE
75 EXAMPLE
68 -------
76 -------
69
77
70 Here is an example ignore file.
78 Here is an example ignore file.
71
79
72 # use glob syntax.
80 # use glob syntax.
73 syntax: glob
81 syntax: glob
74
82
75 *.elc
83 *.elc
76 *.pyc
84 *.pyc
77 *~
85 *~
78
86
79 # switch to regexp syntax.
87 # switch to regexp syntax.
80 syntax: regexp
88 syntax: regexp
81 ^\.pc/
89 ^\.pc/
82
90
83 AUTHOR
91 AUTHOR
84 ------
92 ------
85 Vadim Gelfer <vadim.gelfer@gmail.com>
93 Vadim Gelfer <vadim.gelfer@gmail.com>
86
94
87 Mercurial was written by Matt Mackall <mpm@selenic.com>.
95 Mercurial was written by Matt Mackall <mpm@selenic.com>.
88
96
89 SEE ALSO
97 SEE ALSO
90 --------
98 --------
91 hg(1), hgrc(5)
99 hg(1), hgrc(5)
92
100
93 COPYING
101 COPYING
94 -------
102 -------
95 This manual page is copyright 2006 Vadim Gelfer.
103 This manual page is copyright 2006 Vadim Gelfer.
96 Mercurial is copyright 2005-2009 Matt Mackall.
104 Mercurial is copyright 2005-2009 Matt Mackall.
97 Free use of this software is granted under the terms of the GNU General
105 Free use of this software is granted under the terms of the GNU General
98 Public License (GPL).
106 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now