7 git-update-cache - Modifies the index or directory cache
13 [--add] [--remove] [--refresh] [--replace]
16 [--cacheinfo <mode> <object> <file>]\*
22 Modifies the index or directory cache. Each file mentioned is updated
23 into the cache and any 'unmerged' or 'needs updating' state is
26 The way "git-update-cache" handles files it is told about can be modified
27 using the various options:
32 If a specified file isn't in the cache already then it's
34 Default behaviour is to ignore new files.
37 If a specified file is in the cache but is missing then it's
39 Default behaviour is to ignore removed file.
42 Looks at the current cache and checks to see if merges or
43 updates are needed by checking stat() information.
46 Ignores missing files during a --refresh
48 --cacheinfo <mode> <object> <path>::
49 Directly insert the specified info into the cache.
52 Do not create objects in the object database for all
53 <file> arguments that follow this flag; just insert
54 their object IDs into the cache.
57 Remove the file from the index even when the working directory
58 still has such a file. (Implies --remove.)
61 By default, when a file `path` exists in the index,
62 git-update-cache refuses an attempt to add `path/file`.
63 Similarly if a file `path/file` exists, a file `path`
64 cannot be added. With --replace flag, existing entries
65 that conflicts with the entry being added are
66 automatically removed with warning messages.
69 Do not interpret any more arguments as options.
73 Note that files begining with '.' are discarded. This includes
74 `./file` and `dir/./file`. If you don't want this, then use
76 The same applies to directories ending '/' and paths with '//'
80 '--refresh' does not calculate a new sha1 file or bring the cache
81 up-to-date for mode/content changes. But what it *does* do is to
82 "re-match" the stat information of a file with the cache, so that you
83 can refresh the cache for a file that hasn't been changed but where
84 the stat entry is out of date.
86 For example, you'd want to do this after doing a "git-read-tree", to link
87 up the stat cache details with the proper files.
89 Using --cacheinfo or --info-only
90 --------------------------------
91 '--cacheinfo' is used to register a file that is not in the
92 current working directory. This is useful for minimum-checkout
95 To pretend you have a file with mode and sha1 at path, say:
97 $ git-update-cache --cacheinfo mode sha1 path
99 '--info-only' is used to register files without placing them in the object
100 database. This is useful for status-only repositories.
102 Both '--cacheinfo' and '--info-only' behave similarly: the index is updated
103 but the object database isn't. '--cacheinfo' is useful when the object is
104 in the database but the file isn't available locally. '--info-only' is
105 useful when the file is available, but you do not wish to update the
110 To update and refresh only the files already checked out:
112 git-checkout-cache -n -f -a && git-update-cache --ignore-missing --refresh
117 Written by Linus Torvalds <torvalds@osdl.org>
121 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
125 Part of the link:git.html[git] suite