{
    "mode": "info",
    "parameter": "git-status",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/git-status/json",
    "generated": "2026-07-10T20:28:26Z",
    "synopsis": "git status [<options>...] [--] [<pathspec>...]",
    "sections": {
        "NAME": {
            "content": "git-status - Show the working tree status\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git status [<options>...] [--] [<pathspec>...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Displays paths that have differences between the index file and the\ncurrent HEAD commit, paths that have differences between the working\ntree and the index file, and paths in the working tree that are not\ntracked by Git (and are not ignored by gitignore(5)). The first are\nwhat you would commit by running git commit; the second and third are\nwhat you could commit by running git add before running git commit.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-s, --short",
                    "content": "Give the output in the short-format.\n",
                    "flag": "-s",
                    "long": "--short"
                },
                {
                    "name": "-b, --branch",
                    "content": "Show the branch and tracking info even in short-format.\n",
                    "flag": "-b",
                    "long": "--branch"
                },
                {
                    "name": "--show-stash",
                    "content": "Show the number of entries currently stashed away.\n\n--porcelain[=<version>]\nGive the output in an easy-to-parse format for scripts. This is\nsimilar to the short output, but will remain stable across Git\nversions and regardless of user configuration. See below for\ndetails.\n\nThe version parameter is used to specify the format version. This\nis optional and defaults to the original version v1 format.\n",
                    "long": "--show-stash"
                },
                {
                    "name": "--long",
                    "content": "Give the output in the long-format. This is the default.\n",
                    "long": "--long"
                },
                {
                    "name": "-v, --verbose",
                    "content": "In addition to the names of files that have been changed, also show\nthe textual changes that are staged to be committed (i.e., like the\noutput of git diff --cached). If -v is specified twice, then also\nshow the changes in the working tree that have not yet been staged\n(i.e., like the output of git diff).\n\n-u[<mode>], --untracked-files[=<mode>]\nShow untracked files.\n\nThe mode parameter is used to specify the handling of untracked\nfiles. It is optional: it defaults to all, and if specified, it\nmust be stuck to the option (e.g.  -uno, but not -u no).\n\nThe possible options are:\n\no   no - Show no untracked files.\n\no   normal - Shows untracked files and directories.\n\no   all - Also shows individual files in untracked directories.\n\nWhen -u option is not used, untracked files and directories are\nshown (i.e. the same as specifying normal), to help you avoid\nforgetting to add newly created files. Because it takes extra work\nto find untracked files in the filesystem, this mode may take some\ntime in a large working tree. Consider enabling untracked cache and\nsplit index if supported (see git update-index --untracked-cache\nand git update-index --split-index), Otherwise you can use no to\nhave git status return more quickly without showing untracked\nfiles.\n\nThe default can be changed using the status.showUntrackedFiles\nconfiguration variable documented in git-config(1).\n\n--ignore-submodules[=<when>]\nIgnore changes to submodules when looking for changes. <when> can\nbe either \"none\", \"untracked\", \"dirty\" or \"all\", which is the\ndefault. Using \"none\" will consider the submodule modified when it\neither contains untracked or modified files or its HEAD differs\nfrom the commit recorded in the superproject and can be used to\noverride any settings of the ignore option in git-config(1) or\ngitmodules(5). When \"untracked\" is used submodules are not\nconsidered dirty when they only contain untracked content (but they\nare still scanned for modified content). Using \"dirty\" ignores all\nchanges to the work tree of submodules, only changes to the commits\nstored in the superproject are shown (this was the behavior before\n1.7.0). Using \"all\" hides all changes to submodules (and suppresses\nthe output of submodule summaries when the config option\nstatus.submoduleSummary is set).\n\n--ignored[=<mode>]\nShow ignored files as well.\n\nThe mode parameter is used to specify the handling of ignored\nfiles. It is optional: it defaults to traditional.\n\nThe possible options are:\n\no   traditional - Shows ignored files and directories, unless\n--untracked-files=all is specified, in which case individual\nfiles in ignored directories are displayed.\n\no   no - Show no ignored files.\n\no   matching - Shows ignored files and directories matching an\nignore pattern.\n\nWhen matching mode is specified, paths that explicitly match an\nignored pattern are shown. If a directory matches an ignore\npattern, then it is shown, but not paths contained in the ignored\ndirectory. If a directory does not match an ignore pattern, but all\ncontents are ignored, then the directory is not shown, but all\ncontents are shown.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-z",
                    "content": "Terminate entries with NUL, instead of LF. This implies the\n--porcelain=v1 output format if no other format is given.\n\n--column[=<options>], --no-column\nDisplay untracked files in columns. See configuration variable\ncolumn.status for option syntax.  --column and --no-column without\noptions are equivalent to always and never respectively.\n",
                    "flag": "-z"
                },
                {
                    "name": "--ahead-behind, --no-ahead-behind",
                    "content": "Display or do not display detailed ahead/behind counts for the\nbranch relative to its upstream branch. Defaults to true.\n",
                    "long": "--no-ahead-behind"
                },
                {
                    "name": "--renames, --no-renames",
                    "content": "Turn on/off rename detection regardless of user configuration. See\nalso git-diff(1) --no-renames.\n\n--find-renames[=<n>]\nTurn on rename detection, optionally setting the similarity\nthreshold. See also git-diff(1) --find-renames.\n\n<pathspec>...\nSee the pathspec entry in gitglossary(7).\n",
                    "long": "--no-renames"
                }
            ]
        },
        "OUTPUT": {
            "content": "The output from this command is designed to be used as a commit\ntemplate comment. The default, long format, is designed to be human\nreadable, verbose and descriptive. Its contents and format are subject\nto change at any time.\n\nThe paths mentioned in the output, unlike many other Git commands, are\nmade relative to the current directory if you are working in a\nsubdirectory (this is on purpose, to help cutting and pasting). See the\nstatus.relativePaths config option below.\n\nShort Format\nIn the short-format, the status of each path is shown as one of these\nforms\n\nXY PATH\nXY ORIGPATH -> PATH\n\nwhere ORIGPATH is where the renamed/copied contents came from.\nORIGPATH is only shown when the entry is renamed or copied. The XY is\na two-letter status code.\n\nThe fields (including the ->) are separated from each other by a single\nspace. If a filename contains whitespace or other nonprintable\ncharacters, that field will be quoted in the manner of a C string\nliteral: surrounded by ASCII double quote (34) characters, and with\ninterior special characters backslash-escaped.\n\nThere are three different types of states that are shown using this\nformat, and each one uses the XY syntax differently:\n\no   When a merge is occurring and the merge was successful, or outside\nof a merge situation, X shows the status of the index and Y shows\nthe status of the working tree.\n\no   When a merge conflict has occurred and has not yet been resolved, X\nand Y show the state introduced by each head of the merge, relative\nto the common ancestor. These paths are said to be unmerged.\n\no   When a path is untracked, X and Y are always the same, since they\nare unknown to the index.  ??  is used for untracked paths. Ignored\nfiles are not listed unless --ignored is used; if it is, ignored\nfiles are indicated by !!.\n\nNote that the term merge here also includes rebases using the default\n--merge strategy, cherry-picks, and anything else using the merge\nmachinery.\n\nIn the following table, these three classes are shown in separate\nsections, and these characters are used for X and Y fields for the\nfirst two sections that show tracked paths:\n\no   ' ' = unmodified\n\no   M = modified\n\no   T = file type changed (regular file, symbolic link or submodule)\n\no   A = added\n\no   D = deleted\n\no   R = renamed\n\no   C = copied (if config option status.renames is set to \"copies\")\n\no   U = updated but unmerged\n\n[AMD]   not updated\nM        [ MTD]  updated in index\nT        [ MTD]  type changed in index\nA        [ MTD]  added to index\nD                deleted from index\nR        [ MTD]  renamed in index\nC        [ MTD]  copied in index\n[MTARC]          index and work tree matches\n[ MTARC]    M    work tree changed since index\n[ MTARC]    T    type changed in work tree since index\n[ MTARC]    D    deleted in work tree\nR    renamed in work tree\nD           D    unmerged, both deleted\nA           U    unmerged, added by us\nU           D    unmerged, deleted by them\nU           A    unmerged, added by them\nD           U    unmerged, deleted by us\nA           A    unmerged, both added\n?           ?    untracked\n\nSubmodules have more state and instead report M the submodule has a\ndifferent HEAD than recorded in the index m the submodule has modified\ncontent ? the submodule has untracked files since modified content or\nuntracked files in a submodule cannot be added via git add in the\nsuperproject to prepare a commit.\n\nm and ? are applied recursively. For example if a nested submodule in a\nsubmodule contains an untracked file, this is reported as ? as well.\n\nIf -b is used the short-format status is preceded by a line\n\n## branchname tracking info\n\nPorcelain Format Version 1\nVersion 1 porcelain format is similar to the short format, but is\nguaranteed not to change in a backwards-incompatible way between Git\nversions or based on user configuration. This makes it ideal for\nparsing by scripts. The description of the short format above also\ndescribes the porcelain format, with a few exceptions:\n\n1. The user's color.status configuration is not respected; color will\nalways be off.\n\n2. The user's status.relativePaths configuration is not respected;\npaths shown will always be relative to the repository root.\n\nThere is also an alternate -z format recommended for machine parsing.\nIn that format, the status field is the same, but some other things\nchange. First, the -> is omitted from rename entries and the field\norder is reversed (e.g from -> to becomes to from). Second, a NUL\n(ASCII 0) follows each filename, replacing space as a field separator\nand the terminating newline (but a space still separates the status\nfield from the first filename). Third, filenames containing special\ncharacters are not specially formatted; no quoting or\nbackslash-escaping is performed.\n\nAny submodule changes are reported as modified M instead of m or single\n?.\n\nPorcelain Format Version 2\nVersion 2 format adds more detailed information about the state of the\nworktree and changed items. Version 2 also defines an extensible set of\neasy to parse optional headers.\n\nHeader lines start with \"#\" and are added in response to specific\ncommand line arguments. Parsers should ignore headers they don't\nrecognize.\n\nBranch Headers\nIf --branch is given, a series of header lines are printed with\ninformation about the current branch.\n\n# branch.oid <commit> | (initial)        Current commit.\n# branch.head <branch> | (detached)      Current branch.\n# branch.upstream <upstreambranch>      If upstream is set.\n# branch.ab +<ahead> -<behind>           If upstream is set and\n\nChanged Tracked Entries\nFollowing the headers, a series of lines are printed for tracked\nentries. One of three different line formats may be used to\ndescribe an entry depending on the type of change. Tracked entries\nare printed in an undefined order; parsers should allow for a\nmixture of the 3 line types in any order.\n\nOrdinary changed entries have the following format:\n\n1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>\n\nRenamed or copied entries have the following format:\n\n2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>\n\n<XY>        A 2 character field containing the staged and\nunstaged XY values described in the short format,\nwith unchanged indicated by a \".\" rather than\na space.\n<sub>       A 4 character field describing the submodule state.\n\"N...\" when the entry is not a submodule.\n\"S<c><m><u>\" when the entry is a submodule.\n<c> is \"C\" if the commit changed; otherwise \".\".\n<m> is \"M\" if it has tracked changes; otherwise \".\".\n<u> is \"U\" if there are untracked changes; otherwise \".\".\n<mH>        The octal file mode in HEAD.\n<mI>        The octal file mode in the index.\n<mW>        The octal file mode in the worktree.\n<hH>        The object name in HEAD.\n<hI>        The object name in the index.\n<X><score>  The rename or copy score (denoting the percentage\nof similarity between the source and target of the\nmove or copy). For example \"R100\" or \"C75\".\n<path>      The pathname.  In a renamed/copied entry, this\nis the target path.\n<sep>       When the `-z` option is used, the 2 pathnames are separated\nwith a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)\nbyte separates them.\n<origPath>  The pathname in the commit at HEAD or in the index.\nThis is only present in a renamed/copied entry, and\n\nUnmerged entries have the following format; the first character is\na \"u\" to distinguish from ordinary changed entries.\n\nu <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>\n\n<XY>        A 2 character field describing the conflict type\nas described in the short format.\n<sub>       A 4 character field describing the submodule state\nas described above.\n<m1>        The octal file mode in stage 1.\n<m2>        The octal file mode in stage 2.\n<m3>        The octal file mode in stage 3.\n<mW>        The octal file mode in the worktree.\n<h1>        The object name in stage 1.\n<h2>        The object name in stage 2.\n<h3>        The object name in stage 3.\n\nOther Items\nFollowing the tracked entries (and if requested), a series of lines\nwill be printed for untracked and then ignored items found in the\nworktree.\n\nUntracked items have the following format:\n\n? <path>\n\nIgnored items have the following format:\n\n! <path>\n\nPathname Format Notes and -z\nWhen the -z option is given, pathnames are printed as is and\nwithout any quoting and lines are terminated with a NUL (ASCII\n0x00) byte.\n\nWithout the -z option, pathnames with \"unusual\" characters are\nquoted as explained for the configuration variable core.quotePath\n(see git-config(1)).\n",
            "subsections": []
        },
        "CONFIGURATION": {
            "content": "The command honors color.status (or status.color -- they mean the same\nthing and the latter is kept for backward compatibility) and\ncolor.status.<slot> configuration variables to colorize its output.\n\nIf the config variable status.relativePaths is set to false, then all\npaths shown are relative to the repository root, not to the current\ndirectory.\n\nIf status.submoduleSummary is set to a non zero number or true\n(identical to -1 or an unlimited number), the submodule summary will be\nenabled for the long format and a summary of commits for modified\nsubmodules will be shown (see --summary-limit option of git-\nsubmodule(1)). Please note that the summary output from the status\ncommand will be suppressed for all submodules when\ndiff.ignoreSubmodules is set to all or only for those submodules where\nsubmodule.<name>.ignore=all. To also view the summary for ignored\nsubmodules you can either use the --ignore-submodules=dirty command\nline option or the git submodule summary command, which shows a similar\noutput but does not honor these settings.\n",
            "subsections": []
        },
        "BACKGROUND REFRESH": {
            "content": "By default, git status will automatically refresh the index, updating\nthe cached stat information from the working tree and writing out the\nresult. Writing out the updated index is an optimization that isn't\nstrictly necessary (status computes the values for itself, but writing\nthem out is just to save subsequent programs from repeating our\ncomputation). When status is run in the background, the lock held\nduring the write may conflict with other simultaneous processes,\ncausing them to fail. Scripts running status in the background should\nconsider using git --no-optional-locks status (see git(1) for details).\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gitignore(5)\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n\nGit 2.34.1                        02/26/2026                     GIT-STATUS(1)",
            "subsections": []
        }
    },
    "summary": "git-status - Show the working tree status",
    "flags": [
        {
            "flag": "-s",
            "long": "--short",
            "arg": null,
            "description": "Give the output in the short-format."
        },
        {
            "flag": "-b",
            "long": "--branch",
            "arg": null,
            "description": "Show the branch and tracking info even in short-format."
        },
        {
            "flag": "",
            "long": "--show-stash",
            "arg": null,
            "description": "Show the number of entries currently stashed away. --porcelain[=<version>] Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Git versions and regardless of user configuration. See below for details. The version parameter is used to specify the format version. This is optional and defaults to the original version v1 format."
        },
        {
            "flag": "",
            "long": "--long",
            "arg": null,
            "description": "Give the output in the long-format. This is the default."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "In addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i.e., like the output of git diff --cached). If -v is specified twice, then also show the changes in the working tree that have not yet been staged (i.e., like the output of git diff). -u[<mode>], --untracked-files[=<mode>] Show untracked files. The mode parameter is used to specify the handling of untracked files. It is optional: it defaults to all, and if specified, it must be stuck to the option (e.g. -uno, but not -u no). The possible options are: o no - Show no untracked files. o normal - Shows untracked files and directories. o all - Also shows individual files in untracked directories. When -u option is not used, untracked files and directories are shown (i.e. the same as specifying normal), to help you avoid forgetting to add newly created files. Because it takes extra work to find untracked files in the filesystem, this mode may take some time in a large working tree. Consider enabling untracked cache and split index if supported (see git update-index --untracked-cache and git update-index --split-index), Otherwise you can use no to have git status return more quickly without showing untracked files. The default can be changed using the status.showUntrackedFiles configuration variable documented in git-config(1). --ignore-submodules[=<when>] Ignore changes to submodules when looking for changes. <when> can be either \"none\", \"untracked\", \"dirty\" or \"all\", which is the default. Using \"none\" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the ignore option in git-config(1) or gitmodules(5). When \"untracked\" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content). Using \"dirty\" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior before 1.7.0). Using \"all\" hides all changes to submodules (and suppresses the output of submodule summaries when the config option status.submoduleSummary is set). --ignored[=<mode>] Show ignored files as well. The mode parameter is used to specify the handling of ignored files. It is optional: it defaults to traditional. The possible options are: o traditional - Shows ignored files and directories, unless --untracked-files=all is specified, in which case individual files in ignored directories are displayed. o no - Show no ignored files. o matching - Shows ignored files and directories matching an ignore pattern. When matching mode is specified, paths that explicitly match an ignored pattern are shown. If a directory matches an ignore pattern, then it is shown, but not paths contained in the ignored directory. If a directory does not match an ignore pattern, but all contents are ignored, then the directory is not shown, but all contents are shown."
        },
        {
            "flag": "-z",
            "long": null,
            "arg": null,
            "description": "Terminate entries with NUL, instead of LF. This implies the --porcelain=v1 output format if no other format is given. --column[=<options>], --no-column Display untracked files in columns. See configuration variable column.status for option syntax. --column and --no-column without options are equivalent to always and never respectively."
        },
        {
            "flag": "",
            "long": "--no-ahead-behind",
            "arg": null,
            "description": "Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch. Defaults to true."
        },
        {
            "flag": "",
            "long": "--no-renames",
            "arg": null,
            "description": "Turn on/off rename detection regardless of user configuration. See also git-diff(1) --no-renames. --find-renames[=<n>] Turn on rename detection, optionally setting the similarity threshold. See also git-diff(1) --find-renames. <pathspec>... See the pathspec entry in gitglossary(7)."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "gitignore",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/gitignore/5/json"
        }
    ]
}