7 git-checkout-index - Copy files from the cache to the working directory
12 'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
17 Will copy all files listed from the cache to the working directory
18 (not overwriting existing files).
23 update stat information for the checked out entries in
27 be quiet if files exist or are not in the cache
30 forces overwrite of existing files
33 checks out all files in the cache. Cannot be used
34 together with explicit filenames.
37 Don't checkout new files, only refresh files already checked
41 When creating files, prepend <string> (usually a directory
42 including a trailing /)
45 Do not interpret any more arguments as options.
47 The order of the flags used to matter, but not anymore.
49 Just doing "git-checkout-index" does nothing. You probably meant
50 "git-checkout-index -a". And if you want to force it, you want
51 "git-checkout-index -f -a".
53 Intuitiveness is not the goal here. Repeatability is. The reason for
54 the "no arguments means no work" thing is that from scripts you are
55 supposed to be able to do things like:
57 find . -name '*.h' -print0 | xargs -0 git-checkout-index -f --
59 which will force all existing `*.h` files to be replaced with their
60 cached copies. If an empty command line implied "all", then this would
61 force-refresh everything in the cache, which was not the point.
63 To update and refresh only the files already checked out:
65 git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh
67 Oh, and the "--" is just a good idea when you know the rest will be
68 filenames. Just so that you wouldn't have a filename of "-a" causing
69 problems (not possible in the above example, but get used to it in
72 The prefix ability basically makes it trivial to use
73 git-checkout-index as an "export as tree" function. Just read the
74 desired tree into the index, and do a
76 git-checkout-index --prefix=git-export-dir/ -a
78 and git-checkout-index will "export" the cache into the specified
81 NOTE The final "/" is important. The exported name is literally just
82 prefixed with the specified string, so you can also do something like
84 git-checkout-index --prefix=.merged- Makefile
86 to check out the currently cached copy of `Makefile` into the file
91 Written by Linus Torvalds <torvalds@osdl.org>
95 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
99 Part of the gitlink:git[7] suite