Documentation / git-check-attr.txton commit Merge branch 'jk/lookup-object-prefer-latest' (4818cfc)
   1git-check-attr(1)
   2=================
   3
   4NAME
   5----
   6git-check-attr - Display gitattributes information
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git check-attr' [-a | --all | attr...] [--] pathname...
  13'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths>
  14
  15DESCRIPTION
  16-----------
  17For every pathname, this command will list if each attribute is 'unspecified',
  18'set', or 'unset' as a gitattribute on that pathname.
  19
  20OPTIONS
  21-------
  22-a, --all::
  23        List all attributes that are associated with the specified
  24        paths.  If this option is used, then 'unspecified' attributes
  25        will not be included in the output.
  26
  27--cached::
  28        Consider `.gitattributes` in the index only, ignoring the working tree.
  29
  30--stdin::
  31        Read file names from stdin instead of from the command-line.
  32
  33-z::
  34        Only meaningful with `--stdin`; paths are separated with a
  35        NUL character instead of a linefeed character.
  36
  37\--::
  38        Interpret all preceding arguments as attributes and all following
  39        arguments as path names.
  40
  41If none of `--stdin`, `--all`, or `--` is used, the first argument
  42will be treated as an attribute and the rest of the arguments as
  43pathnames.
  44
  45OUTPUT
  46------
  47
  48The output is of the form:
  49<path> COLON SP <attribute> COLON SP <info> LF
  50
  51<path> is the path of a file being queried, <attribute> is an attribute
  52being queried and <info> can be either:
  53
  54'unspecified';; when the attribute is not defined for the path.
  55'unset';;       when the attribute is defined as false.
  56'set';;         when the attribute is defined as true.
  57<value>;;       when a value has been assigned to the attribute.
  58
  59Buffering happens as documented under the `GIT_FLUSH` option in
  60linkgit:git[1].  The caller is responsible for avoiding deadlocks
  61caused by overfilling an input buffer or reading from an empty output
  62buffer.
  63
  64EXAMPLES
  65--------
  66
  67In the examples, the following '.gitattributes' file is used:
  68---------------
  69*.java diff=java -crlf myAttr
  70NoMyAttr.java !myAttr
  71README caveat=unspecified
  72---------------
  73
  74* Listing a single attribute:
  75---------------
  76$ git check-attr diff org/example/MyClass.java
  77org/example/MyClass.java: diff: java
  78---------------
  79
  80* Listing multiple attributes for a file:
  81---------------
  82$ git check-attr crlf diff myAttr -- org/example/MyClass.java
  83org/example/MyClass.java: crlf: unset
  84org/example/MyClass.java: diff: java
  85org/example/MyClass.java: myAttr: set
  86---------------
  87
  88* Listing all attributes for a file:
  89---------------
  90$ git check-attr --all -- org/example/MyClass.java
  91org/example/MyClass.java: diff: java
  92org/example/MyClass.java: myAttr: set
  93---------------
  94
  95* Listing an attribute for multiple files:
  96---------------
  97$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
  98org/example/MyClass.java: myAttr: set
  99org/example/NoMyAttr.java: myAttr: unspecified
 100---------------
 101
 102* Not all values are equally unambiguous:
 103---------------
 104$ git check-attr caveat README
 105README: caveat: unspecified
 106---------------
 107
 108SEE ALSO
 109--------
 110linkgit:gitattributes[5].
 111
 112GIT
 113---
 114Part of the linkgit:git[1] suite