1git-merge-index(1)
2==================
34
NAME
5----
6git-merge-index - Run a merge for files needing merging
78
9
SYNOPSIS
10--------
11[verse]
12'git merge-index' [-o] [-q] <merge-program> (-a | [--] <file>*)
1314
DESCRIPTION
15-----------
16This looks up the <file>(s) in the index and, if there are any merge
17entries, passes the SHA1 hash for those files as arguments 1, 2, 3 (empty
18argument if no file), and <file> as argument 4. File modes for the three
19files are passed as arguments 5, 6 and 7.
2021
OPTIONS
22-------
23\--::
24Do not interpret any more arguments as options.
2526
-a::
27Run merge against all files in the index that need merging.
2829
-o::
30Instead of stopping at the first failed merge, do all of them
31in one shot - continue with merging even when previous merges
32returned errors, and only return the error code after all the
33merges.
3435
-q::
36Do not complain about a failed merge program (a merge program
37failure usually indicates conflicts during the merge). This is for
38porcelains which might want to emit custom messages.
3940
If 'git merge-index' is called with multiple <file>s (or -a) then it
41processes them in turn only stopping if merge returns a non-zero exit
42code.
4344
Typically this is run with a script calling Git's imitation of
45the 'merge' command from the RCS package.
4647
A sample script called 'git merge-one-file' is included in the
48distribution.
4950
ALERT ALERT ALERT! The Git "merge object order" is different from the
51RCS 'merge' program merge object order. In the above ordering, the
52original 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.
5455
Examples:
5657
torvalds@ppc970:~/merge-test> git merge-index cat MM
58This is MM from the original tree. # original
59This is modified MM in the branch A. # merge1
60This is modified MM in the branch B. # merge2
61This is modified MM in the branch B. # current contents
6263
or
6465
torvalds@ppc970:~/merge-test> git merge-index cat AA MM
66cat: : No such file or directory
67This is added AA in the branch A.
68This is added AA in the branch B.
69This is added AA in the branch B.
70fatal: merge program failed
7172
where the latter example shows how 'git merge-index' will stop trying to
73merge once anything has returned an error (i.e., `cat` returned an error
74for the AA file, because it didn't exist in the original, and thus
75'git merge-index' didn't even try to merge the MM thing).
7677
GIT
78---
79Part of the linkgit:git[1] suite