'git read-tree', to link
up the stat index details with the proper files.
USING --CACHEINFO OR --INFO-ONLY
--------------------------------
`--cacheinfo` is used to register a file that is not in the
current working directory. This is useful for minimum-checkout
merging.
To pretend you have a file at path with mode and sha1, say:
----------------
$ git update-index --add --cacheinfo <mode>,<sha1>,<path>
----------------
`--info-only` is used to register files without placing them in the object
database. This is useful for status-only repositories.
Both `--cacheinfo` and `--info-only` behave similarly: the index is updated
but the object database isn't. `--cacheinfo` is useful when the object is
in the database but the file isn't available locally. `--info-only` is
useful when the file is available, but you do not wish to update the
object database.
USING --INDEX-INFO
------------------
`--index-info` is a more powerful mechanism that lets you feed
multiple entry definitions from the standard input, and designed
specifically for scripts. It can take inputs of three formats:
. mode SP type SP sha1 TAB path
+
This format is to stuff `git ls-tree` output into the index.
. mode SP sha1 SP stage TAB path
+
This format is to put higher order stages into the
index file and matches 'git ls-files --stage' output.
. mode SP sha1 TAB path
+
This format is no longer produced by any Git command, but is
and will continue to be supported by `update-index --index-info`.
To place a higher stage entry to the index, the path should
first be removed by feeding a mode=0 entry for the path, and
then feeding necessary input lines in the third format.
For example, starting with this index:
------------
$ git ls-files -s
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz
------------
you can feed the following input to `--index-info`:
------------
$ git update-index --index-info
0 0000000000000000000000000000000000000000 frotz
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz
------------
The first line of the input feeds 0 as the mode to remove the
path; the SHA-1 does not matter as long as it is well formatted.
Then the second and third line feeds stage 1 and stage 2 entries
for that path. After the above, we would end up with this:
------------
$ git ls-files -s
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz
------------
USING ``ASSUME UNCHANGED'' BIT
------------------------------
Many operations in Git depend on your filesystem to have an
efficient `lstat(2)` implementation, so that `st_mtime`
information for working tree files can be cheaply checked to see
if the file contents have changed from the version recorded in
the index file. Unfortunately, some filesystems have
inefficient `lstat(2)`. If your filesystem is one of them, you
can set "assume unchanged" bit to paths you have not changed to
cause Git not to do this check. Note that setting this bit on a
path does not mean Git will check the contents of the file to
see if it has changed -- it makes Git to omit any checking and
assume it has *not* changed. When you make changes to working
tree files, you have to explicitly tell Git about it by dropping
"assume unchanged" bit, either before or after you modify them.
In order to set "assume unchanged" bit, use `--assume-unchanged`
option. To unset, use `--no-assume-unchanged`. To see which files
have the "assume unchanged" bit set, use `git ls-files -v`
(see linkgit:git-ls-files[1]).
The command looks at `core.ignorestat` configuration variable. When
this is true, paths updated with `git update-index paths...` and
paths updated with other Git commands that update both index and
working tree (e.g. 'git apply --index', 'git checkout-index -u',
and 'git read-tree -u') are automatically marked as "assume
unchanged". Note that "assume