<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article lang="en" id="git-check-attr(1)">
<articleinfo>
    <title>git-check-attr(1)</title>
        <indexterm>
                <primary>git-check-attr(1)</primary>
        </indexterm>
</articleinfo>
<simplesect id="_name">
<title>NAME</title>
<simpara>git-check-attr - Display gitattributes information</simpara>
</simplesect>
<simplesect id="_synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git check-attr</emphasis> attr&#8230; [--] pathname&#8230;
<emphasis>git check-attr</emphasis> --stdin [-z] attr&#8230; &lt; &lt;list-of-paths&gt;</literallayout>
</blockquote>
</simplesect>
<simplesect id="_description">
<title>DESCRIPTION</title>
<simpara>For every pathname, this command will list if each attr is <emphasis>unspecified</emphasis>,
<emphasis>set</emphasis>, or <emphasis>unset</emphasis> as a gitattribute on that pathname.</simpara>
</simplesect>
<simplesect id="_options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--stdin
</term>
<listitem>
<simpara>
        Read file names from stdin instead of from the command-line.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-z
</term>
<listitem>
<simpara>
        Only meaningful with <literal>--stdin</literal>; paths are separated with
        NUL character instead of LF.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--
</term>
<listitem>
<simpara>
        Interpret all preceding arguments as attributes, and all following
        arguments as path names. If not supplied, only the first argument will
        be treated as an attribute.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="_output">
<title>OUTPUT</title>
<simpara>The output is of the form:
&lt;path&gt; COLON SP &lt;attribute&gt; COLON SP &lt;info&gt; LF</simpara>
<simpara>Where &lt;path&gt; is the path of a file being queried, &lt;attribute&gt; is an attribute
being queried and &lt;info&gt; can be either:</simpara>
<variablelist>
<varlistentry>
<term>
<emphasis>unspecified</emphasis>
</term>
<listitem>
<simpara>
when the attribute is not defined for the path.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>unset</emphasis>
</term>
<listitem>
<simpara>
when the attribute is defined to false.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>set</emphasis>
</term>
<listitem>
<simpara>
when the attribute is defined to true.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;value&gt;
</term>
<listitem>
<simpara>
when a value has been assigned to the attribute.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="_examples">
<title>EXAMPLES</title>
<simpara>In the examples, the following <emphasis>.gitattributes</emphasis> file is used:</simpara>
<literallayout>*.java diff=java -crlf myAttr
NoMyAttr.java !myAttr
README caveat=unspecified</literallayout>
<itemizedlist>
<listitem>
<simpara>
Listing a single attribute:
</simpara>
</listitem>
</itemizedlist>
<literallayout>$ git check-attr diff org/example/MyClass.java
org/example/MyClass.java: diff: java</literallayout>
<itemizedlist>
<listitem>
<simpara>
Listing multiple attributes for a file:
</simpara>
</listitem>
</itemizedlist>
<literallayout>$ git check-attr crlf diff myAttr -- org/example/MyClass.java
org/example/MyClass.java: crlf: unset
org/example/MyClass.java: diff: java
org/example/MyClass.java: myAttr: set</literallayout>
<itemizedlist>
<listitem>
<simpara>
Listing attribute for multiple files:
</simpara>
</listitem>
</itemizedlist>
<literallayout>$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
org/example/MyClass.java: myAttr: set
org/example/NoMyAttr.java: myAttr: unspecified</literallayout>
<itemizedlist>
<listitem>
<simpara>
Not all values are equally unambiguous:
</simpara>
</listitem>
</itemizedlist>
<literallayout>$ git check-attr caveat README
README: caveat: unspecified</literallayout>
</simplesect>
<simplesect id="_see_also">
<title>SEE ALSO</title>
<simpara><xref linkend="gitattributes(5)"/>.</simpara>
</simplesect>
<simplesect id="_author">
<title>Author</title>
<simpara>Written by Junio C Hamano &lt;<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>&gt;</simpara>
</simplesect>
<simplesect id="_documentation">
<title>Documentation</title>
<simpara>Documentation by James Bowes.</simpara>
</simplesect>
<simplesect id="_git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
</simplesect>
</article>
