OSDN Git Service

merge original branch.
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-merge-file.html.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-merge-file(1)">\r
5 <articleinfo>\r
6     <title>git-merge-file(1)</title>\r
7         <indexterm>\r
8                 <primary>git-merge-file(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-merge-file - Run a three-way file merge</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git merge-file</emphasis> [-L &lt;current-name&gt; [-L &lt;base-name&gt; [-L &lt;other-name&gt;]]]\r
19         [--attribute-path path] [-p|--stdout] [-q|--quiet]\r
20         &lt;current-file&gt; &lt;base-file&gt; &lt;other-file&gt;</literallayout>\r
21 </blockquote>\r
22 </simplesect>\r
23 <simplesect id="_description">\r
24 <title>DESCRIPTION</title>\r
25 <simpara><emphasis>git-merge-file</emphasis> incorporates all changes that lead from the <literal>&lt;base-file&gt;</literal>\r
26 to <literal>&lt;other-file&gt;</literal> into <literal>&lt;current-file&gt;</literal>. The result ordinarily goes into\r
27 <literal>&lt;current-file&gt;</literal>. <emphasis>git-merge-file</emphasis> is useful for combining separate changes\r
28 to an original. Suppose <literal>&lt;base-file&gt;</literal> is the original, and both\r
29 <literal>&lt;current-file&gt;</literal> and <literal>&lt;other-file&gt;</literal> are modifications of <literal>&lt;base-file&gt;</literal>,\r
30 then <emphasis>git-merge-file</emphasis> combines both changes.</simpara>\r
31 <simpara>A conflict occurs if both <literal>&lt;current-file&gt;</literal> and <literal>&lt;other-file&gt;</literal> have changes\r
32 in a common segment of lines. If a conflict is found, <emphasis>git-merge-file</emphasis>\r
33 normally outputs a warning and brackets the conflict with lines containing\r
34 &lt;&lt;&lt;&lt;&lt;&lt;&lt; and &gt;&gt;&gt;&gt;&gt;&gt;&gt; markers. A typical conflict will look like this:</simpara>\r
35 <literallayout class="monospaced">&lt;&lt;&lt;&lt;&lt;&lt;&lt; A\r
36 lines in file A\r
37 =======\r
38 lines in file B\r
39 &gt;&gt;&gt;&gt;&gt;&gt;&gt; B</literallayout>\r
40 <simpara>If there are conflicts, the user should edit the result and delete one of\r
41 the alternatives.</simpara>\r
42 <simpara>The exit value of this program is negative on error, and the number of\r
43 conflicts otherwise. If the merge was clean, the exit value is 0.</simpara>\r
44 <simpara><emphasis>git-merge-file</emphasis> is designed to be a minimal clone of RCS <emphasis>merge</emphasis>; that is, it\r
45 implements all of RCS <emphasis>merge</emphasis>'s functionality which is needed by\r
46 <xref linkend="git(1)"/>.</simpara>\r
47 </simplesect>\r
48 <simplesect id="_options">\r
49 <title>OPTIONS</title>\r
50 <variablelist>\r
51 <varlistentry>\r
52 <term>\r
53 -L &lt;label&gt;\r
54 </term>\r
55 <listitem>\r
56 <simpara>\r
57         This option may be given up to three times, and\r
58         specifies labels to be used in place of the\r
59         corresponding file names in conflict reports. That is,\r
60         <literal>git merge-file -L x -L y -L z a b c</literal> generates output that\r
61         looks like it came from files x, y and z instead of\r
62         from files a, b and c.\r
63 </simpara>\r
64 </listitem>\r
65 </varlistentry>\r
66 <varlistentry>\r
67 <term>\r
68 -p\r
69 </term>\r
70 <listitem>\r
71 <simpara>\r
72         Send results to standard output instead of overwriting\r
73         <literal>&lt;current-file&gt;</literal>.\r
74 </simpara>\r
75 </listitem>\r
76 </varlistentry>\r
77 <varlistentry>\r
78 <term>\r
79 -q\r
80 </term>\r
81 <listitem>\r
82 <simpara>\r
83         Quiet; do not warn about conflicts.\r
84 </simpara>\r
85 </listitem>\r
86 </varlistentry>\r
87 <varlistentry>\r
88 <term>\r
89 --attribute-path &lt;path&gt;\r
90 </term>\r
91 <listitem>\r
92 <simpara>\r
93         Apply CRLF and other necessary conversions for the <literal>&lt;path&gt;</literal>\r
94         to the result of a merge.\r
95 </simpara>\r
96 </listitem>\r
97 </varlistentry>\r
98 </variablelist>\r
99 </simplesect>\r
100 <simplesect id="_examples">\r
101 <title>EXAMPLES</title>\r
102 <variablelist>\r
103 <varlistentry>\r
104 <term>\r
105 git merge-file README.my README README.upstream\r
106 </term>\r
107 <listitem>\r
108 <simpara>\r
109         combines the changes of README.my and README.upstream since README,\r
110         tries to merge them and writes the result into README.my.\r
111 </simpara>\r
112 </listitem>\r
113 </varlistentry>\r
114 <varlistentry>\r
115 <term>\r
116 git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345\r
117 </term>\r
118 <listitem>\r
119 <simpara>\r
120         merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels\r
121         <literal>a</literal> and <literal>c</literal> instead of <literal>tmp/a123</literal> and <literal>tmp/c345</literal>.\r
122 </simpara>\r
123 </listitem>\r
124 </varlistentry>\r
125 <varlistentry>\r
126 <term>\r
127 git merge-file --attr=hello.c -L a -L b -L c tmp/a123 tmp/b234 tmp/c345\r
128 </term>\r
129 <listitem>\r
130 <simpara>\r
131         The same as the above, but make the result suitable to replace\r
132         hello.c in the work tree by applying CRLF and other necessary\r
133         conversions.\r
134 </simpara>\r
135 </listitem>\r
136 </varlistentry>\r
137 </variablelist>\r
138 </simplesect>\r
139 <simplesect id="_author">\r
140 <title>Author</title>\r
141 <simpara>Written by Johannes Schindelin &lt;<ulink url="mailto:johannes.schindelin@gmx.de">johannes.schindelin@gmx.de</ulink>&gt;</simpara>\r
142 </simplesect>\r
143 <simplesect id="_documentation">\r
144 <title>Documentation</title>\r
145 <simpara>Documentation by Johannes Schindelin and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;,\r
146 with parts copied from the original documentation of RCS <emphasis>merge</emphasis>.</simpara>\r
147 </simplesect>\r
148 <simplesect id="_git">\r
149 <title>GIT</title>\r
150 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
151 </simplesect>\r
152 </article>\r