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