Git
Português (Brasil) ▾Topics ▾Latest version ▾ git-check-ignore last updated in 2.43.0

NOME

git-check-ignore - Depure o gitignorar / excluir arquivos

RESUMO

git check-ignore [<opções>] <pathname>…​
git check-ignore [<opções>] --stdin

DESCRIÇÃO

Para cada nome do caminho informado através da linha de comando ou de um arquivo via --stdin, verifique se o arquivo foi excluído por .gitignorar (ou outros arquivos de entrada para o mecanismo de exclusão) e imprima o caminho se ele for excluído.

Por padrão, os arquivos rastreados não são exibidos, pois não estão sujeitos a regras de exclusão. mas veja --no-index.

OPÇÕES

-q, --quieto

Don’t output anything, just set exit status. This is only valid with a single pathname.

-v, --verbose

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.)

Para as regras da precedência dentro e entre as fontes eliminadas, consulte gitignore[5].

--stdin

Leia os nomes do caminho na entrada padrão, um por linha, em vez da linha de comando.

-z

The output format is modified to be machine-parsable (see below). If --stdin is also given, input paths are separated with a NUL character instead of a linefeed character.

-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.

--no-index

Não procure no índice ao realizar as verificações. Pode ser utilizado para depurar o motivo de um caminho ter sido rastreado por ex. git add . e não foi ignorado pelas regras conforme o esperado pelo usuário ou ao desenvolver padrões incluindo a negação da coincidência a um caminho adicionado anteriormente com o comando git add -f.

SAÍDA

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.

Caso a opção --verbose seja utilizada, a saída será uma série de linhas desta forma:

<fonte> <COLON> <linenum> <COLON> <padrão> <HT> <pathname>

<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.

Caso -z seja utilizado, os nomes do caminho gerado são delimitados pelo caractere nulo; caso --verbose também seja utilizado, então os caracteres nulos também serão utilizados em vez das vírgulas e das guias rígidas:

<fonte> <NULL> <linenum> <NULL> <padrão> <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.)

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.

CONDIÇÃO DE ENCERRAMENTO

0

Um ou mais dos caminhos informados são ignorados.

1

Nenhum dos caminhos informados serão ignorados.

128

Um erro fatal foi encontrado.

GIT

Parte do conjunto git[1]

scroll-to-top