6 git-checkout-index - Copy files from the index to the working directory
11 'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
16 Will copy all files listed from the index to the working directory
17 (not overwriting existing files).
22 update stat information for the checked out entries in
26 be quiet if files exist or are not in the index
29 forces overwrite of existing files
32 checks out all files in the index. Cannot be used
33 together with explicit filenames.
36 Don't checkout new files, only refresh files already checked
40 When creating files, prepend <string> (usually a directory
41 including a trailing /)
44 Do not interpret any more arguments as options.
46 The order of the flags used to matter, but not anymore.
48 Just doing `git-checkout-index` does nothing. You probably meant
49 `git-checkout-index -a`. And if you want to force it, you want
50 `git-checkout-index -f -a`.
52 Intuitiveness is not the goal here. Repeatability is. The reason for
53 the "no arguments means no work" behavior is that from scripts you are
54 supposed to be able to do:
57 $ find . -name '*.h' -print0 | xargs -0 git-checkout-index -f --
60 which will force all existing `*.h` files to be replaced with their
61 cached copies. If an empty command line implied "all", then this would
62 force-refresh everything in the index, which was not the point.
64 The `--` is just a good idea when you know the rest will be filenames;
65 it will prevent problems with a filename of, for example, `-a`.
66 Using `--` is probably a good policy in scripts.
71 To update and refresh only the files already checked out::
74 $ git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh
77 Using `git-checkout-index` to "export an entire tree"::
78 The prefix ability basically makes it trivial to use
79 `git-checkout-index` as an "export as tree" function.
80 Just read the desired tree into the index, and do:
83 $ git-checkout-index --prefix=git-export-dir/ -a
86 `git-checkout-index` will "export" the index into the specified
89 The final "/" is important. The exported name is literally just
90 prefixed with the specified string. Contrast this with the
93 Export files with a prefix::
96 $ git-checkout-index --prefix=.merged- Makefile
99 This will check out the currently cached copy of `Makefile`
100 into the file `.merged-Makefile`.
105 Written by Linus Torvalds <torvalds@osdl.org>
110 Documentation by David Greaves,
111 Junio C Hamano and the git-list <git@vger.kernel.org>.
116 Part of the gitlink:git[7] suite