7 git-checkout-cache - Copy files from the cache to the working directory
12 'git-checkout-cache' [-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 be quiet if files exist or are not in the cache
26 forces overwrite of existing files
29 checks out all files in the cache (will then continue to
30 process listed files).
33 Don't checkout new files, only refresh files already checked
37 When creating files, prepend <string> (usually a directory
38 including a trailing /)
41 Do not interpret any more arguments as options.
43 Note that the order of the flags matters:
45 git-checkout-cache -a -f file.c
47 will first check out all files listed in the cache (but not overwrite
48 any old ones), and then force-checkout `file.c` a second time (ie that
49 one *will* overwrite any old contents with the same filename).
51 Also, just doing "git-checkout-cache" does nothing. You probably meant
52 "git-checkout-cache -a". And if you want to force it, you want
53 "git-checkout-cache -f -a".
55 Intuitiveness is not the goal here. Repeatability is. The reason for
56 the "no arguments means no work" thing is that from scripts you are
57 supposed to be able to do things like:
59 find . -name '*.h' -print0 | xargs -0 git-checkout-cache -f --
61 which will force all existing `*.h` files to be replaced with their
62 cached copies. If an empty command line implied "all", then this would
63 force-refresh everything in the cache, which was not the point.
65 To update and refresh only the files already checked out:
67 git-checkout-cache -n -f -a && git-update-cache --ignore-missing --refresh
69 Oh, and the "--" is just a good idea when you know the rest will be
70 filenames. Just so that you wouldn't have a filename of "-a" causing
71 problems (not possible in the above example, but get used to it in
74 The prefix ability basically makes it trivial to use
75 git-checkout-cache as an "export as tree" function. Just read the
76 desired tree into the index, and do a
78 git-checkout-cache --prefix=git-export-dir/ -a
80 and git-checkout-cache will "export" the cache into the specified
83 NOTE The final "/" is important. The exported name is literally just
84 prefixed with the specified string, so you can also do something like
86 git-checkout-cache --prefix=.merged- Makefile
88 to check out the currently cached copy of `Makefile` into the file
93 Written by Linus Torvalds <torvalds@osdl.org>
97 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
101 Part of the link:git.html[git] suite