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

NOME

git-check-attr - Exiba as informações sobre os gitattributes

RESUMO

git check-attr [--source <tree-ish>] [-a | --all | <attr>…​] [--] <nome_do_caminho>…​
git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>…​]

DESCRIÇÃO

Para cada nome do caminho, este comando listará se cada atributo é unspecified (não especificado), set (definido) ou unset (não definido) como um gitattribute neste nome do caminho.

OPÇÕES

-a, --all

List all attributes that are associated with the specified paths. If this option is used, then unspecified attributes will not be included in the output.

--cached

Consider .gitattributes in the index only, ignoring the working tree.

--stdin

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

-z

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

--source=<tree-ish>

Verifique os atributos em relação à árvore especificada. É comum especificar a árvore de origem nomeando um commit, um ramo ou uma tag associada com ela.

--

Interprete todas as opções anteriores como atributos e todos as opções a seguir como nomes do caminho.

Caso nenhuma opção --stdin, --all ou -- seja utilizado, a primeira será tratada como um atributo e o restante das opções como os nomes do caminho.

SAÍDA

A saída assume a forma: <caminho> COLON SP <atributo> COLON SP <info> LF

a menos que -z esteja em vigor, no caso onde NUL é utilizado como um delimitador: <caminho> NUL <atributo> NUL <info> NUL

<caminho> é o caminho de um arquivo sendo consultado, <atributo> é um atributo sendo consultado e <info> pode ser:

unspecified

quando o atributo não esteja definido para o caminho.

unset

quando o atributo é definido como falso.

set

quando o atributo é definido como verdadeiro.

<valor>

quando um valor foi atribuído ao atributo.

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.

EXEMPLOS

In the examples, the following .gitattributes file is used:

*.java diff=java -crlf myAttr
NoMyAttr.java !myAttr
README caveat=unspecified
  • Listando um único atributo:

$ git check-attr diff org/example/MyClass.java
org/example/MyClass.java: diff: java
  • Listando vários atributos para um arquivo:

$ git check-attr crlf diff myAttr -- org/example/MyClass.java
org/example/MyClass.java: crlf: unset
org/example/MyClass.java: diff: java
org/example/MyClass.java: myAttr: set
  • Listando todos os atributos de um arquivo:

$ git check-attr --all -- org/example/MyClass.java
org/example/MyClass.java: diff: java
org/example/MyClass.java: myAttr: set
  • Listando um atributo para vários arquivos:

$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
org/example/MyClass.java: myAttr: set
org/example/NoMyAttr.java: myAttr: unspecified
  • Nem todos os valores não ambíguos são iguais:

$ git check-attr caveat README
README: caveat: unspecified

VEJA TAMBÉM

GIT

Parte do conjunto git[1]

scroll-to-top