comparison doc/hgignore.5.txt @ 9325:74e717a21779

Merge with mpm
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 06 Aug 2009 18:48:00 -0700
parents 0de7cf8db5fd
children 8bd669948b2e
comparison
equal deleted inserted replaced
9315:fb66a7d3f28f 9325:74e717a21779
1 HGIGNORE(5) 1 ==========
2 =========== 2 hgignore
3 Vadim Gelfer <vadim.gelfer@gmail.com> 3 ==========
4 :man source: Mercurial
5 :man manual: Mercurial Manual
6 4
7 NAME 5 ---------------------------------
8 ---- 6 syntax for Mercurial ignore files
9 hgignore - syntax for Mercurial ignore files 7 ---------------------------------
8
9 :Author: Vadim Gelfer <vadim.gelfer@gmail.com>
10 :Organization: Mercurial
11 :Manual section: 5
12 :Manual group: Mercurial Manual
10 13
11 SYNOPSIS 14 SYNOPSIS
12 -------- 15 --------
13 16
14 The Mercurial system uses a file called `.hgignore` in the root 17 The Mercurial system uses a file called ``.hgignore`` in the root
15 directory of a repository to control its behavior when it searches 18 directory of a repository to control its behavior when it searches
16 for files that it is not currently tracking. 19 for files that it is not currently tracking.
17 20
18 DESCRIPTION 21 DESCRIPTION
19 ----------- 22 -----------
20 23
21 The working directory of a Mercurial repository will often contain 24 The working directory of a Mercurial repository will often contain
22 files that should not be tracked by Mercurial. These include backup 25 files that should not be tracked by Mercurial. These include backup
23 files created by editors and build products created by compilers. 26 files created by editors and build products created by compilers.
24 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
25 the root of the working directory. The `.hgignore` file must be 28 the root of the working directory. The ``.hgignore`` file must be
26 created manually. It is typically put under version control, so that 29 created manually. It is typically put under version control, so that
27 the settings will propagate to other repositories with push and pull. 30 the settings will propagate to other repositories with push and pull.
28 31
29 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
30 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
31 any pattern in `.hgignore`. 34 any pattern in ``.hgignore``.
32 35
33 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
34 `a/b/file.c` inside our repository. Mercurial will ignore `file.c` if 37 ``a/b/file.c`` inside our repository. Mercurial will ignore ``file.c``
35 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``.
36 39
37 In addition, a Mercurial configuration file can reference a set of 40 In addition, a Mercurial configuration file can reference a set of
38 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
39 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
40 "ui" section. 43 "ui" section.
41 44
42 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
43 hg(1) man page. Look for the "-I" and "-X" options. 46 |hg(1)|_ man page. Look for the "``-I``" and "``-X``" options.
44 47
45 SYNTAX 48 SYNTAX
46 ------ 49 ------
47 50
48 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,
49 with one pattern per line. Empty lines are skipped. The "`#`" 52 with one pattern per line. Empty lines are skipped. The "``#``"
50 character is treated as a comment character, and the "`\`" character 53 character is treated as a comment character, and the "``\``" character
51 is treated as an escape character. 54 is treated as an escape character.
52 55
53 Mercurial supports several pattern syntaxes. The default syntax used 56 Mercurial supports several pattern syntaxes. The default syntax used
54 is Python/Perl-style regular expressions. 57 is Python/Perl-style regular expressions.
55 58
56 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::
57 60
58 syntax: NAME 61 syntax: NAME
59 62
60 where NAME is one of the following: 63 where ``NAME`` is one of the following:
61 64
62 regexp:: 65 ``regexp``
63 Regular expression, Python/Perl syntax. 66 Regular expression, Python/Perl syntax.
64 glob:: 67 ``glob``
65 Shell-style glob. 68 Shell-style glob.
66 69
67 The chosen syntax stays in effect when parsing all patterns that 70 The chosen syntax stays in effect when parsing all patterns that
68 follow, until another syntax is selected. 71 follow, until another syntax is selected.
69 72
70 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
71 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,
72 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
73 regexp pattern, start it with "`^`". 76 regexp pattern, start it with "``^``".
74 77
75 EXAMPLE 78 EXAMPLE
76 ------- 79 -------
77 80
78 Here is an example ignore file. 81 Here is an example ignore file. ::
79 82
80 # use glob syntax. 83 # use glob syntax.
81 syntax: glob 84 syntax: glob
82 85
83 *.elc 86 *.elc
94 97
95 Mercurial was written by Matt Mackall <mpm@selenic.com>. 98 Mercurial was written by Matt Mackall <mpm@selenic.com>.
96 99
97 SEE ALSO 100 SEE ALSO
98 -------- 101 --------
99 hg(1), hgrc(5) 102 |hg(1)|_, |hgrc(5)|_
100 103
101 COPYING 104 COPYING
102 ------- 105 -------
103 This manual page is copyright 2006 Vadim Gelfer. 106 This manual page is copyright 2006 Vadim Gelfer.
104 Mercurial is copyright 2005-2009 Matt Mackall. 107 Mercurial is copyright 2005-2009 Matt Mackall.
105 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
106 Public License (GPL). 109 Public License (GPL).
110
111 .. include:: common.txt