updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-merge-index.xml
blob40e81042218d275de607d290ea4e672116d2f9d5
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-merge-index(1)">\r
5 <articleinfo>\r
6     <title>git-merge-index(1)</title>\r
7 <indexterm>\r
8 <primary>git-merge-index(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-merge-index - Run a merge for files needing merging</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git merge-index</emphasis> [-o] [-q] &lt;merge-program&gt; (-a | [--] &lt;file&gt;*)</literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="_description">\r
22 <title>DESCRIPTION</title>\r
23 <simpara>This looks up the &lt;file&gt;(s) in the index and, if there are any merge\r
24 entries, passes the SHA1 hash for those files as arguments 1, 2, 3 (empty\r
25 argument if no file), and &lt;file&gt; as argument 4.  File modes for the three\r
26 files are passed as arguments 5, 6 and 7.</simpara>\r
27 </simplesect>\r
28 <simplesect id="_options">\r
29 <title>OPTIONS</title>\r
30 <variablelist>\r
31 <varlistentry>\r
32 <term>\r
33 --\r
34 </term>\r
35 <listitem>\r
36 <simpara>\r
37         Do not interpret any more arguments as options.\r
38 </simpara>\r
39 </listitem>\r
40 </varlistentry>\r
41 <varlistentry>\r
42 <term>\r
43 -a\r
44 </term>\r
45 <listitem>\r
46 <simpara>\r
47         Run merge against all files in the index that need merging.\r
48 </simpara>\r
49 </listitem>\r
50 </varlistentry>\r
51 <varlistentry>\r
52 <term>\r
53 -o\r
54 </term>\r
55 <listitem>\r
56 <simpara>\r
57         Instead of stopping at the first failed merge, do all of them\r
58         in one shot - continue with merging even when previous merges\r
59         returned errors, and only return the error code after all the\r
60         merges.\r
61 </simpara>\r
62 </listitem>\r
63 </varlistentry>\r
64 <varlistentry>\r
65 <term>\r
66 -q\r
67 </term>\r
68 <listitem>\r
69 <simpara>\r
70         Do not complain about a failed merge program (a merge program\r
71         failure usually indicates conflicts during the merge). This is for\r
72         porcelains which might want to emit custom messages.\r
73 </simpara>\r
74 </listitem>\r
75 </varlistentry>\r
76 </variablelist>\r
77 <simpara>If <emphasis>git merge-index</emphasis> is called with multiple &lt;file&gt;s (or -a) then it\r
78 processes them in turn only stopping if merge returns a non-zero exit\r
79 code.</simpara>\r
80 <simpara>Typically this is run with a script calling git's imitation of\r
81 the <emphasis>merge</emphasis> command from the RCS package.</simpara>\r
82 <simpara>A sample script called <emphasis>git merge-one-file</emphasis> is included in the\r
83 distribution.</simpara>\r
84 <simpara>ALERT ALERT ALERT! The git "merge object order" is different from the\r
85 RCS <emphasis>merge</emphasis> program merge object order. In the above ordering, the\r
86 original is first. But the argument order to the 3-way merge program\r
87 <emphasis>merge</emphasis> is to have the original in the middle. Don't ask me why.</simpara>\r
88 <simpara>Examples:</simpara>\r
89 <literallayout class="monospaced">torvalds@ppc970:~/merge-test&gt; git merge-index cat MM\r
90 This is MM from the original tree.                    # original\r
91 This is modified MM in the branch A.                  # merge1\r
92 This is modified MM in the branch B.                  # merge2\r
93 This is modified MM in the branch B.                  # current contents</literallayout>\r
94 <simpara>or</simpara>\r
95 <literallayout class="monospaced">torvalds@ppc970:~/merge-test&gt; git merge-index cat AA MM\r
96 cat: : No such file or directory\r
97 This is added AA in the branch A.\r
98 This is added AA in the branch B.\r
99 This is added AA in the branch B.\r
100 fatal: merge program failed</literallayout>\r
101 <simpara>where the latter example shows how <emphasis>git merge-index</emphasis> will stop trying to\r
102 merge once anything has returned an error (i.e., <emphasis>cat</emphasis> returned an error\r
103 for the AA file, because it didn't exist in the original, and thus\r
104 <emphasis>git merge-index</emphasis> didn't even try to merge the MM thing).</simpara>\r
105 </simplesect>\r
106 <simplesect id="_git">\r
107 <title>GIT</title>\r
108 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
109 </simplesect>\r
110 </article>\r