]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-merge-index.txt
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
[thirdparty/git.git] / Documentation / git-merge-index.txt
CommitLineData
215a7ad1 1git-merge-index(1)
2cf565c5 2==================
2cf565c5
DG
3
4NAME
5----
c3f0baac 6git-merge-index - Run a merge for files needing merging
2cf565c5
DG
7
8
9SYNOPSIS
10--------
7791a1d9 11[verse]
12378c0a 12'git merge-index' [-o] [-q] <merge-program> (-a | [--] <file>*)
2cf565c5
DG
13
14DESCRIPTION
15-----------
5f3aa197 16This looks up the <file>(s) in the index and, if there are any merge
d5fa1f1a 17entries, passes the SHA-1 hash for those files as arguments 1, 2, 3 (empty
2cf565c5
DG
18argument if no file), and <file> as argument 4. File modes for the three
19files are passed as arguments 5, 6 and 7.
20
21OPTIONS
22-------
e994004f 23\--::
16cc50d1 24 Do not interpret any more arguments as options.
2cf565c5
DG
25
26-a::
5f3aa197 27 Run merge against all files in the index that need merging.
2cf565c5 28
7ffeb8c2
PB
29-o::
30 Instead of stopping at the first failed merge, do all of them
31 in one shot - continue with merging even when previous merges
32 returned errors, and only return the error code after all the
29b802aa 33 merges.
7ffeb8c2 34
bbd14cb0 35-q::
29b802aa
RW
36 Do not complain about a failed merge program (a merge program
37 failure usually indicates conflicts during the merge). This is for
bbd14cb0
PB
38 porcelains which might want to emit custom messages.
39
0b444cdb 40If 'git merge-index' is called with multiple <file>s (or -a) then it
2cf565c5
DG
41processes them in turn only stopping if merge returns a non-zero exit
42code.
43
2de9b711 44Typically this is run with a script calling Git's imitation of
0979c106 45the 'merge' command from the RCS package.
2cf565c5 46
0b444cdb 47A sample script called 'git merge-one-file' is included in the
bbd14cb0 48distribution.
2cf565c5 49
2de9b711 50ALERT ALERT ALERT! The Git "merge object order" is different from the
2fd02c92 51RCS 'merge' program merge object order. In the above ordering, the
2cf565c5 52original is first. But the argument order to the 3-way merge program
2fd02c92 53'merge' is to have the original in the middle. Don't ask me why.
2cf565c5
DG
54
55Examples:
56
b7e1ba56
57----
58torvalds@ppc970:~/merge-test> git merge-index cat MM
59This is MM from the original tree. # original
60This is modified MM in the branch A. # merge1
61This is modified MM in the branch B. # merge2
62This is modified MM in the branch B. # current contents
63----
2cf565c5 64
a6080a0a 65or
2cf565c5 66
b7e1ba56
67----
68torvalds@ppc970:~/merge-test> git merge-index cat AA MM
69cat: : No such file or directory
70This is added AA in the branch A.
71This is added AA in the branch B.
72This is added AA in the branch B.
73fatal: merge program failed
74----
2cf565c5 75
0b444cdb 76where the latter example shows how 'git merge-index' will stop trying to
483bc4f0 77merge once anything has returned an error (i.e., `cat` returned an error
2cf565c5 78for the AA file, because it didn't exist in the original, and thus
0b444cdb 79'git merge-index' didn't even try to merge the MM thing).
2cf565c5 80
2cf565c5
DG
81GIT
82---
9e1f0a85 83Part of the linkgit:git[1] suite