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