NAME
----
-git-update-index - Modifies the index or directory cache
+git-update-index - Register file contents in the working tree to the index
SYNOPSIS
--------
[verse]
'git-update-index'
- [--add] [--remove | --force-remove] [--replace]
- [--refresh [-q] [--unmerged] [--ignore-missing]]
+ [--add] [--remove | --force-remove] [--replace]
+ [--refresh] [-q] [--unmerged] [--ignore-missing]
[--cacheinfo <mode> <object> <file>]\*
[--chmod=(+|-)x]
[--assume-unchanged | --no-assume-unchanged]
- [--really-refresh]
+ [--really-refresh] [--unresolve] [--again | -g]
[--info-only] [--index-info]
[-z] [--stdin]
[--verbose]
into the index and any 'unmerged' or 'needs updating' state is
cleared.
+See also gitlink:git-add[1] for a more user-friendly way to do some of
+the most common operations on the index.
+
The way "git-update-index" handles files it is told about can be modified
using the various options:
--remove::
If a specified file is in the index but is missing then it's
removed.
- Default behaviour is to ignore removed file.
+ Default behavior is to ignore removed file.
--refresh::
Looks at the current index and checks to see if merges or
filesystem that has very slow lstat(2) system call
(e.g. cifs).
+--again, -g::
+ Runs `git-update-index` itself on the paths whose index
+ entries are different from those from 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
Only meaningful with `--stdin`; paths are separated with
NUL character instead of LF.
---::
+\--::
Do not interpret any more arguments as options.
<file>::
------------
-Using "assume unchanged" bit
-----------------------------
+Using ``assume unchanged'' bit
+------------------------------
Many operations in git depend on your filesystem to have an
efficient `lstat(2)` implementation, so that `st_mtime`
$ git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh
----------------
-On an inefficient filesystem with `core.ignorestat` set:
-
+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>
+$ 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>
+$ git diff --name-only <4>
M foo.c
-$ git update-index foo.c <5>
-$ git diff --name-only <6>
+$ 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>
+$ 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.
+------------
++
+<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.
+<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.
-------------
Configuration
The command honors `core.filemode` configuration variable. If
your repository is on an filesystem whose executable bits are
-unreliable, this should be set to 'false' (see gitlink:git-repo-config[1]).
+unreliable, this should be set to 'false' (see gitlink:git-config[1]).
This causes the command to ignore differences in file modes recorded
in the index and the file mode on the filesystem if they differ only on
executable bit. On such an unfortunate filesystem, you may
need to use `git-update-index --chmod=`.
+Quite similarly, if `core.symlinks` configuration variable is set
+to 'false' (see gitlink:git-config[1]), symbolic links are checked out
+as plain files, and this command does not modify a recorded file mode
+from symbolic link to regular file.
+
The command looks at `core.ignorestat` configuration variable. See
'Using "assume unchanged" bit' section above.
See Also
--------
-gitlink:git-repo-config[1]
+gitlink:git-config[1],
+gitlink:git-add[1]
Author