Home Explore Blog CI



git

2nd chunk of `Documentation/git-update-index.adoc`
b6cb558c09f52ef194a0db6c6a4f56b0d7f784067997bbb80000000100000fa1
 when working with a big project on a
	filesystem that has a 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.

--really-refresh::
	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 names 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 names 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.

-g::
--again::
	Runs 'git update-index' itself on the paths whose index
	entries are different from those of the `HEAD` commit.

--unresolve::
	Restores the 'unmerged' or 'needs updating' state of a
	file during a merge if it was cleared by accident.

--info-only::
	Do not create objects in the object database for all
	<file> arguments that follow this flag; just insert
	their object IDs into the index.

--force-remove::
	Remove the file from the index even when the working directory
	still has such a file. (Implies --remove.)

--replace::
	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.

--stdin::
	Instead of taking a list of paths from the command line,
	read a list of paths from the standard input.  Paths are
	separated by LF (i.e. one path per line) by default.

--verbose::
	Report what is being added and removed from the index.

--index-version <n>::
	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`.  With `--verbose`, also report the version the index
	file uses before and after this command.
+
Version 4 performs a simple pathname compression that reduces index
size by 30%-50% on large repositories, which results in faster load
time.  Git supports it since version 1.8.0, released in October 2012,
and support for it was added to libgit2 in 2016 and to JGit in 2020.
Older versions of this manual page called it "relatively young", but
it should be considered mature technology these days.

--show-index-version::
	Report the index format version used by the on-disk index file.
	See `--index-version` above.

-z::
	Only meaningful with `--stdin` or `--index-info`; paths are
	separated with NUL character instead of LF.

--split-index::
--no-split-index::
	Enable or disable split index mode. If split-index mode is
	already enabled and `--split-index` is given again, all
	changes in $GIT_DIR/index are pushed back to the shared index
	file.
+
These options take effect whatever the value of the `core.splitIndex`
configuration variable (see linkgit: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.

--untracked-cache::
--no-untracked-cache::
	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

Title: Git Update Index Command Options
Summary
The git update-index command provides various options to modify its behavior, including flags to assume files are unchanged, skip worktree, and ignore fsmonitor, as well as options to refresh, replace, and remove files from the index, and control the index format version and split index mode.