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