]>
Commit | Line | Data |
---|---|---|
215a7ad1 | 1 | git-merge-index(1) |
2cf565c5 DG |
2 | ================== |
3 | v0.1, May 2005 | |
4 | ||
5 | NAME | |
6 | ---- | |
215a7ad1 | 7 | git-merge-index - Runs a merge for files needing merging |
2cf565c5 DG |
8 | |
9 | ||
10 | SYNOPSIS | |
11 | -------- | |
215a7ad1 | 12 | 'git-merge-index' [-o] [-q] <merge-program> (-a | -- | <file>\*) |
2cf565c5 DG |
13 | |
14 | DESCRIPTION | |
15 | ----------- | |
16 | This looks up the <file>(s) in the cache and, if there are any merge | |
17 | entries, passes the SHA1 hash for those files as arguments 1, 2, 3 (empty | |
18 | argument if no file), and <file> as argument 4. File modes for the three | |
19 | files are passed as arguments 5, 6 and 7. | |
20 | ||
21 | OPTIONS | |
22 | ------- | |
23 | --:: | |
2c6e4771 | 24 | Interpret all following arguments as filenames. |
2cf565c5 DG |
25 | |
26 | -a:: | |
27 | Run merge against all files in the cache that need merging. | |
28 | ||
7ffeb8c2 PB |
29 | -o:: |
30 | Instead of stopping at the first failed merge, do all of them | |
31 | in one shot - continue with merging even when previous merges | |
32 | returned errors, and only return the error code after all the | |
33 | merges are over. | |
34 | ||
bbd14cb0 PB |
35 | -q:: |
36 | Do not complain about failed merge program (the merge program | |
37 | failure usually indicates conflicts during merge). This is for | |
38 | porcelains which might want to emit custom messages. | |
39 | ||
215a7ad1 | 40 | If "git-merge-index" is called with multiple <file>s (or -a) then it |
2cf565c5 DG |
41 | processes them in turn only stopping if merge returns a non-zero exit |
42 | code. | |
43 | ||
44 | Typically this is run with the a script calling the merge command from | |
45 | the RCS package. | |
46 | ||
215a7ad1 | 47 | A sample script called "git-merge-one-file" is included in the |
bbd14cb0 | 48 | distribution. |
2cf565c5 DG |
49 | |
50 | ALERT ALERT ALERT! The git "merge object order" is different from the | |
51 | RCS "merge" program merge object order. In the above ordering, the | |
52 | original is first. But the argument order to the 3-way merge program | |
53 | "merge" is to have the original in the middle. Don't ask me why. | |
54 | ||
55 | Examples: | |
56 | ||
215a7ad1 | 57 | torvalds@ppc970:~/merge-test> git-merge-index cat MM |
2cf565c5 DG |
58 | This is MM from the original tree. # original |
59 | This is modified MM in the branch A. # merge1 | |
60 | This is modified MM in the branch B. # merge2 | |
61 | This is modified MM in the branch B. # current contents | |
62 | ||
63 | or | |
64 | ||
215a7ad1 | 65 | torvalds@ppc970:~/merge-test> git-merge-index cat AA MM |
2cf565c5 DG |
66 | cat: : No such file or directory |
67 | This is added AA in the branch A. | |
68 | This is added AA in the branch B. | |
69 | This is added AA in the branch B. | |
70 | fatal: merge program failed | |
71 | ||
215a7ad1 | 72 | where the latter example shows how "git-merge-index" will stop trying to |
2cf565c5 DG |
73 | merge once anything has returned an error (ie "cat" returned an error |
74 | for the AA file, because it didn't exist in the original, and thus | |
215a7ad1 | 75 | "git-merge-index" didn't even try to merge the MM thing). |
2cf565c5 DG |
76 | |
77 | Author | |
78 | ------ | |
79 | Written by Linus Torvalds <torvalds@osdl.org> | |
7ffeb8c2 | 80 | One-shot merge by Petr Baudis <pasky@ucw.cz> |
2cf565c5 DG |
81 | |
82 | Documentation | |
83 | -------------- | |
84 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. | |
85 | ||
86 | GIT | |
87 | --- | |
88 | Part of the link:git.html[git] suite | |
89 |