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