]>
Commit | Line | Data |
---|---|---|
2cf565c5 DG |
1 | git-update-cache(1) |
2 | =================== | |
3 | v0.1, May 2005 | |
4 | ||
5 | NAME | |
6 | ---- | |
7 | git-update-cache - Modifies the index or directory cache | |
8 | ||
9 | ||
10 | SYNOPSIS | |
11 | -------- | |
12 | 'git-update-cache' | |
13 | [--add] [--remove] [--refresh] [--replace] | |
14 | [--ignore-missing] | |
15 | [--force-remove <file>] | |
16 | [--cacheinfo <mode> <object> <file>]\* | |
17 | [--] [<file>]\* | |
18 | ||
19 | DESCRIPTION | |
20 | ----------- | |
21 | Modifies the index or directory cache. Each file mentioned is updated | |
22 | into the cache and any 'unmerged' or 'needs updating' state is | |
23 | cleared. | |
24 | ||
25 | The way "git-update-cache" handles files it is told about can be modified | |
26 | using the various options: | |
27 | ||
28 | OPTIONS | |
29 | ------- | |
30 | --add:: | |
31 | If a specified file isn't in the cache already then it's | |
32 | added. | |
33 | Default behaviour is to ignore new files. | |
34 | ||
35 | --remove:: | |
36 | If a specified file is in the cache but is missing then it's | |
37 | removed. | |
38 | Default behaviour is to ignore removed file. | |
39 | ||
40 | --refresh:: | |
41 | Looks at the current cache and checks to see if merges or | |
42 | updates are needed by checking stat() information. | |
43 | ||
44 | --ignore-missing:: | |
45 | Ignores missing files during a --refresh | |
46 | ||
47 | --cacheinfo <mode> <object> <path>:: | |
48 | Directly insert the specified info into the cache. | |
49 | ||
50 | --force-remove:: | |
51 | Remove the file from the index even when the working directory | |
52 | still has such a file. | |
53 | ||
54 | --replace:: | |
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. | |
61 | ||
62 | --:: | |
63 | Do not interpret any more arguments as options. | |
64 | ||
65 | <file>:: | |
66 | Files to act on. | |
67 | Note that files begining with '.' are discarded. This includes | |
68 | `./file` and `dir/./file`. If you don't want this, then use | |
69 | cleaner names. | |
70 | The same applies to directories ending '/' and paths with '//' | |
71 | ||
72 | Using --refresh | |
73 | --------------- | |
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. | |
79 | ||
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. | |
82 | ||
83 | Using --cacheinfo | |
84 | ----------------- | |
85 | '--cacheinfo' is used to register a file that is not in the current | |
86 | working directory. This is useful for minimum-checkout merging. | |
87 | ||
88 | To pretend you have a file with mode and sha1 at path, say: | |
89 | ||
90 | $ git-update-cache --cacheinfo mode sha1 path | |
91 | ||
92 | To update and refresh only the files already checked out: | |
93 | ||
94 | git-checkout-cache -n -f -a && git-update-cache --ignore-missing --refresh | |
95 | ||
96 | ||
97 | Author | |
98 | ------ | |
99 | Written by Linus Torvalds <torvalds@osdl.org> | |
100 | ||
101 | Documentation | |
102 | -------------- | |
103 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. | |
104 | ||
105 | GIT | |
106 | --- | |
107 | Part of the link:git.html[git] suite | |
108 |