207 lines
5.6 KiB
HTML
207 lines
5.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of GIT-MERGETOOL</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>GIT-MERGETOOL</H1>
|
|
Section: Git Manual (1)<BR>Updated: 03/04/2021<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<PRE>
|
|
<I>git mergetool</I> [--tool=<tool>] [-y | --[no-]prompt] [<file>...]
|
|
</PRE>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
Use <B>git mergetool</B> to run one of several merge utilities to resolve merge conflicts. It is typically run after <I>git merge</I>.
|
|
<P>
|
|
If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts). Specifying a directory will include all unresolved files in that path. If no <file> names are specified, <I>git mergetool</I> will run the merge tool program on every file with merge conflicts.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
|
|
-t <tool>, --tool=<tool>
|
|
<DL COMPACT><DT id="1"><DD>
|
|
Use the merge resolution program specified by <tool>. Valid values include emerge, gvimdiff, kdiff3, meld, vimdiff, and tortoisemerge. Run
|
|
<B>git mergetool --tool-help</B>
|
|
for the list of valid <tool> settings.
|
|
<P>
|
|
If a merge resolution program is not specified,
|
|
<I>git mergetool</I>
|
|
will use the configuration variable
|
|
<B>merge.tool</B>. If the configuration variable
|
|
<B>merge.tool</B>
|
|
is not set,
|
|
<I>git mergetool</I>
|
|
will pick a suitable default.
|
|
<P>
|
|
You can explicitly provide a full path to the tool by setting the configuration variable
|
|
<B>mergetool.<tool>.path</B>. For example, you can configure the absolute path to kdiff3 by setting
|
|
<B>mergetool.kdiff3.path</B>. Otherwise,
|
|
<I>git mergetool</I>
|
|
assumes the tool is available in PATH.
|
|
<P>
|
|
Instead of running one of the known merge tool programs,
|
|
<I>git mergetool</I>
|
|
can be customized to run an alternative program by specifying the command line to invoke in a configuration variable
|
|
<B>mergetool.<tool>.cmd</B>.
|
|
<P>
|
|
When
|
|
<I>git mergetool</I>
|
|
is invoked with this tool (either through the
|
|
<B>-t</B>
|
|
or
|
|
<B>--tool</B>
|
|
option or the
|
|
<B>merge.tool</B>
|
|
configuration variable) the configured command line will be invoked with
|
|
<B>$BASE</B>
|
|
set to the name of a temporary file containing the common base for the merge, if available;
|
|
<B>$LOCAL</B>
|
|
set to the name of a temporary file containing the contents of the file on the current branch;
|
|
<B>$REMOTE</B>
|
|
set to the name of a temporary file containing the contents of the file to be merged, and
|
|
<B>$MERGED</B>
|
|
set to the name of the file to which the merge tool should write the result of the merge resolution.
|
|
<P>
|
|
If the custom merge tool correctly indicates the success of a merge resolution with its exit code, then the configuration variable
|
|
<B>mergetool.<tool>.trustExitCode</B>
|
|
can be set to
|
|
<B>true</B>. Otherwise,
|
|
<I>git mergetool</I>
|
|
will prompt the user to indicate the success of the resolution after the custom tool has exited.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
--tool-help
|
|
<DL COMPACT><DT id="2"><DD>
|
|
Print a list of merge tools that may be used with
|
|
<B>--tool</B>.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
-y, --no-prompt
|
|
<DL COMPACT><DT id="3"><DD>
|
|
Don't prompt before each invocation of the merge resolution program. This is the default if the merge resolution program is explicitly specified with the
|
|
<B>--tool</B>
|
|
option or with the
|
|
<B>merge.tool</B>
|
|
configuration variable.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
--prompt
|
|
<DL COMPACT><DT id="4"><DD>
|
|
Prompt before each invocation of the merge resolution program to give the user a chance to skip the path.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
-g, --gui
|
|
<DL COMPACT><DT id="5"><DD>
|
|
When
|
|
<I>git-mergetool</I>
|
|
is invoked with the
|
|
<B>-g</B>
|
|
or
|
|
<B>--gui</B>
|
|
option the default merge tool will be read from the configured
|
|
<B>merge.guitool</B>
|
|
variable instead of
|
|
<B>merge.tool</B>. If
|
|
<B>merge.guitool</B>
|
|
is not set, we will fallback to the tool configured under
|
|
<B>merge.tool</B>.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
--no-gui
|
|
<DL COMPACT><DT id="6"><DD>
|
|
This overrides a previous
|
|
<B>-g</B>
|
|
or
|
|
<B>--gui</B>
|
|
setting and reads the default merge tool will be read from the configured
|
|
<B>merge.tool</B>
|
|
variable.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
-O<orderfile>
|
|
<DL COMPACT><DT id="7"><DD>
|
|
Process files in the order specified in the <orderfile>, which has one shell glob pattern per line. This overrides the
|
|
<B>diff.orderFile</B>
|
|
configuration variable (see
|
|
<B><A HREF="/cgi-bin/man/man2html?1+git-config">git-config</A></B>(1)). To cancel
|
|
<B>diff.orderFile</B>, use
|
|
<B>-O/dev/null</B>.
|
|
</DL>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>TEMPORARY FILES</H2>
|
|
|
|
<P>
|
|
<B>git mergetool</B> creates <B>*.orig</B> backup files while resolving merges. These are safe to remove once a file has been merged and its <B>git mergetool</B> session has completed.
|
|
<P>
|
|
Setting the <B>mergetool.keepBackup</B> configuration variable to <B>false</B> causes <B>git mergetool</B> to automatically remove the backup as files are successfully merged.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>GIT</H2>
|
|
|
|
<P>
|
|
Part of the <B><A HREF="/cgi-bin/man/man2html?1+git">git</A></B>(1) suite
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="8"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="9"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="10"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="11"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="12"><A HREF="#lbAF">TEMPORARY FILES</A><DD>
|
|
<DT id="13"><A HREF="#lbAG">GIT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:14 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|