doc/hgignore.5.txt
author Martin Geisler <mg@lazybytes.net>
Tue, 09 Jun 2009 23:08:55 +0200
changeset 8766 b2059435f176
parent 8729 f67e5aac4e9e
child 8771 a2871de50f50
permissions -rw-r--r--
man pages: mark filenames and env vars as fixed text
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
HGIGNORE(5)
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
===========
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
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
     4
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
NAME
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
----
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     7
hgignore - syntax for Mercurial ignore files
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     8
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
SYNOPSIS
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    10
--------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
8766
b2059435f176 man pages: mark filenames and env vars as fixed text
Martin Geisler <mg@lazybytes.net>
parents: 8729
diff changeset
    12
The Mercurial system uses a file called `.hgignore` in the root
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
directory of a repository to control its behavior when it finds files
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
that it is not currently managing.
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
DESCRIPTION
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    17
-----------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    18
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    19
Mercurial ignores every unmanaged file that matches any pattern in an
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    20
ignore file. The patterns in an ignore file do not apply to files
8729
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    21
managed by Mercurial. To control Mercurial's handling of files that it
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    22
manages, see the hg(1) man page. Look for the "-I" and "-X" options.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    24
In addition, a Mercurial configuration file can point to a set of
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    25
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
    26
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
    27
"ui" section.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    29
SYNTAX
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    30
------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    31
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    32
An ignore file is a plain text file consisting of a list of patterns,
8729
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    33
with one pattern per line. Empty lines are skipped. The "#" character
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    34
is treated as a comment character, and the "\" character is treated as
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    35
an escape character.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    36
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    37
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
    38
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
    39
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    40
To change the syntax used, use a line of the following form:
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
syntax: NAME
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    43
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    44
where NAME is one of the following:
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    45
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    46
regexp::
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    47
  Regular expression, Python/Perl syntax.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    48
glob::
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    49
  Shell-style glob.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    50
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    51
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
    52
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
    53
6446
ee5313bc3c0c asciidoc: consistently use 1 space after full stop
Christian Ebert <blacktrash@gmx.net>
parents: 4635
diff changeset
    54
Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    55
the form "*.c" will match a file ending in ".c" in any directory, and
8729
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    56
a regexp pattern of the form "\.c$" will do the same. To root a regexp
f67e5aac4e9e hgignore.5: wrap lines at 70 chars (whitespace cleanup)
Martin Geisler <mg@lazybytes.net>
parents: 6490
diff changeset
    57
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
    58
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    59
EXAMPLE
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    60
-------
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
Here is an example ignore file.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    63
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    64
  # use glob syntax.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    65
  syntax: glob
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    66
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    67
  *.elc
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    68
  *.pyc
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
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    71
  # switch to regexp syntax.
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    72
  syntax: regexp
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    73
  ^\.pc/
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
AUTHOR
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    76
------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    77
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
    78
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    79
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
    80
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    81
SEE ALSO
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    82
--------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    83
hg(1), hgrc(5)
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    84
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    85
COPYING
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    86
-------
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    87
This manual page is copyright 2006 Vadim Gelfer.
4635
63b9d2deed48 Updated copyright notices and add "and others" to "hg version"
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2209
diff changeset
    88
Mercurial is copyright 2005-2007 Matt Mackall.
2209
956e329f9e13 document hgignore syntax in new file doc/hgignore.5.txt.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    89
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
    90
Public License (GPL).