OSDN Git Service

Add Git official document to help
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-mergetool.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-mergetool(1)">\r
5 <articleinfo>\r
6     <title>git-mergetool(1)</title>\r
7         <indexterm>\r
8                 <primary>git-mergetool(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-mergetool - Run merge conflict resolution tools to resolve merge conflicts</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <simpara><emphasis>git mergetool</emphasis> [--tool=&lt;tool&gt;] [-y|--no-prompt|--prompt] [&lt;file&gt;]&#8230;</simpara>\r
18 </simplesect>\r
19 <simplesect id="_description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>Use <literal>git mergetool</literal> to run one of several merge utilities to resolve\r
22 merge conflicts.  It is typically run after <emphasis>git-merge</emphasis>.</simpara>\r
23 <simpara>If one or more &lt;file&gt; parameters are given, the merge tool program will\r
24 be run to resolve differences on each file.  If no &lt;file&gt; names are\r
25 specified, <emphasis>git-mergetool</emphasis> will run the merge tool program on every file\r
26 with merge conflicts.</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 -t &lt;tool&gt;\r
34 </term>\r
35 <term>\r
36 --tool=&lt;tool&gt;\r
37 </term>\r
38 <listitem>\r
39 <simpara>\r
40         Use the merge resolution program specified by &lt;tool&gt;.\r
41         Valid merge tools are:\r
42         kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff\r
43 </simpara>\r
44 <simpara>If a merge resolution program is not specified, <emphasis>git-mergetool</emphasis>\r
45 will use the configuration variable <literal>merge.tool</literal>.  If the\r
46 configuration variable <literal>merge.tool</literal> is not set, <emphasis>git-mergetool</emphasis>\r
47 will pick a suitable default.</simpara>\r
48 <simpara>You can explicitly provide a full path to the tool by setting the\r
49 configuration variable <literal>mergetool.&lt;tool&gt;.path</literal>. For example, you\r
50 can configure the absolute path to kdiff3 by setting\r
51 <literal>mergetool.kdiff3.path</literal>. Otherwise, <emphasis>git-mergetool</emphasis> assumes the\r
52 tool is available in PATH.</simpara>\r
53 <simpara>Instead of running one of the known merge tool programs,\r
54 <emphasis>git-mergetool</emphasis> can be customized to run an alternative program\r
55 by specifying the command line to invoke in a configuration\r
56 variable <literal>mergetool.&lt;tool&gt;.cmd</literal>.</simpara>\r
57 <simpara>When <emphasis>git-mergetool</emphasis> is invoked with this tool (either through the\r
58 <literal>-t</literal> or <literal>--tool</literal> option or the <literal>merge.tool</literal> configuration\r
59 variable) the configured command line will be invoked with <literal>$BASE</literal>\r
60 set to the name of a temporary file containing the common base for\r
61 the merge, if available; <literal>$LOCAL</literal> set to the name of a temporary\r
62 file containing the contents of the file on the current branch;\r
63 <literal>$REMOTE</literal> set to the name of a temporary file containing the\r
64 contents of the file to be merged, and <literal>$MERGED</literal> set to the name\r
65 of the file to which the merge tool should write the result of the\r
66 merge resolution.</simpara>\r
67 <simpara>If the custom merge tool correctly indicates the success of a\r
68 merge resolution with its exit code, then the configuration\r
69 variable <literal>mergetool.&lt;tool&gt;.trustExitCode</literal> can be set to <literal>true</literal>.\r
70 Otherwise, <emphasis>git-mergetool</emphasis> will prompt the user to indicate the\r
71 success of the resolution after the custom tool has exited.</simpara>\r
72 </listitem>\r
73 </varlistentry>\r
74 <varlistentry>\r
75 <term>\r
76 -y\r
77 </term>\r
78 <term>\r
79 --no-prompt\r
80 </term>\r
81 <listitem>\r
82 <simpara>\r
83         Don&#8217;t prompt before each invocation of the merge resolution\r
84         program.\r
85 </simpara>\r
86 </listitem>\r
87 </varlistentry>\r
88 <varlistentry>\r
89 <term>\r
90 --prompt\r
91 </term>\r
92 <listitem>\r
93 <simpara>\r
94         Prompt before each invocation of the merge resolution program.\r
95         This is the default behaviour; the option is provided to\r
96         override any configuration settings.\r
97 </simpara>\r
98 </listitem>\r
99 </varlistentry>\r
100 </variablelist>\r
101 </simplesect>\r
102 <simplesect id="_author">\r
103 <title>Author</title>\r
104 <simpara>Written by Theodore Y Ts&#8217;o &lt;<ulink url="mailto:tytso@mit.edu">tytso@mit.edu</ulink>&gt;</simpara>\r
105 </simplesect>\r
106 <simplesect id="_documentation">\r
107 <title>Documentation</title>\r
108 <simpara>Documentation by Theodore Y Ts&#8217;o.</simpara>\r
109 </simplesect>\r
110 <simplesect id="_git">\r
111 <title>GIT</title>\r
112 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
113 </simplesect>\r
114 </article>\r