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