blob: 50824e3a2d7d00370d7311088349da84ee23b728 [file] [log] [blame]
Junio C Hamanoe90436a2007-04-22 07:22:131git-check-attr(1)
2=================
3
4NAME
5----
Junio C Hamano9bd39c42008-11-13 01:54:446git-check-attr - Display gitattributes information
Junio C Hamanoe90436a2007-04-22 07:22:137
8
9SYNOPSIS
10--------
Junio C Hamano7d06a8a2008-10-20 05:42:3311[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3812'git check-attr' attr... [--] pathname...
Junio C Hamano7d06a8a2008-10-20 05:42:3313'git check-attr' --stdin [-z] attr... < <list-of-paths>
Junio C Hamanoe90436a2007-04-22 07:22:1314
15DESCRIPTION
16-----------
Junio C Hamano1de75722009-03-26 08:39:3817For every pathname, this command will list if each attribute is 'unspecified',
Junio C Hamanoe90436a2007-04-22 07:22:1318'set', or 'unset' as a gitattribute on that pathname.
19
20OPTIONS
21-------
Junio C Hamano7d06a8a2008-10-20 05:42:3322--stdin::
23Read file names from stdin instead of from the command-line.
24
25-z::
Junio C Hamano1de75722009-03-26 08:39:3826Only meaningful with `--stdin`; paths are separated with a
27NUL character instead of a linefeed character.
Junio C Hamano7d06a8a2008-10-20 05:42:3328
Junio C Hamanoe90436a2007-04-22 07:22:1329\--::
Junio C Hamano1de75722009-03-26 08:39:3830Interpret all preceding arguments as attributes and all following
Junio C Hamanoe90436a2007-04-22 07:22:1331arguments as path names. If not supplied, only the first argument will
32be treated as an attribute.
33
Junio C Hamanocbb30862008-10-17 10:03:4234OUTPUT
35------
36
37The output is of the form:
38<path> COLON SP <attribute> COLON SP <info> LF
39
Junio C Hamano1de75722009-03-26 08:39:3840<path> is the path of a file being queried, <attribute> is an attribute
Junio C Hamanocbb30862008-10-17 10:03:4241being queried and <info> can be either:
42
43'unspecified';; when the attribute is not defined for the path.
Junio C Hamano1de75722009-03-26 08:39:3844'unset';; when the attribute is defined as false.
45'set';; when the attribute is defined as true.
Junio C Hamanocbb30862008-10-17 10:03:4246<value>;; when a value has been assigned to the attribute.
47
48EXAMPLES
49--------
50
51In the examples, the following '.gitattributes' file is used:
52---------------
53*.java diff=java -crlf myAttr
54NoMyAttr.java !myAttr
55README caveat=unspecified
56---------------
57
58* Listing a single attribute:
59---------------
60$ git check-attr diff org/example/MyClass.java
61org/example/MyClass.java: diff: java
62---------------
63
64* Listing multiple attributes for a file:
65---------------
66$ git check-attr crlf diff myAttr -- org/example/MyClass.java
67org/example/MyClass.java: crlf: unset
68org/example/MyClass.java: diff: java
69org/example/MyClass.java: myAttr: set
70---------------
71
Junio C Hamano1de75722009-03-26 08:39:3872* Listing an attribute for multiple files:
Junio C Hamanocbb30862008-10-17 10:03:4273---------------
74$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
75org/example/MyClass.java: myAttr: set
76org/example/NoMyAttr.java: myAttr: unspecified
77---------------
78
79* Not all values are equally unambiguous:
80---------------
81$ git check-attr caveat README
82README: caveat: unspecified
83---------------
Junio C Hamanoe90436a2007-04-22 07:22:1384
Junio C Hamanof556fc22007-12-23 08:16:3885SEE ALSO
86--------
Junio C Hamano35738e82008-01-07 07:55:4687linkgit:gitattributes[5].
Junio C Hamanof556fc22007-12-23 08:16:3888
89
Junio C Hamanoe90436a2007-04-22 07:22:1390Author
91------
Junio C Hamano0868a302008-07-22 09:20:4492Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamanoe90436a2007-04-22 07:22:1393
94Documentation
95--------------
96Documentation by James Bowes.
97
98GIT
99---
Junio C Hamanof7c042d2008-06-06 22:50:53100Part of the linkgit:git[1] suite