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 an untracked file, ``file.c``, at |
36 For example, say we have an 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 |
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, |