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
4 <article lang="en" id="git-merge-file(1)">
\r
6 <title>git-merge-file(1)</title>
\r
8 <primary>git-merge-file(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-merge-file - Run a three-way file merge</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git merge-file</emphasis> [-L <current-name> [-L <base-name> [-L <other-name>]]]
\r
19 [--attribute-path path] [-p|--stdout] [-q|--quiet]
\r
20 <current-file> <base-file> <other-file></literallayout>
\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><base-file></literal>
\r
26 to <literal><other-file></literal> into <literal><current-file></literal>. The result ordinarily goes into
\r
27 <literal><current-file></literal>. <emphasis>git-merge-file</emphasis> is useful for combining separate changes
\r
28 to an original. Suppose <literal><base-file></literal> is the original, and both
\r
29 <literal><current-file></literal> and <literal><other-file></literal> are modifications of <literal><base-file></literal>,
\r
30 then <emphasis>git-merge-file</emphasis> combines both changes.</simpara>
\r
31 <simpara>A conflict occurs if both <literal><current-file></literal> and <literal><other-file></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 <<<<<<< and >>>>>>> markers. A typical conflict will look like this:</simpara>
\r
35 <literallayout class="monospaced"><<<<<<< A
\r
39 >>>>>>> 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
48 <simplesect id="_options">
\r
49 <title>OPTIONS</title>
\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
72 Send results to standard output instead of overwriting
\r
73 <literal><current-file></literal>.
\r
83 Quiet; do not warn about conflicts.
\r
89 --attribute-path <path>
\r
93 Apply CRLF and other necessary conversions for the <literal><path></literal>
\r
94 to the result of a merge.
\r
100 <simplesect id="_examples">
\r
101 <title>EXAMPLES</title>
\r
105 git merge-file README.my README README.upstream
\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
116 git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345
\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
127 git merge-file --attr=hello.c -L a -L b -L c tmp/a123 tmp/b234 tmp/c345
\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
139 <simplesect id="_author">
\r
140 <title>Author</title>
\r
141 <simpara>Written by Johannes Schindelin <<ulink url="mailto:johannes.schindelin@gmx.de">johannes.schindelin@gmx.de</ulink>></simpara>
\r
143 <simplesect id="_documentation">
\r
144 <title>Documentation</title>
\r
145 <simpara>Documentation by Johannes Schindelin and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>,
\r
146 with parts copied from the original documentation of RCS <emphasis>merge</emphasis>.</simpara>
\r
148 <simplesect id="_git">
\r
150 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r