doc/hgignore.5.txt
author Martin Geisler <mg@lazybytes.net>
Thu, 16 Jul 2009 23:25:26 +0200
changeset 9158 d6eecafaf12f
parent 9127 35c3f94233a0
child 9161 e8b653a4b8da
permissions -rw-r--r--
doc: use reStructuredText for man and HTML pages The Makefile now requires the rst2html and rst2man programs. Both can be found in Debian testing or downloaded from the Docutils homepage: http://docutils.sf.net/ http://docutils.sf.net/sandbox/manpage-writer/ The new HTML and man pages no longer contain huge amounts of un-wrapping literal blocks, thanks to how snippets of reStructuredText can easily be included inside other reStructuredText documents. The HTML pages now have anchors for all sections, including the help topics in hgrc.1 which were missing from the old HTML pages.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     1
==========
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     2
 hgignore
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     3
==========
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     5
---------------------------------
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     6
syntax for Mercurial ignore files
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     7
---------------------------------
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     8
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
     9
:Author:         Vadim Gelfer <vadim.gelfer@gmail.com>
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    10
:Organization:   Mercurial
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    11
:Manual section: 5
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    12
:Manual group:   Mercurial Manual
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
SYNOPSIS
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
--------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    17
The Mercurial system uses a file called ``.hgignore`` in the root
9127
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    18
directory of a repository to control its behavior when it searches
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    19
for files that it is not currently tracking.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    21
DESCRIPTION
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
-----------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
9127
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    24
An untracked file is ignored if its path relative to the repository
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    25
root directory, or any prefix path of that path, is matched against
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    26
any pattern in `.hgignore`.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    27
9127
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    28
For example, say we have an an untracked file, `file.c`, at 
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    29
`a/b/file.c` inside our repository. Mercurial will ignore `file.c` if
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    30
any pattern in `.hgignore` matches `a/b/file.c`, `a/b` or `a`.
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    31
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    32
In addition, a Mercurial configuration file can reference a set of
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    33
per-user or global ignore files. See the hgrc(5) man page for details
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    34
of how to configure these files. Look for the "ignore" entry in the
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    35
"ui" section.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    36
9127
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    37
To control Mercurial's handling of files that it manages, see the
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    38
hg(1) man page. Look for the "-I" and "-X" options.
35c3f94233a0 hgignore.5.txt: improved description of matching
Henri Wiechers <hwiechers@gmail.com>
parents: 8782
diff changeset
    39
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    40
SYNTAX
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    41
------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    42
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    43
An ignore file is a plain text file consisting of a list of patterns,
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    44
with one pattern per line. Empty lines are skipped. The "``#``"
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    45
character is treated as a comment character, and the "``\``" character
8782
d19ab9a56bf4 doc: wrap man pages after fixing quoting
Martin Geisler <mg@lazybytes.net>
parents: 8780
diff changeset
    46
is treated as an escape character.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    47
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    48
Mercurial supports several pattern syntaxes. The default syntax used
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    49
is Python/Perl-style regular expressions.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    50
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    51
To change the syntax used, use a line of the following form::
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    52
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    53
  syntax: NAME
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    54
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    55
where ``NAME`` is one of the following:
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    56
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    57
``regexp``
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    58
  Regular expression, Python/Perl syntax.
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    59
``glob``
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    60
  Shell-style glob.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    61
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    62
The chosen syntax stays in effect when parsing all patterns that
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    63
follow, until another syntax is selected.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    64
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    65
Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    66
the form "``*.c``" will match a file ending in "``.c``" in any directory,
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    67
and a regexp pattern of the form "``\.c$``" will do the same. To root a
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    68
regexp pattern, start it with "``^``".
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    69
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    70
EXAMPLE
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    71
-------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    72
9158
d6eecafaf12f doc: use reStructuredText for man and HTML pages
Martin Geisler <mg@lazybytes.net>
parents: 9127
diff changeset
    73
Here is an example ignore file. ::
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    74
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    75
  # use glob syntax.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    76
  syntax: glob
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    77
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    78
  *.elc
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    79
  *.pyc
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    80
  *~
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    81
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    82
  # switch to regexp syntax.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    83
  syntax: regexp
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    84
  ^\.pc/
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    85
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    86
AUTHOR
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    87
------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    88
Vadim Gelfer <vadim.gelfer@gmail.com>
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    89
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    90
Mercurial was written by Matt Mackall <mpm@selenic.com>.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    91
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    92
SEE ALSO
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    93
--------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    94
hg(1), hgrc(5)
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    95
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    96
COPYING
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    97
-------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    98
This manual page is copyright 2006 Vadim Gelfer.
8771
a2871de50f50 man pages: updated copyright years
Martin Geisler <mg@lazybytes.net>
parents: 8766
diff changeset
    99
Mercurial is copyright 2005-2009 Matt Mackall.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   100
Free use of this software is granted under the terms of the GNU General
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   101
Public License (GPL).