2005-09-08 02:26:23 +02:00
|
|
|
git-merge-index(1)
|
2005-05-10 23:32:30 +02:00
|
|
|
==================
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2007-01-19 00:53:37 +01:00
|
|
|
git-merge-index - Run a merge for files needing merging
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2011-07-02 04:38:26 +02:00
|
|
|
[verse]
|
2021-11-06 19:48:54 +01:00
|
|
|
'git merge-index' [-o] [-q] <merge-program> (-a | ( [--] <file>...) )
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2005-11-11 02:12:27 +01:00
|
|
|
This looks up the <file>(s) in the index and, if there are any merge
|
2013-04-15 19:49:04 +02:00
|
|
|
entries, passes the SHA-1 hash for those files as arguments 1, 2, 3 (empty
|
2005-05-10 23:32:30 +02:00
|
|
|
argument if no file), and <file> as argument 4. File modes for the three
|
|
|
|
files are passed as arguments 5, 6 and 7.
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2006-05-05 21:05:24 +02:00
|
|
|
\--::
|
2005-12-09 00:28:05 +01:00
|
|
|
Do not interpret any more arguments as options.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
-a::
|
2005-11-11 02:12:27 +01:00
|
|
|
Run merge against all files in the index that need merging.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2005-05-11 04:49:36 +02:00
|
|
|
-o::
|
|
|
|
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
|
2008-12-09 07:23:51 +01:00
|
|
|
merges.
|
2005-05-11 04:49:36 +02:00
|
|
|
|
2005-07-29 14:53:38 +02:00
|
|
|
-q::
|
2008-12-09 07:23:51 +01:00
|
|
|
Do not complain about a failed merge program (a merge program
|
|
|
|
failure usually indicates conflicts during the merge). This is for
|
2005-07-29 14:53:38 +02:00
|
|
|
porcelains which might want to emit custom messages.
|
|
|
|
|
2010-01-10 00:33:00 +01:00
|
|
|
If 'git merge-index' is called with multiple <file>s (or -a) then it
|
2005-05-10 23:32:30 +02:00
|
|
|
processes them in turn only stopping if merge returns a non-zero exit
|
|
|
|
code.
|
|
|
|
|
2013-01-21 20:17:53 +01:00
|
|
|
Typically this is run with a script calling Git's imitation of
|
2008-07-03 07:37:18 +02:00
|
|
|
the 'merge' command from the RCS package.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2010-01-10 00:33:00 +01:00
|
|
|
A sample script called 'git merge-one-file' is included in the
|
2005-07-29 14:53:38 +02:00
|
|
|
distribution.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2013-01-21 20:17:53 +01:00
|
|
|
ALERT ALERT ALERT! The Git "merge object order" is different from the
|
2008-07-03 07:55:07 +02:00
|
|
|
RCS 'merge' program merge object order. In the above ordering, the
|
2005-05-10 23:32:30 +02:00
|
|
|
original is first. But the argument order to the 3-way merge program
|
2008-07-03 07:55:07 +02:00
|
|
|
'merge' is to have the original in the middle. Don't ask me why.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2019-09-07 16:12:52 +02:00
|
|
|
----
|
|
|
|
torvalds@ppc970:~/merge-test> git merge-index cat MM
|
|
|
|
This is MM from the original tree. # original
|
|
|
|
This is modified MM in the branch A. # merge1
|
|
|
|
This is modified MM in the branch B. # merge2
|
|
|
|
This is modified MM in the branch B. # current contents
|
|
|
|
----
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2007-06-07 09:04:01 +02:00
|
|
|
or
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2019-09-07 16:12:52 +02:00
|
|
|
----
|
|
|
|
torvalds@ppc970:~/merge-test> git merge-index cat AA MM
|
|
|
|
cat: : No such file or directory
|
|
|
|
This is added AA in the branch A.
|
|
|
|
This is added AA in the branch B.
|
|
|
|
This is added AA in the branch B.
|
|
|
|
fatal: merge program failed
|
|
|
|
----
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2010-01-10 00:33:00 +01:00
|
|
|
where the latter example shows how 'git merge-index' will stop trying to
|
2008-06-30 20:56:34 +02:00
|
|
|
merge once anything has returned an error (i.e., `cat` returned an error
|
2005-05-10 23:32:30 +02:00
|
|
|
for the AA file, because it didn't exist in the original, and thus
|
2010-01-10 00:33:00 +01:00
|
|
|
'git merge-index' didn't even try to merge the MM thing).
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 09:07:32 +02:00
|
|
|
Part of the linkgit:git[1] suite
|