{
    "content": [
        {
            "type": "text",
            "text": "# GIT-CHECK-ATTR (man)\n\n## NAME\n\ngit-check-attr - Display gitattributes information\n\n## SYNOPSIS\n\ngit check-attr [-a | --all | <attr>...] [--] <pathname>...\ngit check-attr --stdin [-z] [-a | --all | <attr>...]\n\n## DESCRIPTION\n\nFor every pathname, this command will list if each attribute is unspecified, set, or unset as\na gitattribute on that pathname.\n\n## TLDR\n\n> For every pathname, list if each attribute is unspecified, set, or unset as a gitattribute on that pathname.\n\n- Check the values of all attributes on a file:\n  `git check-attr {{-a|--all}} {{path/to/file}}`\n- Check the value of a specific attribute on a file:\n  `git check-attr {{attribute}} {{path/to/file}}`\n- Check the values of all attributes on specific files:\n  `git check-attr {{-a|--all}} {{path/to/file1 path/to/file2 ...}}`\n- Check the value of a specific attribute on one or more files:\n  `git check-attr {{attribute}} {{path/to/file1 path/to/file2 ...}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (4 subsections)\n- **OUTPUT**\n- **EXAMPLES**\n- **SEE ALSO**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "GIT-CHECK-ATTR",
        "section": "",
        "mode": "man",
        "summary": "git-check-attr - Display gitattributes information",
        "synopsis": "git check-attr [-a | --all | <attr>...] [--] <pathname>...\ngit check-attr --stdin [-z] [-a | --all | <attr>...]",
        "tldr_summary": "For every pathname, list if each attribute is unspecified, set, or unset as a gitattribute on that pathname.",
        "tldr_examples": [
            {
                "description": "Check the values of all attributes on a file",
                "command": "git check-attr {{-a|--all}} {{path/to/file}}"
            },
            {
                "description": "Check the value of a specific attribute on a file",
                "command": "git check-attr {{attribute}} {{path/to/file}}"
            },
            {
                "description": "Check the values of all attributes on specific files",
                "command": "git check-attr {{-a|--all}} {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Check the value of a specific attribute on one or more files",
                "command": "git check-attr {{attribute}} {{path/to/file1 path/to/file2 ...}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--all",
                "arg": null,
                "description": "List all attributes that are associated with the specified paths. If this option is used, then unspecified attributes will not be included in the output."
            },
            {
                "flag": "",
                "long": "--cached",
                "arg": null,
                "description": "Consider .gitattributes in the index only, ignoring the working tree."
            },
            {
                "flag": "",
                "long": "--stdin",
                "arg": null,
                "description": "Read pathnames from the standard input, one per line, instead of from the command-line."
            },
            {
                "flag": "-z",
                "long": null,
                "arg": null,
                "description": "The output format is modified to be machine-parsable. If --stdin is also given, input paths are separated with a NUL character instead of a linefeed character. -- Interpret all preceding arguments as attributes and all following arguments as path names. If none of --stdin, --all, or -- is used, the first argument will be treated as an attribute and the rest of the arguments as pathnames."
            }
        ],
        "examples": [
            "In the examples, the following .gitattributes file is used:",
            "*.java diff=java -crlf myAttr",
            "NoMyAttr.java !myAttr",
            "README caveat=unspecified",
            "•   Listing a single attribute:",
            "$ git check-attr diff org/example/MyClass.java",
            "org/example/MyClass.java: diff: java",
            "•   Listing multiple attributes for a file:",
            "$ 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",
            "•   Listing all attributes for a file:",
            "$ git check-attr --all -- org/example/MyClass.java",
            "org/example/MyClass.java: diff: java",
            "org/example/MyClass.java: myAttr: set",
            "•   Listing an attribute for multiple files:",
            "$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java",
            "org/example/MyClass.java: myAttr: set",
            "org/example/NoMyAttr.java: myAttr: unspecified",
            "•   Not all values are equally unambiguous:",
            "$ git check-attr caveat README",
            "README: caveat: unspecified"
        ],
        "see_also": [
            {
                "name": "gitattributes",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/gitattributes/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a, --all",
                        "lines": 3,
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "--cached",
                        "lines": 2,
                        "long": "--cached"
                    },
                    {
                        "name": "--stdin",
                        "lines": 2,
                        "long": "--stdin"
                    },
                    {
                        "name": "-z",
                        "lines": 10,
                        "flag": "-z"
                    }
                ]
            },
            {
                "name": "OUTPUT",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 46,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-check-attr - Display gitattributes information\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git check-attr [-a | --all | <attr>...] [--] <pathname>...\ngit check-attr --stdin [-z] [-a | --all | <attr>...]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "For every pathname, this command will list if each attribute is unspecified, set, or unset as\na gitattribute on that pathname.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-a, --all",
                        "content": "List all attributes that are associated with the specified paths. If this option is used,\nthen unspecified attributes will not be included in the output.\n",
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "--cached",
                        "content": "Consider .gitattributes in the index only, ignoring the working tree.\n",
                        "long": "--cached"
                    },
                    {
                        "name": "--stdin",
                        "content": "Read pathnames from the standard input, one per line, instead of from the command-line.\n",
                        "long": "--stdin"
                    },
                    {
                        "name": "-z",
                        "content": "The output format is modified to be machine-parsable. If --stdin is also given, input\npaths are separated with a NUL character instead of a linefeed character.\n\n--\nInterpret all preceding arguments as attributes and all following arguments as path\nnames.\n\nIf none of --stdin, --all, or -- is used, the first argument will be treated as an attribute\nand the rest of the arguments as pathnames.\n",
                        "flag": "-z"
                    }
                ]
            },
            "OUTPUT": {
                "content": "The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF\n\nunless -z is in effect, in which case NUL is used as delimiter: <path> NUL <attribute> NUL\n<info> NUL\n\n<path> is the path of a file being queried, <attribute> is an attribute being queried and\n<info> can be either:\n\nunspecified\nwhen the attribute is not defined for the path.\n\nunset\nwhen the attribute is defined as false.\n\nset\nwhen the attribute is defined as true.\n\n<value>\nwhen a value has been assigned to the attribute.\n\nBuffering happens as documented under the GITFLUSH option in git(1). The caller is\nresponsible for avoiding deadlocks caused by overfilling an input buffer or reading from an\nempty output buffer.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "In the examples, the following .gitattributes file is used:\n\n*.java diff=java -crlf myAttr\nNoMyAttr.java !myAttr\nREADME caveat=unspecified\n\n\n\n•   Listing a single attribute:\n\n$ git check-attr diff org/example/MyClass.java\norg/example/MyClass.java: diff: java\n\n\n\n•   Listing multiple attributes for a file:\n\n$ git check-attr crlf diff myAttr -- org/example/MyClass.java\norg/example/MyClass.java: crlf: unset\norg/example/MyClass.java: diff: java\norg/example/MyClass.java: myAttr: set\n\n\n\n•   Listing all attributes for a file:\n\n$ git check-attr --all -- org/example/MyClass.java\norg/example/MyClass.java: diff: java\norg/example/MyClass.java: myAttr: set\n\n\n\n•   Listing an attribute for multiple files:\n\n$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java\norg/example/MyClass.java: myAttr: set\norg/example/NoMyAttr.java: myAttr: unspecified\n\n\n\n•   Not all values are equally unambiguous:\n\n$ git check-attr caveat README\nREADME: caveat: unspecified\n\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "gitattributes(5).\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                            GIT-CHECK-ATTR(1)",
                "subsections": []
            }
        }
    }
}