check-ignore
NAME名
git-check-ignore - Debug gitignore / exclude filesgit-check-ignore - gitignore / excludeファイルをデバッグする
SYNOPSIS概要
git check-ignore [<options>] <pathname>… git check-ignore [<options>] --stdin
DESCRIPTION説明
For each pathname given via the command-line or from a file via
--stdin
, check whether the file is excluded by .gitignore (or other
input files to the exclude mechanism) and output the path if it is
excluded.コマンドライン経由またはファイル経由--stdin
で与えられた各パス名について、ファイルが.gitignore(または除外メカニズムへの他の入力ファイル)によって除外されているかどうかを確認し、除外されている場合はそのパスを出力します。
By default, tracked files are not shown at all since they are not subject to exclude rules; but see ‘--no-index’.デフォルトでは、追跡ファイルは除外ルールの対象にならないため、まったく表示されません。しかし '--no-index'を見てください。
OPTIONSオプション
- -q, --quiet -q、 - 静か
-
Don’t output anything, just set exit status. This is only valid with a single pathname.何も出力せず、終了ステータスを設定するだけです。これは単一のパス名でのみ有効です。
- -v, --verbose -v、 - verbose
-
Also output details about the matching pattern (if any) for each given pathname. For precedence rules within and between exclude sources, see gitignore[5].与えられたそれぞれのパス名のためのマッチングパターン(もしあれば)についての詳細も出力します。除外ソース内および除外ソース間の優先順位規則については、gitignore [5]を参照してください。
- --stdin
-
Read pathnames from the standard input, one per line, instead of from the command-line.コマンドラインからではなく、標準入力から1行に1つずつパス名を読み取ります。
- -z
-
The output format is modified to be machine-parseable (see below). If
--stdin
is also given, input paths are separated with a NUL character instead of a linefeed character.出力フォーマットは機械解析可能に変更されています(下記参照)。--stdin
も指定されている場合、入力パスは改行文字ではなくNUL文字で区切られます。 - -n, --non-matching -n、 - non-matching
-
Show given paths which don’t match any pattern. This only makes sense when
--verbose
is enabled, otherwise it would not be possible to distinguish between paths which match a pattern and those which don’t.どのパターンとも一致しないパスを表示します。これ--verbose
が有効になっている場合にのみ意味があります。そうでなければ、パターンに一致するパスと一致しないパスを区別することはできません。 - --no-index
-
Don’t look in the index when undertaking the checks. This can be used to debug why a path became tracked by e.g.
git add .
and was not ignored by the rules as expected by the user or when developing patterns including negation to match a path previously added withgit add -f
.チェックを行うときにインデックスを調べないでください。これは、パスが例えばによって追跡git add .
され、ユーザーが予期したとおりにルールによって無視されなかった理由、または以前に追加されたパスに一致するように否定を含むパターンを作成するときにデバッグするために使用できますgit add -f
。
OUTPUT出力
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.デフォルトでは、無視パターンに一致する任意のパス名が1行に1つずつ出力されます。与えられたパスにマッチするパターンがなければ、そのパスには何も出力されません。これはパスが無視されないことを意味します。
If --verbose
is specified, the output is a series of lines of the form:場合は--verbose
、指定され、出力がフォームの一連の線です。
<source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname><source> <COLON> <linenum> <COLON> <パターン> <HT> <パス名>
<pathname> is the path of a file being queried, <pattern> is the
matching pattern, <source> is the pattern’s source file, and <linenum>
is the line number of the pattern within that source. If the pattern
contained a !
prefix or /
suffix, it will be preserved in the
output. <source> will be an absolute path when referring to the file
configured by core.excludesFile
, or relative to the repository root
when referring to .git/info/exclude
or a per-directory exclude file.<pathname>は照会されているファイルのパス、<pattern>は一致パターン、<source>はパターンのソースファイル、そして<linenum>はそのソース内のパターンの行番号です。パターンに!
接頭辞または/
接尾辞が含まれている場合、それは出力に保存されます。<source>は、参照されているときcore.excludesFile
、または.git/info/exclude
ディレクトリごとの除外ファイルによって設定されているファイルを参照する場合は絶対パスになります。
If -z
is specified, the pathnames in the output are delimited by the
null character; if --verbose
is also specified then null characters
are also used instead of colons and hard tabs:を-z
指定すると、出力内のパス名はヌル文字で区切られます。--verbose
colも指定されている場合は、コロンやハードタブの代わりにnull文字も使用されます。
<source> <NULL> <linenum> <NULL> <pattern> <NULL> <pathname> <NULL><ソース> <空白> <行番号> <空白> <パターン> <空白> <パス名> <空白>
If -n
or --non-matching
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’t match any
pattern, or that the output hadn’t been generated yet.)-n
または--non-matching
を指定した場合、一致しないパス名も出力されます。その場合、<pathname>を除く各出力レコードのすべてのフィールドは空になります。これは非対話的に実行している場合に便利です。そうすれば、長時間実行されるチェック無視プロセスのSTDINにファイルを段階的にストリーミングすることができ、STDOUTはそのファイルごとにそのファイルがパターンと一致したかどうかを示します。(このオプションがなければ、与えられたファイルに出力がないことが、それがどのパターンとも一致しなかったことを意味しているのか、それともまだ出力が生成されていなかったのかを知ることは不可能です。)
Buffering happens as documented under the GIT_FLUSH
option in
git[1]. The caller is responsible for avoiding deadlocks
caused by overfilling an input buffer or reading from an empty output
buffer.バッファリングGIT_FLUSH
はgit [1]のオプションの下で文書化されているように起こります。呼び出し側は、入力バッファーをいっぱいにしたり、空の出力バッファーから読み取ったりすることによって引き起こされるデッドロックを回避する責任があります。
EXIT STATUS終了ステータス
- 0
-
One or more of the provided paths is ignored.指定された1つ以上のパスが無視されます。
- 1
-
None of the provided paths are ignored.提供されたパスはどれも無視されません。
- 128
-
A fatal error was encountered.致命的なエラーが発生しました。
SEE ALSO関連項目
gitignore[5] git-config[1] git-ls-files[1]gitignore [5] git-config [1] git-lsファイル[1]
GIT
Part of the git[1] suite一部のgit [1]スイート
スポンサーリンク
関連記事
- write-tree
- verify-pack
- update-ref
- update-index
- symbolic-ref
- show-ref
- rev-parse
- rev-list
- read-tree
- merge-base
- ls-files
- hash-object
- for-each-ref
- diff-index
- count-objects
- commit-tree
- checkout-index
- cat-file
- bundle
- archive
- instaweb
- filter-branch
- reflog
- fsck
- gc
- clean
- Workflows
- Tutorial
- Revisions
- gitmodules
- gitignore
- githooks
- Glossary
- Everyday Git
- gitattributes
- update-server-info
- daemon
- fast-import
- svn
- request-pull
- send-email
- format-patch
- am
- grep
- blame
- bisect
- revert
- rebase
- cherry-pick
- apply
- describe
- shortlog
- show
- submodule
- remote
- push
- pull
- fetch
- worktree
- tag
- stash
- log
- mergetool
- merge
- checkout
- branch
- mv
- rm
- reset
- commit
- diff
- status
- add
- clone
- init
- help
- config
- git
スポンサーリンク