2 .\" Title: git-check-attr
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.44.0.568.g436d4e5b14
10 .TH "GIT\-CHECK\-ATTR" "1" "2024\-04\-10" "Git 2\&.44\&.0\&.568\&.g436d4e" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-check-attr \- Display gitattributes information
35 \fIgit check\-attr\fR [\-\-source <tree\-ish>] [\-a | \-\-all | <attr>\&...] [\-\-] <pathname>\&...
36 \fIgit check\-attr\fR \-\-stdin [\-z] [\-\-source <tree\-ish>] [\-a | \-\-all | <attr>\&...]
41 For every pathname, this command will list if each attribute is \fIunspecified\fR, \fIset\fR, or \fIunset\fR as a gitattribute on that pathname\&.
46 List all attributes that are associated with the specified paths\&. If this option is used, then
48 attributes will not be included in the output\&.
54 \fB\&.gitattributes\fR
55 in the index only, ignoring the working tree\&.
60 Read pathnames from the standard input, one per line, instead of from the command line\&.
65 The output format is modified to be machine\-parsable\&. If
67 is also given, input paths are separated with a NUL character instead of a linefeed character\&.
70 \-\-source=<tree\-ish>
72 Check attributes against the specified tree\-ish\&. It is common to specify the source tree by naming a commit, branch, or tag associated with it\&.
77 Interpret all preceding arguments as attributes and all following arguments as path names\&.
80 If none of \fB\-\-stdin\fR, \fB\-\-all\fR, or \fB\-\-\fR is used, the first argument will be treated as an attribute and the rest of the arguments as pathnames\&.
83 The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF
85 unless \fB\-z\fR is in effect, in which case NUL is used as delimiter: <path> NUL <attribute> NUL <info> NUL
87 <path> is the path of a file being queried, <attribute> is an attribute being queried, and <info> can be either:
91 when the attribute is not defined for the path\&.
96 when the attribute is defined as false\&.
101 when the attribute is defined as true\&.
106 when a value has been assigned to the attribute\&.
109 Buffering happens as documented under the \fBGIT_FLUSH\fR option in \fBgit\fR(1)\&. The caller is responsible for avoiding deadlocks caused by overfilling an input buffer or reading from an empty output buffer\&.
112 In the examples, the following \fI\&.gitattributes\fR file is used:
118 *\&.java diff=java \-crlf myAttr
119 NoMyAttr\&.java !myAttr
120 README caveat=unspecified
136 Listing a single attribute:
143 $ git check\-attr diff org/example/MyClass\&.java
144 org/example/MyClass\&.java: diff: java
160 Listing multiple attributes for a file:
167 $ git check\-attr crlf diff myAttr \-\- org/example/MyClass\&.java
168 org/example/MyClass\&.java: crlf: unset
169 org/example/MyClass\&.java: diff: java
170 org/example/MyClass\&.java: myAttr: set
186 Listing all attributes for a file:
193 $ git check\-attr \-\-all \-\- org/example/MyClass\&.java
194 org/example/MyClass\&.java: diff: java
195 org/example/MyClass\&.java: myAttr: set
211 Listing an attribute for multiple files:
218 $ git check\-attr myAttr \-\- org/example/MyClass\&.java org/example/NoMyAttr\&.java
219 org/example/MyClass\&.java: myAttr: set
220 org/example/NoMyAttr\&.java: myAttr: unspecified
236 Not all values are equally unambiguous:
243 $ git check\-attr caveat README
244 README: caveat: unspecified
252 \fBgitattributes\fR(5)\&.
255 Part of the \fBgit\fR(1) suite