2 .\" Title: git-merge-index
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.46.0.288.g3a7362eb9f
10 .TH "GIT\-MERGE\-INDEX" "1" "2024-08-21" "Git 2\&.46\&.0\&.288\&.g3a7362" "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>\&...\:) )
39 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\&.
44 Do not interpret any more arguments as options\&.
49 Run merge against all files in the index that need merging\&.
54 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\&.
59 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\&.
62 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\&.
64 Typically this is run with a script calling Git\(cqs imitation of the \fImerge\fR command from the RCS package\&.
66 A sample script called \fIgit merge\-one\-file\fR is included in the distribution\&.
68 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\&.
76 torvalds@ppc970:~/merge\-test> git merge\-index cat MM
77 This is MM from the original tree\&. # original
78 This is modified MM in the branch A\&. # merge1
79 This is modified MM in the branch B\&. # merge2
80 This is modified MM in the branch B\&. # current contents
92 torvalds@ppc970:~/merge\-test> git merge\-index cat AA MM
93 cat: : No such file or directory
94 This is added AA in the branch A\&.
95 This is added AA in the branch B\&.
96 This is added AA in the branch B\&.
97 fatal: merge program failed
103 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)\&.
106 Part of the \fBgit\fR(1) suite