GIT-UPDATE-INDEX(1) Git Manual GIT-UPDATE-INDEX(1) (NAME) git-update-index - (SYNOPSIS) git update-index [--add] [--remove | --force-remove] [--replace] [--refresh] [-q] [--unmerged] [--ignore-missing] [(--cacheinfo ,,)...] [--chmod=(+|-)x] [--[no-]assume-unchanged] [--[no-]skip-worktree] [--[no-]ignore-skip-worktree-entries] [--[no-]fsmonitor-valid] [--ignore-submodules] [--[no-]split-index] [--[no-|test-|force-]untracked-cache] [--[no-]fsmonitor] [--really-refresh] [--unresolve] [--again | -g] [--info-only] [--index-info] [-z] [--stdin] [--index-version ] [--show-index-version] [--verbose] [--] [...] (DESCRIPTION) . unmerged () needs updating ( ) . git-add(1) . git update-index : (OPTIONS) --add . . --remove ( ) . . --refresh stat() . -q (Quiet). --refresh . git update-index . --ignore-submodules . --refresh . --unmerged --refresh . git update-index . --ignore-missing --refresh . --cacheinfo ,,, --cacheinfo . . --index-info (stdin) . --chmod=(+|-)x (execute) . --assume-unchanged, --no-assume-unchanged . <> ( ) . <> . . lstat(2) ( cifs) . ( ) ( ) . --really-refresh --refresh stat <> . --skip-worktree, --no-skip-worktree . <> ( ) . << SKIP-WORKTREE>> . --ignore-skip-worktree-entries, --no-ignore-skip-worktree-entries skip-worktree ( << >> index-only) --remove . --fsmonitor-valid, --no-fsmonitor-valid . <> ( ) . << >> . -g, --again git update-index HEAD . --unresolve unmerged () needs updating ( ) . --info-only . --force-remove . ( --remove .) --replace path git update-index path/file . path/file path . --replace . --stdin . LF ( ) . --verbose . --index-version . 2 3 4 . 2 3 git add -N. --verbose . 4 30% 50% . 1.8.0 2012 2016 libgit2 2020 JGit . << >> . --show-index-version . --index-version . -z --stdin --index-info LF NUL . --split-index, --no-split-index (split index) . --split-index $GIT_DIR/index . core.splitIndex ( git-config(1)). . --untracked-cache, --no-untracked-cache (untracked cache) . --test-untracked-cache . core.untrackedCache ( git-config(1)). . --test-untracked-cache . --untracked-cache --force-untracked-cache core.untrackedCache . 1 0 OK . --force-untracked-cache --untracked-cache . --untracked-cache --test-untracked-cache . --fsmonitor, --no-fsmonitor (file system monitor) . core.fsmonitor ( git-config(1)). . -- . . . . ./file dir/./file . . / // . --REFRESH (USING --REFRESH) --refresh sha1 . stat << >> stat . git read-tree stat . --CACHEINFO --INFO-ONLY (USING --CACHEINFO OR --INFO-ONLY) --cacheinfo . (minimum-checkout merging) . (mode) sha1 : $ git update-index --add --cacheinfo ,, --info-only . (status-only) . --cacheinfo --info-only : . --cacheinfo . --info-only . --INDEX-INFO (USING --INDEX-INFO) --index-info . : 1. mode SP type SP sha1 TAB path git ls-tree . 2. mode SP sha1 SP stage TAB path (higher order stages) git ls-files --stage . 3. mode SP sha1 TAB path update-index --index-info . mode=0 . : $ git ls-files -s 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz --index-info : $ git update-index --index-info 0 0000000000000000000000000000000000000000 frotz 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz 0 mode SHA-1 . 1 2 . : $ git ls-files -s 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz "ASSUME UNCHANGED" (USING ASSUME UNCHANGED BIT) lstat(2) st_mtime . lstat(2) . <> . -- . <> . <> --assume-unchanged . --no-assume-unchanged . <> git ls-files -v ( git-ls-files(1)). core.ignorestat . true git update-index paths... ( git apply --index git checkout-index -u git read-tree -u) <> . git update-index --refresh <> ( <> git update-index --really-refresh ). assume-unchanged skip-worktree . << SKIP-WORKTREE>> . (EXAMPLES) (checkout) : $ git checkout-index -n -f -a && git update-index --ignore-missing --refresh core.ignorestat: $ 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. lstat(2) <> . 2. . 3. lstat(2) . 4. lstat(2) . 5. <> . 6. . 7. . 8. . 9. lstat(2) . SKIP-WORKTREE (SKIP-WORKTREE BIT) skip-worktree () : . . update-index read-tree skip-worktree git-sparse-checkout(1) skip-worktree . git-sparse-checkout(1) update-index read-tree . skip-worktree (sparse checkouts) . skip-worktree ( switch pull merge) . (rebase) . git add -u git commit -a . assume-unchanged . assume-unchanged ( stat ). skip-worktree ( checkout switch pull ) . sparse checkout ( git sparse-checkout core.sparseCheckout true) skip-worktree skip-worktree . (SPLIT INDEX) . : $GIT_DIR/index $GIT_DIR/sharedindex.. $GIT_DIR/index ( ) . splitIndex.maxPercentChange ( git-config(1)). splitIndex.sharedIndexExpire ( git- config(1)). . (UNTRACKED CACHE) (cache) git status. mtime stat mtime . st_mtime . --test-untracked-cache . --untracked-cache . ( ) core.untrackedCache ( git-config(1)) --untracked-cache git update-index $HOME/.gitconfig true ( false) . core.untrackedCache --[no-|force-]untracked-cache . 2.17 (symlink) . <> git.git . ( ): $ git -c core.untrackedCache=false status <> . 2.17 <> <> . . <> core.untrackedCache=false . (FILE SYSTEM MONITOR) . ( git-fsmonitor--daemon(1) <> githooks(5)) . lstat() . . ( ) core.fsmonitor ( git-config(1)) --fsmonitor git update-index $HOME/.gitconfig . core.fsmonitor . --[no-]fsmonitor . (CONFIGURATION) core.filemode . false ( git-config(1)). . git update-index --chmod= . core.symlinks false ( git- config(1)) (checkout) . core.ignorestat . "assume unchanged" . core.trustctime . inode ( ctime ) ( git-config(1)). core.untrackedCache ( git-config(1)). (NOTES) assume-unchanged skip-worktree . . . . . (SEE ALSO) git-config(1), git-add(1), git-ls-files(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-UPDATE-INDEX(1)