7 git-update-cache - Modifies the index or directory cache
13 [--add] [--remove] [--refresh] [--replace]
15 [--force-remove <file>]
16 [--cacheinfo <mode> <object> <file>]\*
21 Modifies the index or directory cache. Each file mentioned is updated
22 into the cache and any 'unmerged' or 'needs updating' state is
25 The way "git-update-cache" handles files it is told about can be modified
26 using the various options:
31 If a specified file isn't in the cache already then it's
33 Default behaviour is to ignore new files.
36 If a specified file is in the cache but is missing then it's
38 Default behaviour is to ignore removed file.
41 Looks at the current cache and checks to see if merges or
42 updates are needed by checking stat() information.
45 Ignores missing files during a --refresh
47 --cacheinfo <mode> <object> <path>::
48 Directly insert the specified info into the cache.
51 Remove the file from the index even when the working directory
52 still has such a file.
55 By default, when a file `path` exists in the index,
56 git-update-cache refuses an attempt to add `path/file`.
57 Similarly if a file `path/file` exists, a file `path`
58 cannot be added. With --replace flag, existing entries
59 that conflicts with the entry being added are
60 automatically removed with warning messages.
63 Do not interpret any more arguments as options.
67 Note that files begining with '.' are discarded. This includes
68 `./file` and `dir/./file`. If you don't want this, then use
70 The same applies to directories ending '/' and paths with '//'
74 '--refresh' does not calculate a new sha1 file or bring the cache
75 up-to-date for mode/content changes. But what it *does* do is to
76 "re-match" the stat information of a file with the cache, so that you
77 can refresh the cache for a file that hasn't been changed but where
78 the stat entry is out of date.
80 For example, you'd want to do this after doing a "git-read-tree", to link
81 up the stat cache details with the proper files.
85 '--cacheinfo' is used to register a file that is not in the current
86 working directory. This is useful for minimum-checkout merging.
88 To pretend you have a file with mode and sha1 at path, say:
90 $ git-update-cache --cacheinfo mode sha1 path
92 To update and refresh only the files already checked out:
94 git-checkout-cache -n -f -a && git-update-cache --ignore-missing --refresh
99 Written by Linus Torvalds <torvalds@osdl.org>
103 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
107 Part of the link:git.html[git] suite