1git-update-index(1) 2=================== 3v0.1, May 2005 4 5NAME 6---- 7git-update-index - Modifies the index or directory cache 8 9 10SYNOPSIS 11-------- 12'git-update-index' 13 [--add] [--remove] [--refresh] [--replace] 14 [--ignore-missing] 15 [--force-remove] 16 [--cacheinfo <mode> <object> <file>]\* 17 [--info-only] 18 [--] [<file>]\* 19 20DESCRIPTION 21----------- 22Modifies the index or directory cache. Each file mentioned is updated 23into the cache and any 'unmerged' or 'needs updating' state is 24cleared. 25 26The way "git-update-index" handles files it is told about can be modified 27using the various options: 28 29OPTIONS 30------- 31--add:: 32 If a specified file isn't in the cache already then it's 33 added. 34 Default behaviour is to ignore new files. 35 36--remove:: 37 If a specified file is in the cache but is missing then it's 38 removed. 39 Default behaviour is to ignore removed file. 40 41--refresh:: 42 Looks at the current cache and checks to see if merges or 43 updates are needed by checking stat() information. 44 45--ignore-missing:: 46 Ignores missing files during a --refresh 47 48--cacheinfo <mode> <object> <path>:: 49 Directly insert the specified info into the cache. 50 51--info-only:: 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. 55 56--force-remove:: 57 Remove the file from the index even when the working directory 58 still has such a file. (Implies --remove.) 59 60--replace:: 61 By default, when a file `path` exists in the index, 62 git-update-index 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. 67 68--:: 69 Do not interpret any more arguments as options. 70 71<file>:: 72 Files to act on. 73 Note that files begining with '.' are discarded. This includes 74 `./file` and `dir/./file`. If you don't want this, then use 75 cleaner names. 76 The same applies to directories ending '/' and paths with '//' 77 78Using --refresh 79--------------- 80'--refresh' does not calculate a new sha1 file or bring the cache 81up-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 83can refresh the cache for a file that hasn't been changed but where 84the stat entry is out of date. 85 86For example, you'd want to do this after doing a "git-read-tree", to link 87up the stat cache details with the proper files. 88 89Using --cacheinfo or --info-only 90-------------------------------- 91'--cacheinfo' is used to register a file that is not in the 92current working directory. This is useful for minimum-checkout 93merging. 94 95 To pretend you have a file with mode and sha1 at path, say: 96 97 $ git-update-index --cacheinfo mode sha1 path 98 99'--info-only' is used to register files without placing them in the object 100database. This is useful for status-only repositories. 101 102Both '--cacheinfo' and '--info-only' behave similarly: the index is updated 103but the object database isn't. '--cacheinfo' is useful when the object is 104in the database but the file isn't available locally. '--info-only' is 105useful when the file is available, but you do not wish to update the 106object database. 107 108Examples 109-------- 110To update and refresh only the files already checked out: 111 112 git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh 113 114 115Author 116------ 117Written by Linus Torvalds <torvalds@osdl.org> 118 119Documentation 120-------------- 121Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. 122 123GIT 124--- 125Part of the gitlink:git[7] suite 126