prompt: fix show upstream with svn and zsh
[git.git] / Documentation / git-check-ignore.txt
blob854e4d0c425a9396bdb71dc84093f43156b04cd5
1 git-check-ignore(1)
2 ===================
4 NAME
5 ----
6 git-check-ignore - Debug gitignore / exclude files
9 SYNOPSIS
10 --------
11 [verse]
12 'git check-ignore' [options] pathname...
13 'git check-ignore' [options] --stdin < <list-of-paths>
15 DESCRIPTION
16 -----------
18 For each pathname given via the command-line or from a file via
19 `--stdin`, show the pattern from .gitignore (or other input files to
20 the exclude mechanism) that decides if the pathname is excluded or
21 included.  Later patterns within a file take precedence over earlier
22 ones.
24 OPTIONS
25 -------
26 -q, --quiet::
27         Don't output anything, just set exit status.  This is only
28         valid with a single pathname.
30 -v, --verbose::
31         Also output details about the matching pattern (if any)
32         for each given pathname.
34 --stdin::
35         Read file names from stdin instead of from the command-line.
37 -z::
38         The output format is modified to be machine-parseable (see
39         below).  If `--stdin` is also given, input paths are separated
40         with a NUL character instead of a linefeed character.
42 OUTPUT
43 ------
45 By default, any of the given pathnames which match an ignore pattern
46 will be output, one per line.  If no pattern matches a given path,
47 nothing will be output for that path; this means that path will not be
48 ignored.
50 If `--verbose` is specified, the output is a series of lines of the form:
52 <source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname>
54 <pathname> is the path of a file being queried, <pattern> is the
55 matching pattern, <source> is the pattern's source file, and <linenum>
56 is the line number of the pattern within that source.  If the pattern
57 contained a `!` prefix or `/` suffix, it will be preserved in the
58 output.  <source> will be an absolute path when referring to the file
59 configured by `core.excludesfile`, or relative to the repository root
60 when referring to `.git/info/exclude` or a per-directory exclude file.
62 If `-z` is specified, the pathnames in the output are delimited by the
63 null character; if `--verbose` is also specified then null characters
64 are also used instead of colons and hard tabs:
66 <source> <NULL> <linenum> <NULL> <pattern> <NULL> <pathname> <NULL>
69 EXIT STATUS
70 -----------
72 0::
73         One or more of the provided paths is ignored.
75 1::
76         None of the provided paths are ignored.
78 128::
79         A fatal error was encountered.
81 SEE ALSO
82 --------
83 linkgit:gitignore[5]
84 linkgit:gitconfig[5]
85 linkgit:git-ls-files[5]
87 GIT
88 ---
89 Part of the linkgit:git[1] suite