2 .\" Title: git-merge-index
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.35.1.225.ge2ac9141e6
10 .TH "GIT\-MERGE\-INDEX" "1" "02/17/2022" "Git 2\&.35\&.1\&.225\&.ge2ac91" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-merge-index \- Run a merge for files needing merging
35 \fIgit merge\-index\fR [\-o] [\-q] <merge\-program> (\-a | ( [\-\-] <file>\&...) )
40 This looks up the <file>(s) in the index and, if there are any merge entries, passes the SHA\-1 hash for those files as arguments 1, 2, 3 (empty argument if no file), and <file> as argument 4\&. File modes for the three files are passed as arguments 5, 6 and 7\&.
45 Do not interpret any more arguments as options\&.
50 Run merge against all files in the index that need merging\&.
55 Instead of stopping at the first failed merge, do all of them in one shot \- continue with merging even when previous merges returned errors, and only return the error code after all the merges\&.
60 Do not complain about a failed merge program (a merge program failure usually indicates conflicts during the merge)\&. This is for porcelains which might want to emit custom messages\&.
63 If \fIgit merge\-index\fR is called with multiple <file>s (or \-a) then it processes them in turn only stopping if merge returns a non\-zero exit code\&.
65 Typically this is run with a script calling Git\(cqs imitation of the \fImerge\fR command from the RCS package\&.
67 A sample script called \fIgit merge\-one\-file\fR is included in the distribution\&.
69 ALERT ALERT ALERT! The Git "merge object order" is different from the RCS \fImerge\fR program merge object order\&. In the above ordering, the original is first\&. But the argument order to the 3\-way merge program \fImerge\fR is to have the original in the middle\&. Don\(cqt ask me why\&.
77 torvalds@ppc970:~/merge\-test> git merge\-index cat MM
78 This is MM from the original tree\&. # original
79 This is modified MM in the branch A\&. # merge1
80 This is modified MM in the branch B\&. # merge2
81 This is modified MM in the branch B\&. # current contents
94 torvalds@ppc970:~/merge\-test> git merge\-index cat AA MM
95 cat: : No such file or directory
96 This is added AA in the branch A\&.
97 This is added AA in the branch B\&.
98 This is added AA in the branch B\&.
99 fatal: merge program failed
106 where the latter example shows how \fIgit merge\-index\fR will stop trying to merge once anything has returned an error (i\&.e\&., \fBcat\fR returned an error for the AA file, because it didn\(cqt exist in the original, and thus \fIgit merge\-index\fR didn\(cqt even try to merge the MM thing)\&.
109 Part of the \fBgit\fR(1) suite