|
3 | 3 | *
|
4 | 4 | * Copyright (C) 2005 Linus Torvalds
|
5 | 5 | *
|
6 |
| - * Careful: order of argument flags does matter. For example, |
7 |
| - * |
8 |
| - * git checkout-index -a -f file.c |
9 |
| - * |
10 |
| - * Will first check out all files listed in the cache (but not |
11 |
| - * overwrite any old ones), and then force-checkout "file.c" a |
12 |
| - * second time (ie that one _will_ overwrite any old contents |
13 |
| - * with the same filename). |
14 |
| - * |
15 |
| - * Also, just doing "git checkout-index" does nothing. You probably |
16 |
| - * meant "git checkout-index -a". And if you want to force it, you |
17 |
| - * want "git checkout-index -f -a". |
18 |
| - * |
19 |
| - * Intuitiveness is not the goal here. Repeatability is. The |
20 |
| - * reason for the "no arguments means no work" thing is that |
21 |
| - * from scripts you are supposed to be able to do things like |
22 |
| - * |
23 |
| - * find . -name '*.h' -print0 | xargs -0 git checkout-index -f -- |
24 |
| - * |
25 |
| - * or: |
26 |
| - * |
27 |
| - * find . -name '*.h' -print0 | git checkout-index -f -z --stdin |
28 |
| - * |
29 |
| - * which will force all existing *.h files to be replaced with |
30 |
| - * their cached copies. If an empty command line implied "all", |
31 |
| - * then this would force-refresh everything in the cache, which |
32 |
| - * was not the point. |
33 |
| - * |
34 |
| - * Oh, and the "--" is just a good idea when you know the rest |
35 |
| - * will be filenames. Just so that you wouldn't have a filename |
36 |
| - * of "-a" causing problems (not possible in the above example, |
37 |
| - * but get used to it in scripting!). |
38 | 6 | */
|
39 | 7 | #include "builtin.h"
|
40 | 8 | #include "cache.h"
|
|
0 commit comments