2005-09-08 00:26:23 +00:00
|
|
|
git-merge-index(1)
|
2005-05-10 21:32:30 +00:00
|
|
|
==================
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2007-01-18 23:53:37 +00:00
|
|
|
git-merge-index - Run a merge for files needing merging
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2008-06-30 06:09:04 +00:00
|
|
|
'git merge-index' [-o] [-q] <merge-program> (-a | [--] <file>\*)
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2005-11-11 01:12:27 +00:00
|
|
|
This looks up the <file>(s) in the index and, if there are any merge
|
2005-05-10 21:32:30 +00:00
|
|
|
entries, passes the SHA1 hash for those files as arguments 1, 2, 3 (empty
|
|
|
|
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 19:05:24 +00:00
|
|
|
\--::
|
2005-12-08 23:28:05 +00:00
|
|
|
Do not interpret any more arguments as options.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
-a::
|
2005-11-11 01:12:27 +00:00
|
|
|
Run merge against all files in the index that need merging.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2005-05-11 02:49:36 +00: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
|
|
|
|
merges are over.
|
|
|
|
|
2005-07-29 12:53:38 +00:00
|
|
|
-q::
|
|
|
|
Do not complain about failed merge program (the merge program
|
|
|
|
failure usually indicates conflicts during merge). This is for
|
|
|
|
porcelains which might want to emit custom messages.
|
|
|
|
|
2008-07-03 05:41:41 +00:00
|
|
|
If 'git-merge-index' is called with multiple <file>s (or -a) then it
|
2005-05-10 21:32:30 +00:00
|
|
|
processes them in turn only stopping if merge returns a non-zero exit
|
|
|
|
code.
|
|
|
|
|
2007-10-09 21:00:03 +00:00
|
|
|
Typically this is run with a script calling git's imitation of
|
2008-07-03 05:37:18 +00:00
|
|
|
the 'merge' command from the RCS package.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2008-07-03 05:41:41 +00:00
|
|
|
A sample script called 'git-merge-one-file' is included in the
|
2005-07-29 12:53:38 +00:00
|
|
|
distribution.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
ALERT ALERT ALERT! The git "merge object order" is different from the
|
2008-07-03 05:55:07 +00:00
|
|
|
RCS 'merge' program merge object order. In the above ordering, the
|
2005-05-10 21:32:30 +00:00
|
|
|
original is first. But the argument order to the 3-way merge program
|
2008-07-03 05:55:07 +00:00
|
|
|
'merge' is to have the original in the middle. Don't ask me why.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2008-06-30 06:09:04 +00:00
|
|
|
torvalds@ppc970:~/merge-test> git merge-index cat MM
|
2005-05-10 21:32:30 +00: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 07:04:01 +00:00
|
|
|
or
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2008-06-30 06:09:04 +00:00
|
|
|
torvalds@ppc970:~/merge-test> git merge-index cat AA MM
|
2005-05-10 21:32:30 +00: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
|
|
|
|
|
2008-07-03 05:41:41 +00:00
|
|
|
where the latter example shows how 'git-merge-index' will stop trying to
|
2008-06-30 18:56:34 +00:00
|
|
|
merge once anything has returned an error (i.e., `cat` returned an error
|
2005-05-10 21:32:30 +00:00
|
|
|
for the AA file, because it didn't exist in the original, and thus
|
2008-07-03 05:41:41 +00:00
|
|
|
'git-merge-index' didn't even try to merge the MM thing).
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
Author
|
|
|
|
------
|
|
|
|
Written by Linus Torvalds <torvalds@osdl.org>
|
2005-05-11 02:49:36 +00:00
|
|
|
One-shot merge by Petr Baudis <pasky@ucw.cz>
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
Documentation
|
|
|
|
--------------
|
|
|
|
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 07:07:32 +00:00
|
|
|
Part of the linkgit:git[1] suite
|