6 git-checkout-index - Copy files from the index to the working directory
12 'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
13 [--stage=<number>] [--] <file>...
17 Will copy all files listed from the index 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 index
30 forces overwrite of existing files
33 checks out all files in the index. 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 Instead of checking out unmerged entries, copy out the
46 files from named stage. <number> must be between 1 and 3.
49 Do not interpret any more arguments as options.
51 The order of the flags used to matter, but not anymore.
53 Just doing `git-checkout-index` does nothing. You probably meant
54 `git-checkout-index -a`. And if you want to force it, you want
55 `git-checkout-index -f -a`.
57 Intuitiveness is not the goal here. Repeatability is. The reason for
58 the "no arguments means no work" behavior is that from scripts you are
59 supposed to be able to do:
62 $ find . -name '*.h' -print0 | xargs -0 git-checkout-index -f --
65 which will force all existing `*.h` files to be replaced with their
66 cached copies. If an empty command line implied "all", then this would
67 force-refresh everything in the index, which was not the point.
69 The `--` is just a good idea when you know the rest will be filenames;
70 it will prevent problems with a filename of, for example, `-a`.
71 Using `--` is probably a good policy in scripts.
76 To update and refresh only the files already checked out::
79 $ git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh
82 Using `git-checkout-index` to "export an entire tree"::
83 The prefix ability basically makes it trivial to use
84 `git-checkout-index` as an "export as tree" function.
85 Just read the desired tree into the index, and do:
88 $ git-checkout-index --prefix=git-export-dir/ -a
91 `git-checkout-index` will "export" the index into the specified
94 The final "/" is important. The exported name is literally just
95 prefixed with the specified string. Contrast this with the
98 Export files with a prefix::
101 $ git-checkout-index --prefix=.merged- Makefile
104 This will check out the currently cached copy of `Makefile`
105 into the file `.merged-Makefile`.
110 Written by Linus Torvalds <torvalds@osdl.org>
115 Documentation by David Greaves,
116 Junio C Hamano and the git-list <git@vger.kernel.org>.
121 Part of the gitlink:git[7] suite