1 git-check-attr(1)
2 =================
4 NAME
5 ----
6 git-check-attr - Display gitattributes information
9 SYNOPSIS
10 --------
11 [verse]
12 'git check-attr' [-a | --all | attr...] [--] pathname...
13 'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths>
15 DESCRIPTION
16 -----------
17 For every pathname, this command will list if each attribute is 'unspecified',
18 'set', or 'unset' as a gitattribute on that pathname.
20 OPTIONS
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.
27 --cached::
28 Consider `.gitattributes` in the index only, ignoring the working tree.
30 --stdin::
31 Read file names from stdin instead of from the command-line.
33 -z::
34 Only meaningful with `--stdin`; paths are separated with a
35 NUL character instead of a linefeed character.
37 \--::
38 Interpret all preceding arguments as attributes and all following
39 arguments as path names.
41 If none of `--stdin`, `--all`, or `--` is used, the first argument
42 will be treated as an attribute and the rest of the arguments as
43 pathnames.
45 OUTPUT
46 ------
48 The output is of the form:
49 <path> COLON SP <attribute> COLON SP <info> LF
51 <path> is the path of a file being queried, <attribute> is an attribute
52 being queried and <info> can be either:
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.
59 EXAMPLES
60 --------
62 In the examples, the following '.gitattributes' file is used:
63 ---------------
64 *.java diff=java -crlf myAttr
65 NoMyAttr.java !myAttr
66 README caveat=unspecified
67 ---------------
69 * Listing a single attribute:
70 ---------------
71 $ git check-attr diff org/example/MyClass.java
72 org/example/MyClass.java: diff: java
73 ---------------
75 * Listing multiple attributes for a file:
76 ---------------
77 $ git check-attr crlf diff myAttr -- org/example/MyClass.java
78 org/example/MyClass.java: crlf: unset
79 org/example/MyClass.java: diff: java
80 org/example/MyClass.java: myAttr: set
81 ---------------
83 * Listing all attributes for a file:
84 ---------------
85 $ git check-attr --all -- org/example/MyClass.java
86 org/example/MyClass.java: diff: java
87 org/example/MyClass.java: myAttr: set
88 ---------------
90 * Listing an attribute for multiple files:
91 ---------------
92 $ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
93 org/example/MyClass.java: myAttr: set
94 org/example/NoMyAttr.java: myAttr: unspecified
95 ---------------
97 * Not all values are equally unambiguous:
98 ---------------
99 $ git check-attr caveat README
100 README: caveat: unspecified
101 ---------------
103 SEE ALSO
104 --------
105 linkgit:gitattributes[5].
107 GIT
108 ---
109 Part of the linkgit:git[1] suite