6 git-check-attr - Display gitattributes information
12 'git check-attr' [-a | --all | attr...] [--] pathname...
13 'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths>
17 For every pathname, this command will list if each attribute is 'unspecified',
18 'set', or 'unset' as a gitattribute on that pathname.
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.
28 Read file names from stdin instead of from the command-line.
31 Only meaningful with `--stdin`; paths are separated with a
32 NUL character instead of a linefeed character.
35 Interpret all preceding arguments as attributes and all following
36 arguments as path names. If not supplied, only the first argument will
37 be treated as an attribute.
42 The output is of the form:
43 <path> COLON SP <attribute> COLON SP <info> LF
45 <path> is the path of a file being queried, <attribute> is an attribute
46 being queried and <info> can be either:
48 'unspecified';; when the attribute is not defined for the path.
49 'unset';; when the attribute is defined as false.
50 'set';; when the attribute is defined as true.
51 <value>;; when a value has been assigned to the attribute.
56 In the examples, the following '.gitattributes' file is used:
58 *.java diff=java -crlf myAttr
60 README caveat=unspecified
63 * Listing a single attribute:
65 $ git check-attr diff org/example/MyClass.java
66 org/example/MyClass.java: diff: java
69 * Listing multiple attributes for a file:
71 $ git check-attr crlf diff myAttr -- org/example/MyClass.java
72 org/example/MyClass.java: crlf: unset
73 org/example/MyClass.java: diff: java
74 org/example/MyClass.java: myAttr: set
77 * Listing all attributes for a file:
79 $ git check-attr --all -- org/example/MyClass.java
80 org/example/MyClass.java: diff: java
81 org/example/MyClass.java: myAttr: set
84 * Listing an attribute for multiple files:
86 $ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
87 org/example/MyClass.java: myAttr: set
88 org/example/NoMyAttr.java: myAttr: unspecified
91 * Not all values are equally unambiguous:
93 $ git check-attr caveat README
94 README: caveat: unspecified
99 linkgit:gitattributes[5].
103 Part of the linkgit:git[1] suite