logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-check-ignore.1 (5669B)


  1. '\" t
  2. .\" Title: git-check-ignore
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-CHECK\-IGNORE" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-check-ignore \- Debug gitignore / exclude files
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit check\-ignore\fR [<options>] <pathname>\&...\:
  36. \fIgit check\-ignore\fR [<options>] \-\-stdin
  37. .fi
  38. .SH "DESCRIPTION"
  39. .sp
  40. For each pathname given via the command\-line or from a file via \fB\-\-stdin\fR, check whether the file is excluded by \&.gitignore (or other input files to the exclude mechanism) and output the path if it is excluded\&.
  41. .sp
  42. By default, tracked files are not shown at all since they are not subject to exclude rules; but see \(lq\-\-no\-index\(rq\&.
  43. .SH "OPTIONS"
  44. .PP
  45. \-q, \-\-quiet
  46. .RS 4
  47. Don\(cqt output anything, just set exit status\&. This is only valid with a single pathname\&.
  48. .RE
  49. .PP
  50. \-v, \-\-verbose
  51. .RS 4
  52. Instead of printing the paths that are excluded, for each path that matches an exclude pattern, print the exclude pattern together with the path\&. (Matching an exclude pattern usually means the path is excluded, but if the pattern begins with "!" then it is a negated pattern and matching it means the path is NOT excluded\&.)
  53. .sp
  54. For precedence rules within and between exclude sources, see
  55. \fBgitignore\fR(5)\&.
  56. .RE
  57. .PP
  58. \-\-stdin
  59. .RS 4
  60. Read pathnames from the standard input, one per line, instead of from the command\-line\&.
  61. .RE
  62. .PP
  63. \-z
  64. .RS 4
  65. The output format is modified to be machine\-parsable (see below)\&. If
  66. \fB\-\-stdin\fR
  67. is also given, input paths are separated with a NUL character instead of a linefeed character\&.
  68. .RE
  69. .PP
  70. \-n, \-\-non\-matching
  71. .RS 4
  72. Show given paths which don\(cqt match any pattern\&. This only makes sense when
  73. \fB\-\-verbose\fR
  74. is enabled, otherwise it would not be possible to distinguish between paths which match a pattern and those which don\(cqt\&.
  75. .RE
  76. .PP
  77. \-\-no\-index
  78. .RS 4
  79. Don\(cqt look in the index when undertaking the checks\&. This can be used to debug why a path became tracked by e\&.g\&.
  80. \fBgit\fR
  81. \fBadd\fR
  82. \&. and was not ignored by the rules as expected by the user or when developing patterns including negation to match a path previously added with
  83. \fBgit\fR
  84. \fBadd\fR
  85. \fB\-f\fR\&.
  86. .RE
  87. .SH "OUTPUT"
  88. .sp
  89. By default, any of the given pathnames which match an ignore pattern will be output, one per line\&. If no pattern matches a given path, nothing will be output for that path; this means that path will not be ignored\&.
  90. .sp
  91. If \fB\-\-verbose\fR is specified, the output is a series of lines of the form:
  92. .sp
  93. <source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname>
  94. .sp
  95. <pathname> is the path of a file being queried, <pattern> is the matching pattern, <source> is the pattern\(cqs source file, and <linenum> is the line number of the pattern within that source\&. If the pattern contained a "!" prefix or "\fB/\fR" suffix, it will be preserved in the output\&. <source> will be an absolute path when referring to the file configured by \fBcore\&.excludesFile\fR, or relative to the repository root when referring to \&.\fBgit/info/exclude\fR or a per\-directory exclude file\&.
  96. .sp
  97. If \fB\-z\fR is specified, the pathnames in the output are delimited by the null character; if \fB\-\-verbose\fR is also specified then null characters are also used instead of colons and hard tabs:
  98. .sp
  99. <source> <NULL> <linenum> <NULL> <pattern> <NULL> <pathname> <NULL>
  100. .sp
  101. If \fB\-n\fR or \fB\-\-non\-matching\fR are specified, non\-matching pathnames will also be output, in which case all fields in each output record except for <pathname> will be empty\&. This can be useful when running non\-interactively, so that files can be incrementally streamed to STDIN of a long\-running check\-ignore process, and for each of these files, STDOUT will indicate whether that file matched a pattern or not\&. (Without this option, it would be impossible to tell whether the absence of output for a given file meant that it didn\(cqt match any pattern, or that the output hadn\(cqt been generated yet\&.)
  102. .sp
  103. Buffering happens as documented under the \fBGIT_FLUSH\fR option in \fBgit\fR(1)\&. The caller is responsible for avoiding deadlocks caused by overfilling an input buffer or reading from an empty output buffer\&.
  104. .SH "EXIT STATUS"
  105. .PP
  106. 0
  107. .RS 4
  108. One or more of the provided paths is ignored\&.
  109. .RE
  110. .PP
  111. 1
  112. .RS 4
  113. None of the provided paths are ignored\&.
  114. .RE
  115. .PP
  116. 128
  117. .RS 4
  118. A fatal error was encountered\&.
  119. .RE
  120. .SH "SEE ALSO"
  121. .sp
  122. \fBgitignore\fR(5) \fBgit-config\fR(1) \fBgit-ls-files\fR(1)
  123. .SH "GIT"
  124. .sp
  125. Part of the \fBgit\fR(1) suite