1GIT-MERGE-INDEX(1)                Git Manual                GIT-MERGE-INDEX(1)
2
3
4

NAME

6       git-merge-index - Run a merge for files needing merging
7

SYNOPSIS

9       git merge-index [-o] [-q] <merge-program> (-a | [--] <file>*)
10
11

DESCRIPTION

13       This looks up the <file>(s) in the index and, if there are any merge
14       entries, passes the SHA-1 hash for those files as arguments 1, 2, 3
15       (empty argument if no file), and <file> as argument 4. File modes for
16       the three files are passed as arguments 5, 6 and 7.
17

OPTIONS

19       --
20           Do not interpret any more arguments as options.
21
22       -a
23           Run merge against all files in the index that need merging.
24
25       -o
26           Instead of stopping at the first failed merge, do all of them in
27           one shot - continue with merging even when previous merges returned
28           errors, and only return the error code after all the merges.
29
30       -q
31           Do not complain about a failed merge program (a merge program
32           failure usually indicates conflicts during the merge). This is for
33           porcelains which might want to emit custom messages.
34
35       If git merge-index is called with multiple <file>s (or -a) then it
36       processes them in turn only stopping if merge returns a non-zero exit
37       code.
38
39       Typically this is run with a script calling Git’s imitation of the
40       merge command from the RCS package.
41
42       A sample script called git merge-one-file is included in the
43       distribution.
44
45       ALERT ALERT ALERT! The Git "merge object order" is different from the
46       RCS merge program merge object order. In the above ordering, the
47       original is first. But the argument order to the 3-way merge program
48       merge is to have the original in the middle. Don’t ask me why.
49
50       Examples:
51
52           torvalds@ppc970:~/merge-test> git merge-index cat MM
53           This is MM from the original tree.                    # original
54           This is modified MM in the branch A.                  # merge1
55           This is modified MM in the branch B.                  # merge2
56           This is modified MM in the branch B.                  # current contents
57
58       or
59
60           torvalds@ppc970:~/merge-test> git merge-index cat AA MM
61           cat: : No such file or directory
62           This is added AA in the branch A.
63           This is added AA in the branch B.
64           This is added AA in the branch B.
65           fatal: merge program failed
66
67       where the latter example shows how git merge-index will stop trying to
68       merge once anything has returned an error (i.e., cat returned an error
69       for the AA file, because it didn’t exist in the original, and thus git
70       merge-index didn’t even try to merge the MM thing).
71

GIT

73       Part of the git(1) suite
74
75
76
77Git 2.20.1                        12/15/2018                GIT-MERGE-INDEX(1)
Impressum