2 .\" Title: git-check-attr
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.46.0.288.g3a7362eb9f
10 .TH "GIT\-CHECK\-ATTR" "1" "2024-08-21" "Git 2\&.46\&.0\&.288\&.g3a7362" "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>\&...\:]
40 For every pathname, this command will list if each attribute is \fIunspecified\fR, \fIset\fR, or \fIunset\fR as a gitattribute on that pathname\&.
45 List all attributes that are associated with the specified paths\&. If this option is used, then
47 attributes will not be included in the output\&.
53 \fB\&.gitattributes\fR
54 in the index only, ignoring the working tree\&.
59 Read pathnames from the standard input, one per line, instead of from the command line\&.
64 The output format is modified to be machine\-parsable\&. If
66 is also given, input paths are separated with a NUL character instead of a linefeed character\&.
69 \-\-source=<tree\-ish>
71 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\&.
76 Interpret all preceding arguments as attributes and all following arguments as path names\&.
79 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\&.
82 The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF
84 unless \fB\-z\fR is in effect, in which case NUL is used as delimiter: <path> NUL <attribute> NUL <info> NUL
86 <path> is the path of a file being queried, <attribute> is an attribute being queried, and <info> can be either:
90 when the attribute is not defined for the path\&.
95 when the attribute is defined as false\&.
100 when the attribute is defined as true\&.
105 when a value has been assigned to the attribute\&.
108 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\&.
111 In the examples, the following \fI\&.gitattributes\fR file is used:
117 *\&.java diff=java \-crlf myAttr
118 NoMyAttr\&.java !myAttr
119 README caveat=unspecified
133 Listing a single attribute:
140 $ git check\-attr diff org/example/MyClass\&.java
141 org/example/MyClass\&.java: diff: java
155 Listing multiple attributes for a file:
162 $ git check\-attr crlf diff myAttr \-\- org/example/MyClass\&.java
163 org/example/MyClass\&.java: crlf: unset
164 org/example/MyClass\&.java: diff: java
165 org/example/MyClass\&.java: myAttr: set
179 Listing all attributes for a file:
186 $ git check\-attr \-\-all \-\- org/example/MyClass\&.java
187 org/example/MyClass\&.java: diff: java
188 org/example/MyClass\&.java: myAttr: set
202 Listing an attribute for multiple files:
209 $ git check\-attr myAttr \-\- org/example/MyClass\&.java org/example/NoMyAttr\&.java
210 org/example/MyClass\&.java: myAttr: set
211 org/example/NoMyAttr\&.java: myAttr: unspecified
225 Not all values are equally unambiguous:
232 $ git check\-attr caveat README
233 README: caveat: unspecified
240 \fBgitattributes\fR(5)\&.
243 Part of the \fBgit\fR(1) suite