1GIT-CHECK-ATTR(1)                 Git Manual                 GIT-CHECK-ATTR(1)
2
3
4

NAME

6       git-check-attr - Display gitattributes information
7

SYNOPSIS

9       git check-attr [-a | --all | attr...] [--] pathname...
10       git check-attr --stdin [-z] [-a | --all | attr...] < <list-of-paths>
11
12

DESCRIPTION

14       For every pathname, this command will list if each attribute is
15       unspecified, set, or unset as a gitattribute on that pathname.
16

OPTIONS

18       -a, --all
19           List all attributes that are associated with the specified paths.
20           If this option is used, then unspecified attributes will not be
21           included in the output.
22
23       --cached
24           Consider .gitattributes in the index only, ignoring the working
25           tree.
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 NUL
32           character instead of a linefeed character.
33
34       --
35           Interpret all preceding arguments as attributes and all following
36           arguments as path names.
37
38       If none of --stdin, --all, or -- is used, the first argument will be
39       treated as an attribute and the rest of the arguments as pathnames.
40

OUTPUT

42       The output is of the form: <path> COLON SP <attribute> COLON SP <info>
43       LF
44
45       <path> is the path of a file being queried, <attribute> is an attribute
46       being queried and <info> can be either:
47
48       unspecified
49           when the attribute is not defined for the path.
50
51       unset
52           when the attribute is defined as false.
53
54       set
55           when the attribute is defined as true.
56
57       <value>
58           when a value has been assigned to the attribute.
59

EXAMPLES

61       In the examples, the following .gitattributes file is used:
62
63           *.java diff=java -crlf myAttr
64           NoMyAttr.java !myAttr
65           README caveat=unspecified
66
67
68
69       ·   Listing a single attribute:
70
71           $ git check-attr diff org/example/MyClass.java
72           org/example/MyClass.java: diff: java
73
74
75
76       ·   Listing multiple attributes for a file:
77
78           $ git check-attr crlf diff myAttr -- org/example/MyClass.java
79           org/example/MyClass.java: crlf: unset
80           org/example/MyClass.java: diff: java
81           org/example/MyClass.java: myAttr: set
82
83
84
85       ·   Listing all attributes for a file:
86
87           $ git check-attr --all -- org/example/MyClass.java
88           org/example/MyClass.java: diff: java
89           org/example/MyClass.java: myAttr: set
90
91
92
93       ·   Listing an attribute for multiple files:
94
95           $ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
96           org/example/MyClass.java: myAttr: set
97           org/example/NoMyAttr.java: myAttr: unspecified
98
99
100
101       ·   Not all values are equally unambiguous:
102
103           $ git check-attr caveat README
104           README: caveat: unspecified
105
106

SEE ALSO

108       gitattributes(5).
109

GIT

111       Part of the git(1) suite
112
113
114
115Git 1.8.3.1                       11/19/2018                 GIT-CHECK-ATTR(1)
Impressum