1GIT-CHECK-IGNORE(1)               Git Manual               GIT-CHECK-IGNORE(1)
2
3
4

NAME

6       git-check-ignore - Debug gitignore / exclude files
7

SYNOPSIS

9       git check-ignore [options] pathname...
10       git check-ignore [options] --stdin < <list-of-paths>
11
12

DESCRIPTION

14       For each pathname given via the command-line or from a file via
15       --stdin, show the pattern from .gitignore (or other input files to the
16       exclude mechanism) that decides if the pathname is excluded or
17       included. Later patterns within a file take precedence over earlier
18       ones.
19

OPTIONS

21       -q, --quiet
22           Don’t output anything, just set exit status. This is only valid
23           with a single pathname.
24
25       -v, --verbose
26           Also output details about the matching pattern (if any) for each
27           given pathname.
28
29       --stdin
30           Read file names from stdin instead of from the command-line.
31
32       -z
33           The output format is modified to be machine-parseable (see below).
34           If --stdin is also given, input paths are separated with a NUL
35           character instead of a linefeed character.
36

OUTPUT

38       By default, any of the given pathnames which match an ignore pattern
39       will be output, one per line. If no pattern matches a given path,
40       nothing will be output for that path; this means that path will not be
41       ignored.
42
43       If --verbose is specified, the output is a series of lines of the form:
44
45       <source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname>
46
47       <pathname> is the path of a file being queried, <pattern> is the
48       matching pattern, <source> is the pattern’s source file, and <linenum>
49       is the line number of the pattern within that source. If the pattern
50       contained a ! prefix or / suffix, it will be preserved in the output.
51       <source> will be an absolute path when referring to the file configured
52       by core.excludesfile, or relative to the repository root when referring
53       to .git/info/exclude or a per-directory exclude file.
54
55       If -z is specified, the pathnames in the output are delimited by the
56       null character; if --verbose is also specified then null characters are
57       also used instead of colons and hard tabs:
58
59       <source> <NULL> <linenum> <NULL> <pattern> <NULL> <pathname> <NULL>
60

EXIT STATUS

62       0
63           One or more of the provided paths is ignored.
64
65       1
66           None of the provided paths are ignored.
67
68       128
69           A fatal error was encountered.
70

SEE ALSO

72       gitignore(5) gitconfig(5) git-ls-files(5)
73

GIT

75       Part of the git(1) suite
76
77
78
79Git 1.8.3.1                       11/19/2018               GIT-CHECK-IGNORE(1)
Impressum