Documentation / git-check-attr.txton commit Merge branch 'sp/smart-http-failure' into maint (7fa6c90)
   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--stdin::
  28        Read file names from stdin instead of from the command-line.
  29
  30-z::
  31        Only meaningful with `--stdin`; paths are separated with a
  32        NUL character instead of a linefeed character.
  33
  34\--::
  35        Interpret all preceding arguments as attributes and all following
  36        arguments as path names.
  37
  38If none of `--stdin`, `--all`, or `--` is used, the first argument
  39will be treated as an attribute and the rest of the arguments as
  40pathnames.
  41
  42OUTPUT
  43------
  44
  45The output is of the form:
  46<path> COLON SP <attribute> COLON SP <info> LF
  47
  48<path> is the path of a file being queried, <attribute> is an attribute
  49being queried and <info> can be either:
  50
  51'unspecified';; when the attribute is not defined for the path.
  52'unset';;       when the attribute is defined as false.
  53'set';;         when the attribute is defined as true.
  54<value>;;       when a value has been assigned to the attribute.
  55
  56EXAMPLES
  57--------
  58
  59In the examples, the following '.gitattributes' file is used:
  60---------------
  61*.java diff=java -crlf myAttr
  62NoMyAttr.java !myAttr
  63README caveat=unspecified
  64---------------
  65
  66* Listing a single attribute:
  67---------------
  68$ git check-attr diff org/example/MyClass.java
  69org/example/MyClass.java: diff: java
  70---------------
  71
  72* Listing multiple attributes for a file:
  73---------------
  74$ git check-attr crlf diff myAttr -- org/example/MyClass.java
  75org/example/MyClass.java: crlf: unset
  76org/example/MyClass.java: diff: java
  77org/example/MyClass.java: myAttr: set
  78---------------
  79
  80* Listing all attributes for a file:
  81---------------
  82$ git check-attr --all -- org/example/MyClass.java
  83org/example/MyClass.java: diff: java
  84org/example/MyClass.java: myAttr: set
  85---------------
  86
  87* Listing an attribute for multiple files:
  88---------------
  89$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
  90org/example/MyClass.java: myAttr: set
  91org/example/NoMyAttr.java: myAttr: unspecified
  92---------------
  93
  94* Not all values are equally unambiguous:
  95---------------
  96$ git check-attr caveat README
  97README: caveat: unspecified
  98---------------
  99
 100SEE ALSO
 101--------
 102linkgit:gitattributes[5].
 103
 104GIT
 105---
 106Part of the linkgit:git[1] suite