{
    "mode": "info",
    "parameter": "git-update-index",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/git-update-index/json",
    "generated": "2026-07-13T13:36:09Z",
    "synopsis": "git update-index\n[--add] [--remove | --force-remove] [--replace]\n[--refresh] [-q] [--unmerged] [--ignore-missing]\n[(--cacheinfo <mode>,<object>,<file>)...]\n[--chmod=(+|-)x]\n[--[no-]assume-unchanged]\n[--[no-]skip-worktree]\n[--[no-]ignore-skip-worktree-entries]\n[--[no-]fsmonitor-valid]\n[--ignore-submodules]\n[--[no-]split-index]\n[--[no-|test-|force-]untracked-cache]\n[--[no-]fsmonitor]\n[--really-refresh] [--unresolve] [--again | -g]\n[--info-only] [--index-info]\n[-z] [--stdin] [--index-version <n>]\n[--verbose]\n[--] [<file>...]",
    "sections": {
        "NAME": {
            "content": "git-update-index - Register file contents in the working tree to the\nindex\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git update-index\n[--add] [--remove | --force-remove] [--replace]\n[--refresh] [-q] [--unmerged] [--ignore-missing]\n[(--cacheinfo <mode>,<object>,<file>)...]\n[--chmod=(+|-)x]\n[--[no-]assume-unchanged]\n[--[no-]skip-worktree]\n[--[no-]ignore-skip-worktree-entries]\n[--[no-]fsmonitor-valid]\n[--ignore-submodules]\n[--[no-]split-index]\n[--[no-|test-|force-]untracked-cache]\n[--[no-]fsmonitor]\n[--really-refresh] [--unresolve] [--again | -g]\n[--info-only] [--index-info]\n[-z] [--stdin] [--index-version <n>]\n[--verbose]\n[--] [<file>...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Modifies the index. Each file mentioned is updated into the index and\nany unmerged or needs updating state is cleared.\n\nSee also git-add(1) for a more user-friendly way to do some of the most\ncommon operations on the index.\n\nThe way git update-index handles files it is told about can be modified\nusing the various options:\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--add",
                    "content": "If a specified file isn't in the index already then it's added.\nDefault behaviour is to ignore new files.\n",
                    "long": "--add"
                },
                {
                    "name": "--remove",
                    "content": "If a specified file is in the index but is missing then it's\nremoved. Default behavior is to ignore removed file.\n",
                    "long": "--remove"
                },
                {
                    "name": "--refresh",
                    "content": "Looks at the current index and checks to see if merges or updates\nare needed by checking stat() information.\n",
                    "long": "--refresh"
                },
                {
                    "name": "-q",
                    "content": "Quiet. If --refresh finds that the index needs an update, the\ndefault behavior is to error out. This option makes git\nupdate-index continue anyway.\n",
                    "flag": "-q"
                },
                {
                    "name": "--ignore-submodules",
                    "content": "Do not try to update submodules. This option is only respected when\npassed before --refresh.\n",
                    "long": "--ignore-submodules"
                },
                {
                    "name": "--unmerged",
                    "content": "If --refresh finds unmerged changes in the index, the default\nbehavior is to error out. This option makes git update-index\ncontinue anyway.\n",
                    "long": "--unmerged"
                },
                {
                    "name": "--ignore-missing",
                    "content": "Ignores missing files during a --refresh\n\n--cacheinfo <mode>,<object>,<path>, --cacheinfo <mode> <object> <path>\nDirectly insert the specified info into the index. For backward\ncompatibility, you can also give these three arguments as three\nseparate parameters, but new users are encouraged to use a\nsingle-parameter form.\n",
                    "long": "--ignore-missing"
                },
                {
                    "name": "--index-info",
                    "content": "Read index information from stdin.\n\n--chmod=(+|-)x\nSet the execute permissions on the updated files.\n\n--[no-]assume-unchanged\nWhen this flag is specified, the object names recorded for the\npaths are not updated. Instead, this option sets/unsets the \"assume\nunchanged\" bit for the paths. When the \"assume unchanged\" bit is\non, the user promises not to change the file and allows Git to\nassume that the working tree file matches what is recorded in the\nindex. If you want to change the working tree file, you need to\nunset the bit to tell Git. This is sometimes helpful when working\nwith a big project on a filesystem that has very slow lstat(2)\nsystem call (e.g. cifs).\n\nGit will fail (gracefully) in case it needs to modify this file in\nthe index e.g. when merging in a commit; thus, in case the\nassumed-untracked file is changed upstream, you will need to handle\nthe situation manually.\n",
                    "long": "--index-info"
                },
                {
                    "name": "--really-refresh",
                    "content": "Like --refresh, but checks stat information unconditionally,\nwithout regard to the \"assume unchanged\" setting.\n\n--[no-]skip-worktree\nWhen one of these flags is specified, the object name recorded for\nthe paths are not updated. Instead, these options set and unset the\n\"skip-worktree\" bit for the paths. See section \"Skip-worktree bit\"\nbelow for more information.\n\n--[no-]ignore-skip-worktree-entries\nDo not remove skip-worktree (AKA \"index-only\") entries even when\nthe --remove option was specified.\n\n--[no-]fsmonitor-valid\nWhen one of these flags is specified, the object name recorded for\nthe paths are not updated. Instead, these options set and unset the\n\"fsmonitor valid\" bit for the paths. See section \"File System\nMonitor\" below for more information.\n",
                    "long": "--really-refresh"
                },
                {
                    "name": "-g, --again",
                    "content": "Runs git update-index itself on the paths whose index entries are\ndifferent from those from the HEAD commit.\n",
                    "flag": "-g",
                    "long": "--again"
                },
                {
                    "name": "--unresolve",
                    "content": "Restores the unmerged or needs updating state of a file during a\nmerge if it was cleared by accident.\n",
                    "long": "--unresolve"
                },
                {
                    "name": "--info-only",
                    "content": "Do not create objects in the object database for all <file>\narguments that follow this flag; just insert their object IDs into\nthe index.\n",
                    "long": "--info-only"
                },
                {
                    "name": "--force-remove",
                    "content": "Remove the file from the index even when the working directory\nstill has such a file. (Implies --remove.)\n",
                    "long": "--force-remove"
                },
                {
                    "name": "--replace",
                    "content": "By default, when a file path exists in the index, git update-index\nrefuses an attempt to add path/file. Similarly if a file path/file\nexists, a file path cannot be added. With --replace flag, existing\nentries that conflict with the entry being added are automatically\nremoved with warning messages.\n",
                    "long": "--replace"
                },
                {
                    "name": "--stdin",
                    "content": "Instead of taking list of paths from the command line, read list of\npaths from the standard input. Paths are separated by LF (i.e. one\npath per line) by default.\n",
                    "long": "--stdin"
                },
                {
                    "name": "--verbose",
                    "content": "Report what is being added and removed from index.\n",
                    "long": "--verbose"
                },
                {
                    "name": "--index-version <n>",
                    "content": "Write the resulting index out in the named on-disk format version.\nSupported versions are 2, 3 and 4. The current default version is 2\nor 3, depending on whether extra features are used, such as git add\n-N.\n\nVersion 4 performs a simple pathname compression that reduces index\nsize by 30%-50% on large repositories, which results in faster load\ntime. Version 4 is relatively young (first released in 1.8.0 in\nOctober 2012). Other Git implementations such as JGit and libgit2\nmay not support it yet.\n",
                    "long": "--index-version",
                    "arg": "<n>"
                },
                {
                    "name": "-z",
                    "content": "Only meaningful with --stdin or --index-info; paths are separated\nwith NUL character instead of LF.\n",
                    "flag": "-z"
                },
                {
                    "name": "--split-index, --no-split-index",
                    "content": "Enable or disable split index mode. If split-index mode is already\nenabled and --split-index is given again, all changes in\n$GITDIR/index are pushed back to the shared index file.\n\nThese options take effect whatever the value of the core.splitIndex\nconfiguration variable (see git-config(1)). But a warning is\nemitted when the change goes against the configured value, as the\nconfigured value will take effect next time the index is read and\nthis will remove the intended effect of the option.\n",
                    "long": "--no-split-index"
                },
                {
                    "name": "--untracked-cache, --no-untracked-cache",
                    "content": "Enable or disable untracked cache feature. Please use\n--test-untracked-cache before enabling it.\n\nThese options take effect whatever the value of the\ncore.untrackedCache configuration variable (see git-config(1)). But\na warning is emitted when the change goes against the configured\nvalue, as the configured value will take effect next time the index\nis read and this will remove the intended effect of the option.\n",
                    "long": "--no-untracked-cache"
                },
                {
                    "name": "--test-untracked-cache",
                    "content": "Only perform tests on the working directory to make sure untracked\ncache can be used. You have to manually enable untracked cache\nusing --untracked-cache or --force-untracked-cache or the\ncore.untrackedCache configuration variable afterwards if you really\nwant to use it. If a test fails the exit code is 1 and a message\nexplains what is not working as needed, otherwise the exit code is\n0 and OK is printed.\n",
                    "long": "--test-untracked-cache"
                },
                {
                    "name": "--force-untracked-cache",
                    "content": "Same as --untracked-cache. Provided for backwards compatibility\nwith older versions of Git where --untracked-cache used to imply\n--test-untracked-cache but this option would enable the extension\nunconditionally.\n",
                    "long": "--force-untracked-cache"
                },
                {
                    "name": "--fsmonitor, --no-fsmonitor",
                    "content": "Enable or disable files system monitor feature. These options take\neffect whatever the value of the core.fsmonitor configuration\nvariable (see git-config(1)). But a warning is emitted when the\nchange goes against the configured value, as the configured value\nwill take effect next time the index is read and this will remove\nthe intended effect of the option.\n\n--\nDo not interpret any more arguments as options.\n\n<file>\nFiles to act on. Note that files beginning with .  are discarded.\nThis includes ./file and dir/./file. If you don't want this, then\nuse cleaner names. The same applies to directories ending / and\npaths with //\n",
                    "long": "--no-fsmonitor"
                }
            ]
        },
        "USING --REFRESH": {
            "content": "--refresh does not calculate a new sha1 file or bring the index up to\ndate for mode/content changes. But what it does do is to \"re-match\" the\nstat information of a file with the index, so that you can refresh the\nindex for a file that hasn't been changed but where the stat entry is\nout of date.\n\nFor example, you'd want to do this after doing a git read-tree, to link\nup the stat index details with the proper files.\n",
            "subsections": []
        },
        "USING --CACHEINFO OR --INFO-ONLY": {
            "content": "--cacheinfo is used to register a file that is not in the current\nworking directory. This is useful for minimum-checkout merging.\n\nTo pretend you have a file at path with mode and sha1, say:\n\n$ git update-index --add --cacheinfo <mode>,<sha1>,<path>\n\n--info-only is used to register files without placing them in the\nobject database. This is useful for status-only repositories.\n\nBoth --cacheinfo and --info-only behave similarly: the index is updated\nbut the object database isn't. --cacheinfo is useful when the object is\nin the database but the file isn't available locally. --info-only is\nuseful when the file is available, but you do not wish to update the\nobject database.\n",
            "subsections": []
        },
        "USING --INDEX-INFO": {
            "content": "--index-info is a more powerful mechanism that lets you feed multiple\nentry definitions from the standard input, and designed specifically\nfor scripts. It can take inputs of three formats:\n\n1. mode SP type SP sha1 TAB path\n\nThis format is to stuff git ls-tree output into the index.\n\n2. mode SP sha1 SP stage TAB path\n\nThis format is to put higher order stages into the index file and\nmatches git ls-files --stage output.\n\n3. mode SP sha1 TAB path\n\nThis format is no longer produced by any Git command, but is and\nwill continue to be supported by update-index --index-info.\n\nTo place a higher stage entry to the index, the path should first be\nremoved by feeding a mode=0 entry for the path, and then feeding\nnecessary input lines in the third format.\n\nFor example, starting with this index:\n\n$ git ls-files -s\n100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0       frotz\n\nyou can feed the following input to --index-info:\n\n$ git update-index --index-info\n0 0000000000000000000000000000000000000000      frotz\n100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1       frotz\n100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2       frotz\n\nThe first line of the input feeds 0 as the mode to remove the path; the\nSHA-1 does not matter as long as it is well formatted. Then the second\nand third line feeds stage 1 and stage 2 entries for that path. After\nthe above, we would end up with this:\n\n$ git ls-files -s\n100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1       frotz\n100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2       frotz\n\nUSING \"ASSUME UNCHANGED\" BIT\nMany operations in Git depend on your filesystem to have an efficient\nlstat(2) implementation, so that stmtime information for working tree\nfiles can be cheaply checked to see if the file contents have changed\nfrom the version recorded in the index file. Unfortunately, some\nfilesystems have inefficient lstat(2). If your filesystem is one of\nthem, you can set \"assume unchanged\" bit to paths you have not changed\nto cause Git not to do this check. Note that setting this bit on a path\ndoes not mean Git will check the contents of the file to see if it has\nchanged -- it makes Git to omit any checking and assume it has not\nchanged. When you make changes to working tree files, you have to\nexplicitly tell Git about it by dropping \"assume unchanged\" bit, either\nbefore or after you modify them.\n\nIn order to set \"assume unchanged\" bit, use --assume-unchanged option.\nTo unset, use --no-assume-unchanged. To see which files have the\n\"assume unchanged\" bit set, use git ls-files -v (see git-ls-files(1)).\n\nThe command looks at core.ignorestat configuration variable. When this\nis true, paths updated with git update-index paths... and paths updated\nwith other Git commands that update both index and working tree (e.g.\ngit apply --index, git checkout-index -u, and git read-tree -u) are\nautomatically marked as \"assume unchanged\". Note that \"assume\nunchanged\" bit is not set if git update-index --refresh finds the\nworking tree file matches the index (use git update-index\n--really-refresh if you want to mark them as \"assume unchanged\").\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To update and refresh only the files already checked out:\n\n$ git checkout-index -n -f -a && git update-index --ignore-missing --refresh\n\nOn an inefficient filesystem with core.ignorestat set\n\n$ git update-index --really-refresh              (1)\n$ git update-index --no-assume-unchanged foo.c   (2)\n$ git diff --name-only                           (3)\n$ edit foo.c\n$ git diff --name-only                           (4)\nM foo.c\n$ git update-index foo.c                         (5)\n$ git diff --name-only                           (6)\n$ edit foo.c\n$ git diff --name-only                           (7)\n$ git update-index --no-assume-unchanged foo.c   (8)\n$ git diff --name-only                           (9)\nM foo.c\n\n1. forces lstat(2) to set \"assume unchanged\" bits for paths that\nmatch index.\n2. mark the path to be edited.\n3. this does lstat(2) and finds index matches the path.\n4. this does lstat(2) and finds index does not match the path.\n5. registering the new version to index sets \"assume unchanged\"\nbit.\n6. and it is assumed unchanged.\n7. even after you edit it.\n8. you can tell about the change after the fact.\n9. now it checks with lstat(2) and finds it has been changed.\n",
            "subsections": []
        },
        "SKIP-WORKTREE BIT": {
            "content": "Skip-worktree bit can be defined in one (long) sentence: When reading\nan entry, if it is marked as skip-worktree, then Git pretends its\nworking directory version is up to date and read the index version\ninstead.\n\nTo elaborate, \"reading\" means checking for file existence, reading file\nattributes or file content. The working directory version may be\npresent or absent. If present, its content may match against the index\nversion or not. Writing is not affected by this bit, content safety is\nstill first priority. Note that Git can update working directory file,\nthat is marked skip-worktree, if it is safe to do so (i.e. working\ndirectory version matches index version)\n\nAlthough this bit looks similar to assume-unchanged bit, its goal is\ndifferent from assume-unchanged bit's. Skip-worktree also takes\nprecedence over assume-unchanged bit when both are set.\n",
            "subsections": []
        },
        "SPLIT INDEX": {
            "content": "This mode is designed for repositories with very large indexes, and\naims at reducing the time it takes to repeatedly write these indexes.\n\nIn this mode, the index is split into two files, $GITDIR/index and\n$GITDIR/sharedindex.<SHA-1>. Changes are accumulated in\n$GITDIR/index, the split index, while the shared index file contains\nall index entries and stays unchanged.\n\nAll changes in the split index are pushed back to the shared index file\nwhen the number of entries in the split index reaches a level specified\nby the splitIndex.maxPercentChange config variable (see git-config(1)).\n\nEach time a new shared index file is created, the old shared index\nfiles are deleted if their modification time is older than what is\nspecified by the splitIndex.sharedIndexExpire config variable (see git-\nconfig(1)).\n\nTo avoid deleting a shared index file that is still used, its\nmodification time is updated to the current time every time a new split\nindex based on the shared index file is either created or read from.\n",
            "subsections": []
        },
        "UNTRACKED CACHE": {
            "content": "This cache is meant to speed up commands that involve determining\nuntracked files such as git status.\n\nThis feature works by recording the mtime of the working tree\ndirectories and then omitting reading directories and stat calls\nagainst files in those directories whose mtime hasn't changed. For this\nto work the underlying operating system and file system must change the\nstmtime field of directories if files in the directory are added,\nmodified or deleted.\n\nYou can test whether the filesystem supports that with the\n--test-untracked-cache option. The --untracked-cache option used to\nimplicitly perform that test in older versions of Git, but that's no\nlonger the case.\n\nIf you want to enable (or disable) this feature, it is easier to use\nthe core.untrackedCache configuration variable (see git-config(1)) than\nusing the --untracked-cache option to git update-index in each\nrepository, especially if you want to do so across all repositories you\nuse, because you can set the configuration variable to true (or false)\nin your $HOME/.gitconfig just once and have it affect all repositories\nyou touch.\n\nWhen the core.untrackedCache configuration variable is changed, the\nuntracked cache is added to or removed from the index the next time a\ncommand reads the index; while when --[no-|force-]untracked-cache are\nused, the untracked cache is immediately added to or removed from the\nindex.\n\nBefore 2.17, the untracked cache had a bug where replacing a directory\nwith a symlink to another directory could cause it to incorrectly show\nfiles tracked by git as untracked. See the \"status: add a failing test\nshowing a core.untrackedCache bug\" commit to git.git. A workaround for\nthat is (and this might work for other undiscovered bugs in the\nfuture):\n\n$ git -c core.untrackedCache=false status\n\nThis bug has also been shown to affect non-symlink cases of replacing a\ndirectory with a file when it comes to the internal structures of the\nuntracked cache, but no case has been reported where this resulted in\nwrong \"git status\" output.\n\nThere are also cases where existing indexes written by git versions\nbefore 2.17 will reference directories that don't exist anymore,\npotentially causing many \"could not open directory\" warnings to be\nprinted on \"git status\". These are new warnings for existing issues\nthat were previously silently discarded.\n\nAs with the bug described above the solution is to one-off do a \"git\nstatus\" run with core.untrackedCache=false to flush out the leftover\nbad data.\n",
            "subsections": []
        },
        "FILE SYSTEM MONITOR": {
            "content": "This feature is intended to speed up git operations for repos that have\nlarge working directories.\n\nIt enables git to work together with a file system monitor (see the\n\"fsmonitor-watchman\" section of githooks(5)) that can inform it as to\nwhat files have been modified. This enables git to avoid having to\nlstat() every file to find modified files.\n\nWhen used in conjunction with the untracked cache, it can further\nimprove performance by avoiding the cost of scanning the entire working\ndirectory looking for new files.\n\nIf you want to enable (or disable) this feature, it is easier to use\nthe core.fsmonitor configuration variable (see git-config(1)) than\nusing the --fsmonitor option to git update-index in each repository,\nespecially if you want to do so across all repositories you use,\nbecause you can set the configuration variable in your $HOME/.gitconfig\njust once and have it affect all repositories you touch.\n\nWhen the core.fsmonitor configuration variable is changed, the file\nsystem monitor is added to or removed from the index the next time a\ncommand reads the index. When --[no-]fsmonitor are used, the file\nsystem monitor is immediately added to or removed from the index.\n",
            "subsections": []
        },
        "CONFIGURATION": {
            "content": "The command honors core.filemode configuration variable. If your\nrepository is on a filesystem whose executable bits are unreliable,\nthis should be set to false (see git-config(1)). This causes the\ncommand to ignore differences in file modes recorded in the index and\nthe file mode on the filesystem if they differ only on executable bit.\nOn such an unfortunate filesystem, you may need to use git update-index\n--chmod=.\n\nQuite similarly, if core.symlinks configuration variable is set to\nfalse (see git-config(1)), symbolic links are checked out as plain\nfiles, and this command does not modify a recorded file mode from\nsymbolic link to regular file.\n\nThe command looks at core.ignorestat configuration variable. See Using\n\"assume unchanged\" bit section above.\n\nThe command also looks at core.trustctime configuration variable. It\ncan be useful when the inode change time is regularly modified by\nsomething outside Git (file system crawlers and backup systems use\nctime for marking files processed) (see git-config(1)).\n\nThe untracked cache extension can be enabled by the core.untrackedCache\nconfiguration variable (see git-config(1)).\n",
            "subsections": []
        },
        "NOTES": {
            "content": "Users often try to use the assume-unchanged and skip-worktree bits to\ntell Git to ignore changes to files that are tracked. This does not\nwork as expected, since Git may still check working tree files against\nthe index when performing certain operations. In general, Git does not\nprovide a way to ignore changes to tracked files, so alternate\nsolutions are recommended.\n\nFor example, if the file you want to change is some sort of config\nfile, the repository can include a sample config file that can then be\ncopied into the ignored name and modified. The repository can even\ninclude a script to treat the sample file as a template, modifying and\ncopying it automatically.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "git-config(1), git-add(1), git-ls-files(1)\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n\nGit 2.34.1                        02/26/2026               GIT-UPDATE-INDEX(1)",
            "subsections": []
        }
    },
    "summary": "git-update-index - Register file contents in the working tree to the index",
    "flags": [
        {
            "flag": "",
            "long": "--add",
            "arg": null,
            "description": "If a specified file isn't in the index already then it's added. Default behaviour is to ignore new files."
        },
        {
            "flag": "",
            "long": "--remove",
            "arg": null,
            "description": "If a specified file is in the index but is missing then it's removed. Default behavior is to ignore removed file."
        },
        {
            "flag": "",
            "long": "--refresh",
            "arg": null,
            "description": "Looks at the current index and checks to see if merges or updates are needed by checking stat() information."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "Quiet. If --refresh finds that the index needs an update, the default behavior is to error out. This option makes git update-index continue anyway."
        },
        {
            "flag": "",
            "long": "--ignore-submodules",
            "arg": null,
            "description": "Do not try to update submodules. This option is only respected when passed before --refresh."
        },
        {
            "flag": "",
            "long": "--unmerged",
            "arg": null,
            "description": "If --refresh finds unmerged changes in the index, the default behavior is to error out. This option makes git update-index continue anyway."
        },
        {
            "flag": "",
            "long": "--ignore-missing",
            "arg": null,
            "description": "Ignores missing files during a --refresh --cacheinfo <mode>,<object>,<path>, --cacheinfo <mode> <object> <path> Directly insert the specified info into the index. For backward compatibility, you can also give these three arguments as three separate parameters, but new users are encouraged to use a single-parameter form."
        },
        {
            "flag": "",
            "long": "--index-info",
            "arg": null,
            "description": "Read index information from stdin. --chmod=(+|-)x Set the execute permissions on the updated files. --[no-]assume-unchanged When this flag is specified, the object names recorded for the paths are not updated. Instead, this option sets/unsets the \"assume unchanged\" bit for the paths. When the \"assume unchanged\" bit is on, the user promises not to change the file and allows Git to assume that the working tree file matches what is recorded in the index. If you want to change the working tree file, you need to unset the bit to tell Git. This is sometimes helpful when working with a big project on a filesystem that has very slow lstat(2) system call (e.g. cifs). Git will fail (gracefully) in case it needs to modify this file in the index e.g. when merging in a commit; thus, in case the assumed-untracked file is changed upstream, you will need to handle the situation manually."
        },
        {
            "flag": "",
            "long": "--really-refresh",
            "arg": null,
            "description": "Like --refresh, but checks stat information unconditionally, without regard to the \"assume unchanged\" setting. --[no-]skip-worktree When one of these flags is specified, the object name recorded for the paths are not updated. Instead, these options set and unset the \"skip-worktree\" bit for the paths. See section \"Skip-worktree bit\" below for more information. --[no-]ignore-skip-worktree-entries Do not remove skip-worktree (AKA \"index-only\") entries even when the --remove option was specified. --[no-]fsmonitor-valid When one of these flags is specified, the object name recorded for the paths are not updated. Instead, these options set and unset the \"fsmonitor valid\" bit for the paths. See section \"File System Monitor\" below for more information."
        },
        {
            "flag": "-g",
            "long": "--again",
            "arg": null,
            "description": "Runs git update-index itself on the paths whose index entries are different from those from the HEAD commit."
        },
        {
            "flag": "",
            "long": "--unresolve",
            "arg": null,
            "description": "Restores the unmerged or needs updating state of a file during a merge if it was cleared by accident."
        },
        {
            "flag": "",
            "long": "--info-only",
            "arg": null,
            "description": "Do not create objects in the object database for all <file> arguments that follow this flag; just insert their object IDs into the index."
        },
        {
            "flag": "",
            "long": "--force-remove",
            "arg": null,
            "description": "Remove the file from the index even when the working directory still has such a file. (Implies --remove.)"
        },
        {
            "flag": "",
            "long": "--replace",
            "arg": null,
            "description": "By default, when a file path exists in the index, git update-index refuses an attempt to add path/file. Similarly if a file path/file exists, a file path cannot be added. With --replace flag, existing entries that conflict with the entry being added are automatically removed with warning messages."
        },
        {
            "flag": "",
            "long": "--stdin",
            "arg": null,
            "description": "Instead of taking list of paths from the command line, read list of paths from the standard input. Paths are separated by LF (i.e. one path per line) by default."
        },
        {
            "flag": "",
            "long": "--verbose",
            "arg": null,
            "description": "Report what is being added and removed from index."
        },
        {
            "flag": "",
            "long": "--index-version",
            "arg": "<n>",
            "description": "Write the resulting index out in the named on-disk format version. Supported versions are 2, 3 and 4. The current default version is 2 or 3, depending on whether extra features are used, such as git add -N. Version 4 performs a simple pathname compression that reduces index size by 30%-50% on large repositories, which results in faster load time. Version 4 is relatively young (first released in 1.8.0 in October 2012). Other Git implementations such as JGit and libgit2 may not support it yet."
        },
        {
            "flag": "-z",
            "long": null,
            "arg": null,
            "description": "Only meaningful with --stdin or --index-info; paths are separated with NUL character instead of LF."
        },
        {
            "flag": "",
            "long": "--no-split-index",
            "arg": null,
            "description": "Enable or disable split index mode. If split-index mode is already enabled and --split-index is given again, all changes in $GITDIR/index are pushed back to the shared index file. These options take effect whatever the value of the core.splitIndex configuration variable (see git-config(1)). But a warning is emitted when the change goes against the configured value, as the configured value will take effect next time the index is read and this will remove the intended effect of the option."
        },
        {
            "flag": "",
            "long": "--no-untracked-cache",
            "arg": null,
            "description": "Enable or disable untracked cache feature. Please use --test-untracked-cache before enabling it. These options take effect whatever the value of the core.untrackedCache configuration variable (see git-config(1)). But a warning is emitted when the change goes against the configured value, as the configured value will take effect next time the index is read and this will remove the intended effect of the option."
        },
        {
            "flag": "",
            "long": "--test-untracked-cache",
            "arg": null,
            "description": "Only perform tests on the working directory to make sure untracked cache can be used. You have to manually enable untracked cache using --untracked-cache or --force-untracked-cache or the core.untrackedCache configuration variable afterwards if you really want to use it. If a test fails the exit code is 1 and a message explains what is not working as needed, otherwise the exit code is 0 and OK is printed."
        },
        {
            "flag": "",
            "long": "--force-untracked-cache",
            "arg": null,
            "description": "Same as --untracked-cache. Provided for backwards compatibility with older versions of Git where --untracked-cache used to imply --test-untracked-cache but this option would enable the extension unconditionally."
        },
        {
            "flag": "",
            "long": "--no-fsmonitor",
            "arg": null,
            "description": "Enable or disable files system monitor feature. These options take effect whatever the value of the core.fsmonitor configuration variable (see git-config(1)). But a warning is emitted when the change goes against the configured value, as the configured value will take effect next time the index is read and this will remove the intended effect of the option. -- Do not interpret any more arguments as options. <file> Files to act on. Note that files beginning with . are discarded. This includes ./file and dir/./file. If you don't want this, then use cleaner names. The same applies to directories ending / and paths with //"
        }
    ],
    "examples": [
        "To update and refresh only the files already checked out:",
        "$ git checkout-index -n -f -a && git update-index --ignore-missing --refresh",
        "On an inefficient filesystem with core.ignorestat set",
        "$ git update-index --really-refresh              (1)",
        "$ git update-index --no-assume-unchanged foo.c   (2)",
        "$ git diff --name-only                           (3)",
        "$ edit foo.c",
        "$ git diff --name-only                           (4)",
        "M foo.c",
        "$ git update-index foo.c                         (5)",
        "$ git diff --name-only                           (6)",
        "$ edit foo.c",
        "$ git diff --name-only                           (7)",
        "$ git update-index --no-assume-unchanged foo.c   (8)",
        "$ git diff --name-only                           (9)",
        "M foo.c",
        "1. forces lstat(2) to set \"assume unchanged\" bits for paths that",
        "match index.",
        "2. mark the path to be edited.",
        "3. this does lstat(2) and finds index matches the path.",
        "4. this does lstat(2) and finds index does not match the path.",
        "5. registering the new version to index sets \"assume unchanged\"",
        "bit.",
        "6. and it is assumed unchanged.",
        "7. even after you edit it.",
        "8. you can tell about the change after the fact.",
        "9. now it checks with lstat(2) and finds it has been changed."
    ],
    "see_also": [
        {
            "name": "git-config",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-config/1/json"
        },
        {
            "name": "git-add",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-add/1/json"
        },
        {
            "name": "git-ls-files",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-ls-files/1/json"
        }
    ]
}