logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-mergetool.1 (21730B)


  1. '\" t
  2. .\" Title: git-mergetool
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-MERGETOOL" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-mergetool \- Run merge conflict resolution tools to resolve merge conflicts
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit mergetool\fR [\-\-tool=<tool>] [\-y | \-\-[no\-]prompt] [<file>\&...\:]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. Use \fBgit\fR \fBmergetool\fR to run one of several merge utilities to resolve merge conflicts\&. It is typically run after \fIgit merge\fR\&.
  40. .sp
  41. If one or more <file> parameters are given, the merge tool program will be run to resolve differences in each file (skipping those without conflicts)\&. Specifying a directory will include all unresolved files in that path\&. If no <file> names are specified, \fIgit mergetool\fR will run the merge tool program on every file with merge conflicts\&.
  42. .SH "OPTIONS"
  43. .PP
  44. \-t <tool>, \-\-tool=<tool>
  45. .RS 4
  46. Use the merge resolution program specified by <tool>\&. Valid values include emerge, gvimdiff, kdiff3, meld, vimdiff, and tortoisemerge\&. Run
  47. \fBgit\fR
  48. \fBmergetool\fR
  49. \fB\-\-tool\-help\fR
  50. for the list of valid <tool> settings\&.
  51. .sp
  52. If a merge resolution program is not specified,
  53. \fIgit mergetool\fR
  54. will use the configuration variable
  55. \fBmerge\&.tool\fR\&. If the configuration variable
  56. \fBmerge\&.tool\fR
  57. is not set,
  58. \fIgit mergetool\fR
  59. will pick a suitable default\&.
  60. .sp
  61. You can explicitly provide a full path to the tool by setting the configuration variable
  62. \fBmergetool\&.\fR\fI<tool>\fR\fB\&.path\fR\&. For example, you can configure the absolute path to kdiff3 by setting
  63. \fBmergetool\&.kdiff3\&.path\fR\&. Otherwise,
  64. \fIgit mergetool\fR
  65. assumes the tool is available in PATH\&.
  66. .sp
  67. Instead of running one of the known merge tool programs,
  68. \fIgit mergetool\fR
  69. can be customized to run an alternative program by specifying the command line to invoke in a configuration variable
  70. \fBmergetool\&.\fR\fI<tool>\fR\fB\&.cmd\fR\&.
  71. .sp
  72. When
  73. \fIgit mergetool\fR
  74. is invoked with this tool (either through the
  75. \fB\-t\fR
  76. or
  77. \fB\-\-tool\fR
  78. option or the
  79. \fBmerge\&.tool\fR
  80. configuration variable), the configured command line will be invoked with
  81. \fB$BASE\fR
  82. set to the name of a temporary file containing the common base for the merge, if available;
  83. \fB$LOCAL\fR
  84. set to the name of a temporary file containing the contents of the file on the current branch;
  85. \fB$REMOTE\fR
  86. set to the name of a temporary file containing the contents of the file to be merged, and
  87. \fB$MERGED\fR
  88. set to the name of the file to which the merge tool should write the result of the merge resolution\&.
  89. .sp
  90. If the custom merge tool correctly indicates the success of a merge resolution with its exit code, then the configuration variable
  91. \fBmergetool\&.\fR\fI<tool>\fR\fB\&.trustExitCode\fR
  92. can be set to
  93. \fBtrue\fR\&. Otherwise,
  94. \fIgit mergetool\fR
  95. will prompt the user to indicate the success of the resolution after the custom tool has exited\&.
  96. .RE
  97. .PP
  98. \-\-tool\-help
  99. .RS 4
  100. Print a list of merge tools that may be used with
  101. \fB\-\-tool\fR\&.
  102. .RE
  103. .PP
  104. \-y, \-\-no\-prompt
  105. .RS 4
  106. Don\(cqt prompt before each invocation of the merge resolution program\&. This is the default if the merge resolution program is explicitly specified with the
  107. \fB\-\-tool\fR
  108. option or with the
  109. \fBmerge\&.tool\fR
  110. configuration variable\&.
  111. .RE
  112. .PP
  113. \-\-prompt
  114. .RS 4
  115. Prompt before each invocation of the merge resolution program to give the user a chance to skip the path\&.
  116. .RE
  117. .PP
  118. \-g, \-\-gui
  119. .RS 4
  120. When
  121. \fIgit\-mergetool\fR
  122. is invoked with the
  123. \fB\-g\fR
  124. or
  125. \fB\-\-gui\fR
  126. option, the default merge tool will be read from the configured
  127. \fBmerge\&.guitool\fR
  128. variable instead of
  129. \fBmerge\&.tool\fR\&. If
  130. \fBmerge\&.guitool\fR
  131. is not set, we will fallback to the tool configured under
  132. \fBmerge\&.tool\fR\&. This may be autoselected using the configuration variable
  133. \fBmergetool\&.guiDefault\fR\&.
  134. .RE
  135. .PP
  136. \-\-no\-gui
  137. .RS 4
  138. This overrides a previous
  139. \fB\-g\fR
  140. or
  141. \fB\-\-gui\fR
  142. setting or
  143. \fBmergetool\&.guiDefault\fR
  144. configuration and reads the default merge tool from the configured
  145. \fBmerge\&.tool\fR
  146. variable\&.
  147. .RE
  148. .PP
  149. \-O<orderfile>
  150. .RS 4
  151. Process files in the order specified in the <orderfile>, which has one shell glob pattern per line\&. This overrides the
  152. \fBdiff\&.orderFile\fR
  153. configuration variable (see
  154. \fBgit-config\fR(1))\&. To cancel
  155. \fBdiff\&.orderFile\fR, use
  156. \fB\-O/dev/null\fR\&.
  157. .RE
  158. .SH "CONFIGURATION"
  159. .sp
  160. Everything below this line in this section is selectively included from the \fBgit-config\fR(1) documentation\&. The content is the same as what\(cqs found there:
  161. .PP
  162. mergetool\&.<tool>\&.path
  163. .RS 4
  164. Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
  165. .RE
  166. .PP
  167. mergetool\&.<tool>\&.cmd
  168. .RS 4
  169. Specify the command to invoke the specified merge tool\&. The specified command is evaluated in shell with the following variables available:
  170. \fIBASE\fR
  171. is the name of a temporary file containing the common base of the files to be merged, if available;
  172. \fILOCAL\fR
  173. is the name of a temporary file containing the contents of the file on the current branch;
  174. \fIREMOTE\fR
  175. is the name of a temporary file containing the contents of the file from the branch being merged;
  176. \fIMERGED\fR
  177. contains the name of the file to which the merge tool should write the results of a successful merge\&.
  178. .RE
  179. .PP
  180. mergetool\&.<tool>\&.hideResolved
  181. .RS 4
  182. Allows the user to override the global
  183. \fBmergetool\&.hideResolved\fR
  184. value for a specific tool\&. See
  185. \fBmergetool\&.hideResolved\fR
  186. for the full description\&.
  187. .RE
  188. .PP
  189. mergetool\&.<tool>\&.trustExitCode
  190. .RS 4
  191. For a custom merge command, specify whether the exit code of the merge command can be used to determine whether the merge was successful\&. If this is not set to true then the merge target file timestamp is checked, and the merge is assumed to have been successful if the file has been updated; otherwise, the user is prompted to indicate the success of the merge\&.
  192. .RE
  193. .PP
  194. mergetool\&.meld\&.hasOutput
  195. .RS 4
  196. Older versions of
  197. \fBmeld\fR
  198. do not support the
  199. \fB\-\-output\fR
  200. option\&. Git will attempt to detect whether
  201. \fBmeld\fR
  202. supports
  203. \fB\-\-output\fR
  204. by inspecting the output of
  205. \fBmeld\fR
  206. \fB\-\-help\fR\&. Configuring
  207. \fBmergetool\&.meld\&.hasOutput\fR
  208. will make Git skip these checks and use the configured value instead\&. Setting
  209. \fBmergetool\&.meld\&.hasOutput\fR
  210. to
  211. \fBtrue\fR
  212. tells Git to unconditionally use the
  213. \fB\-\-output\fR
  214. option, and
  215. \fBfalse\fR
  216. avoids using
  217. \fB\-\-output\fR\&.
  218. .RE
  219. .PP
  220. mergetool\&.meld\&.useAutoMerge
  221. .RS 4
  222. When the
  223. \fB\-\-auto\-merge\fR
  224. is given, meld will merge all non\-conflicting parts automatically, highlight the conflicting parts, and wait for user decision\&. Setting
  225. \fBmergetool\&.meld\&.useAutoMerge\fR
  226. to
  227. \fBtrue\fR
  228. tells Git to unconditionally use the
  229. \fB\-\-auto\-merge\fR
  230. option with
  231. \fBmeld\fR\&. Setting this value to
  232. \fBauto\fR
  233. makes git detect whether
  234. \fB\-\-auto\-merge\fR
  235. is supported and will only use
  236. \fB\-\-auto\-merge\fR
  237. when available\&. A value of
  238. \fBfalse\fR
  239. avoids using
  240. \fB\-\-auto\-merge\fR
  241. altogether, and is the default value\&.
  242. .RE
  243. .PP
  244. mergetool\&.<vimdiff variant>\&.layout
  245. .RS 4
  246. Configure the split window layout for vimdiff\(cqs
  247. \fI<variant>\fR, which is any of
  248. \fBvimdiff\fR,
  249. \fBnvimdiff\fR,
  250. \fBgvimdiff\fR\&. Upon launching
  251. \fBgit\fR
  252. \fBmergetool\fR
  253. with
  254. \fB\-\-tool=\fR\fI<variant>\fR
  255. (or without
  256. \fB\-\-tool\fR
  257. if
  258. \fBmerge\&.tool\fR
  259. is configured as
  260. \fI<variant>\fR), Git will consult
  261. \fBmergetool\&.\fR\fI<variant>\fR\fB\&.layout\fR
  262. to determine the tool\(cqs layout\&. If the variant\-specific configuration is not available,
  263. \fBvimdiff\fR\*(Aqs is used as fallback\&. If that too is not available, a default layout with 4 windows will be used\&. To configure the layout, see the
  264. \fBBACKEND\fR
  265. \fBSPECIFIC\fR
  266. \fBHINTS\fR
  267. section\&.
  268. .RE
  269. .PP
  270. mergetool\&.hideResolved
  271. .RS 4
  272. During a merge, Git will automatically resolve as many conflicts as possible and write the
  273. \fIMERGED\fR
  274. file containing conflict markers around any conflicts that it cannot resolve;
  275. \fILOCAL\fR
  276. and
  277. \fIREMOTE\fR
  278. normally represent the versions of the file from before Git\(cqs conflict resolution\&. This flag causes
  279. \fILOCAL\fR
  280. and
  281. \fIREMOTE\fR
  282. to be overwritten so that only the unresolved conflicts are presented to the merge tool\&. Can be configured per\-tool via the
  283. \fBmergetool\&.\fR\fI<tool>\fR\fB\&.hideResolved\fR
  284. configuration variable\&. Defaults to
  285. \fBfalse\fR\&.
  286. .RE
  287. .PP
  288. mergetool\&.keepBackup
  289. .RS 4
  290. After performing a merge, the original file with conflict markers can be saved as a file with a \&.\fBorig\fR
  291. extension\&. If this variable is set to
  292. \fBfalse\fR
  293. then this file is not preserved\&. Defaults to
  294. \fBtrue\fR
  295. (i\&.e\&. keep the backup files)\&.
  296. .RE
  297. .PP
  298. mergetool\&.keepTemporaries
  299. .RS 4
  300. When invoking a custom merge tool, Git uses a set of temporary files to pass to the tool\&. If the tool returns an error and this variable is set to
  301. \fBtrue\fR, then these temporary files will be preserved; otherwise, they will be removed after the tool has exited\&. Defaults to
  302. \fBfalse\fR\&.
  303. .RE
  304. .PP
  305. mergetool\&.writeToTemp
  306. .RS 4
  307. Git writes temporary
  308. \fIBASE\fR,
  309. \fILOCAL\fR, and
  310. \fIREMOTE\fR
  311. versions of conflicting files in the worktree by default\&. Git will attempt to use a temporary directory for these files when set
  312. \fBtrue\fR\&. Defaults to
  313. \fBfalse\fR\&.
  314. .RE
  315. .PP
  316. mergetool\&.prompt
  317. .RS 4
  318. Prompt before each invocation of the merge resolution program\&.
  319. .RE
  320. .PP
  321. mergetool\&.guiDefault
  322. .RS 4
  323. Set
  324. \fBtrue\fR
  325. to use the
  326. \fBmerge\&.guitool\fR
  327. by default (equivalent to specifying the
  328. \fB\-\-gui\fR
  329. argument), or
  330. \fBauto\fR
  331. to select
  332. \fBmerge\&.guitool\fR
  333. or
  334. \fBmerge\&.tool\fR
  335. depending on the presence of a
  336. \fBDISPLAY\fR
  337. environment variable value\&. The default is
  338. \fBfalse\fR, where the
  339. \fB\-\-gui\fR
  340. argument must be provided explicitly for the
  341. \fBmerge\&.guitool\fR
  342. to be used\&.
  343. .RE
  344. .SH "TEMPORARY FILES"
  345. .sp
  346. \fBgit\fR \fBmergetool\fR creates *\&.\fBorig\fR backup files while resolving merges\&. These are safe to remove once a file has been merged and its \fBgit\fR \fBmergetool\fR session has completed\&.
  347. .sp
  348. Setting the \fBmergetool\&.keepBackup\fR configuration variable to \fBfalse\fR causes \fBgit\fR \fBmergetool\fR to automatically remove the backup files as files are successfully merged\&.
  349. .SH "BACKEND SPECIFIC HINTS"
  350. .SS "vimdiff"
  351. .sp
  352. .it 1 an-trap
  353. .nr an-no-space-flag 1
  354. .nr an-break-flag 1
  355. .br
  356. .ps +1
  357. \fBDescription\fR
  358. .RS 4
  359. .sp
  360. When specifying \fB\-\-tool=vimdiff\fR in \fBgit\fR \fBmergetool\fR Git will open Vim with a 4 windows layout distributed in the following way:
  361. .sp
  362. .if n \{\
  363. .RS 4
  364. .\}
  365. .nf
  366. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  367. | | | |
  368. | LOCAL | BASE | REMOTE |
  369. | | | |
  370. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  371. | |
  372. | MERGED |
  373. | |
  374. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  375. .fi
  376. .if n \{\
  377. .RE
  378. .\}
  379. .sp
  380. \fBLOCAL\fR, \fBBASE\fR and \fBREMOTE\fR are read\-only buffers showing the contents of the conflicting file in specific commits ("commit you are merging into", "common ancestor commit" and "commit you are merging from" respectively)
  381. .sp
  382. \fBMERGED\fR is a writable buffer where you have to resolve the conflicts (using the other read\-only buffers as a reference)\&. Once you are done, save and exit Vim as usual (\fB:wq\fR) or, if you want to abort, exit using \fB:cq\fR\&.
  383. .RE
  384. .sp
  385. .it 1 an-trap
  386. .nr an-no-space-flag 1
  387. .nr an-break-flag 1
  388. .br
  389. .ps +1
  390. \fBLayout configuration\fR
  391. .RS 4
  392. .sp
  393. You can change the windows layout used by Vim by setting configuration variable \fBmergetool\&.vimdiff\&.layout\fR which accepts a string where the following separators have special meaning:
  394. .sp
  395. .RS 4
  396. .ie n \{\
  397. \h'-04'\(bu\h'+03'\c
  398. .\}
  399. .el \{\
  400. .sp -1
  401. .IP \(bu 2.3
  402. .\}
  403. \fB+\fR
  404. is used to "open a new tab"
  405. .RE
  406. .sp
  407. .RS 4
  408. .ie n \{\
  409. \h'-04'\(bu\h'+03'\c
  410. .\}
  411. .el \{\
  412. .sp -1
  413. .IP \(bu 2.3
  414. .\}
  415. \fB,\fR
  416. is used to "open a new vertical split"
  417. .RE
  418. .sp
  419. .RS 4
  420. .ie n \{\
  421. \h'-04'\(bu\h'+03'\c
  422. .\}
  423. .el \{\
  424. .sp -1
  425. .IP \(bu 2.3
  426. .\}
  427. \fB/\fR
  428. is used to "open a new horizontal split"
  429. .RE
  430. .sp
  431. .RS 4
  432. .ie n \{\
  433. \h'-04'\(bu\h'+03'\c
  434. .\}
  435. .el \{\
  436. .sp -1
  437. .IP \(bu 2.3
  438. .\}
  439. \fB@\fR
  440. is used to indicate the file containing the final version after solving the conflicts\&. If not present,
  441. \fBMERGED\fR
  442. will be used by default\&.
  443. .RE
  444. .sp
  445. The precedence of the operators is as follows (you can use parentheses to change it):
  446. .sp
  447. .if n \{\
  448. .RS 4
  449. .\}
  450. .nf
  451. `@` > `+` > `/` > `,`
  452. .fi
  453. .if n \{\
  454. .RE
  455. .\}
  456. .sp
  457. Let\(cqs see some examples to understand how it works:
  458. .sp
  459. .RS 4
  460. .ie n \{\
  461. \h'-04'\(bu\h'+03'\c
  462. .\}
  463. .el \{\
  464. .sp -1
  465. .IP \(bu 2.3
  466. .\}
  467. \fBlayout\fR
  468. \fB=\fR
  469. "(\fBLOCAL,BASE,REMOTE\fR)\fB/MERGED\fR"
  470. .sp
  471. This is exactly the same as the default layout we have already seen\&.
  472. .sp
  473. Note that
  474. \fB/\fR
  475. has precedence over
  476. \fB,\fR
  477. and thus the parenthesis are not needed in this case\&. The next layout definition is equivalent:
  478. .sp
  479. .if n \{\
  480. .RS 4
  481. .\}
  482. .nf
  483. layout = "LOCAL,BASE,REMOTE / MERGED"
  484. .fi
  485. .if n \{\
  486. .RE
  487. .\}
  488. .RE
  489. .sp
  490. .RS 4
  491. .ie n \{\
  492. \h'-04'\(bu\h'+03'\c
  493. .\}
  494. .el \{\
  495. .sp -1
  496. .IP \(bu 2.3
  497. .\}
  498. \fBlayout\fR
  499. \fB=\fR
  500. "LOCAL,MERGED,REMOTE"
  501. .sp
  502. If, for some reason, we are not interested in the
  503. \fBBASE\fR
  504. buffer\&.
  505. .sp
  506. .if n \{\
  507. .RS 4
  508. .\}
  509. .nf
  510. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  511. | | | |
  512. | | | |
  513. | LOCAL | MERGED | REMOTE |
  514. | | | |
  515. | | | |
  516. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  517. .fi
  518. .if n \{\
  519. .RE
  520. .\}
  521. .RE
  522. .sp
  523. .RS 4
  524. .ie n \{\
  525. \h'-04'\(bu\h'+03'\c
  526. .\}
  527. .el \{\
  528. .sp -1
  529. .IP \(bu 2.3
  530. .\}
  531. \fBlayout\fR
  532. \fB=\fR
  533. "MERGED"
  534. .sp
  535. Only the
  536. \fBMERGED\fR
  537. buffer will be shown\&. Note, however, that all the other ones are still loaded in vim, and you can access them with the "buffers" command\&.
  538. .sp
  539. .if n \{\
  540. .RS 4
  541. .\}
  542. .nf
  543. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  544. | |
  545. | |
  546. | MERGED |
  547. | |
  548. | |
  549. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  550. .fi
  551. .if n \{\
  552. .RE
  553. .\}
  554. .RE
  555. .sp
  556. .RS 4
  557. .ie n \{\
  558. \h'-04'\(bu\h'+03'\c
  559. .\}
  560. .el \{\
  561. .sp -1
  562. .IP \(bu 2.3
  563. .\}
  564. \fBlayout\fR
  565. \fB=\fR
  566. "@LOCAL,REMOTE"
  567. .sp
  568. When
  569. \fBMERGED\fR
  570. is not present in the layout, you must "mark" one of the buffers with an asterisk\&. That will become the buffer you need to edit and save after resolving the conflicts\&.
  571. .sp
  572. .if n \{\
  573. .RS 4
  574. .\}
  575. .nf
  576. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  577. | | |
  578. | | |
  579. | | |
  580. | LOCAL | REMOTE |
  581. | | |
  582. | | |
  583. | | |
  584. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  585. .fi
  586. .if n \{\
  587. .RE
  588. .\}
  589. .RE
  590. .sp
  591. .RS 4
  592. .ie n \{\
  593. \h'-04'\(bu\h'+03'\c
  594. .\}
  595. .el \{\
  596. .sp -1
  597. .IP \(bu 2.3
  598. .\}
  599. \fBlayout\fR
  600. \fB=\fR
  601. "LOCAL,BASE,REMOTE
  602. \fB/\fR
  603. \fBMERGED\fR
  604. \fB+\fR
  605. \fBBASE,LOCAL\fR
  606. \fB+\fR
  607. \fBBASE,REMOTE\fR"
  608. .sp
  609. Three tabs will open: the first one is a copy of the default layout, while the other two only show the differences between (\fBBASE\fR
  610. and
  611. \fBLOCAL\fR) and (\fBBASE\fR
  612. and
  613. \fBREMOTE\fR) respectively\&.
  614. .sp
  615. .if n \{\
  616. .RS 4
  617. .\}
  618. .nf
  619. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  620. | <TAB #1> | TAB #2 | TAB #3 | |
  621. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  622. | | | |
  623. | LOCAL | BASE | REMOTE |
  624. | | | |
  625. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  626. | |
  627. | MERGED |
  628. | |
  629. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  630. .fi
  631. .if n \{\
  632. .RE
  633. .\}
  634. .sp
  635. .if n \{\
  636. .RS 4
  637. .\}
  638. .nf
  639. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  640. | TAB #1 | <TAB #2> | TAB #3 | |
  641. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  642. | | |
  643. | | |
  644. | | |
  645. | BASE | LOCAL |
  646. | | |
  647. | | |
  648. | | |
  649. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  650. .fi
  651. .if n \{\
  652. .RE
  653. .\}
  654. .sp
  655. .if n \{\
  656. .RS 4
  657. .\}
  658. .nf
  659. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  660. | TAB #1 | TAB #2 | <TAB #3> | |
  661. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  662. | | |
  663. | | |
  664. | | |
  665. | BASE | REMOTE |
  666. | | |
  667. | | |
  668. | | |
  669. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  670. .fi
  671. .if n \{\
  672. .RE
  673. .\}
  674. .RE
  675. .sp
  676. .RS 4
  677. .ie n \{\
  678. \h'-04'\(bu\h'+03'\c
  679. .\}
  680. .el \{\
  681. .sp -1
  682. .IP \(bu 2.3
  683. .\}
  684. \fBlayout\fR
  685. \fB=\fR
  686. "LOCAL,BASE,REMOTE
  687. \fB/\fR
  688. \fBMERGED\fR
  689. \fB+\fR
  690. \fBBASE,LOCAL\fR
  691. \fB+\fR
  692. \fBBASE,REMOTE\fR
  693. \fB+\fR
  694. (\fBLOCAL/BASE/REMOTE\fR)\fB,MERGED\fR"
  695. .sp
  696. Same as the previous example, but adds a fourth tab with the same information as the first tab, with a different layout\&.
  697. .sp
  698. .if n \{\
  699. .RS 4
  700. .\}
  701. .nf
  702. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  703. | TAB #1 | TAB #2 | TAB #3 | <TAB #4> |
  704. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  705. | LOCAL | |
  706. |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |
  707. | BASE | MERGED |
  708. |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |
  709. | REMOTE | |
  710. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  711. .fi
  712. .if n \{\
  713. .RE
  714. .\}
  715. .sp
  716. Note how in the third tab definition we need to use parentheses to make
  717. \fB,\fR
  718. have precedence over
  719. \fB/\fR\&.
  720. .RE
  721. .RE
  722. .sp
  723. .it 1 an-trap
  724. .nr an-no-space-flag 1
  725. .nr an-break-flag 1
  726. .br
  727. .ps +1
  728. \fBVariants\fR
  729. .RS 4
  730. .sp
  731. Instead of \fB\-\-tool=vimdiff\fR, you can also use one of these other variants:
  732. .sp
  733. .RS 4
  734. .ie n \{\
  735. \h'-04'\(bu\h'+03'\c
  736. .\}
  737. .el \{\
  738. .sp -1
  739. .IP \(bu 2.3
  740. .\}
  741. \fB\-\-tool=gvimdiff\fR, to open gVim instead of Vim\&.
  742. .RE
  743. .sp
  744. .RS 4
  745. .ie n \{\
  746. \h'-04'\(bu\h'+03'\c
  747. .\}
  748. .el \{\
  749. .sp -1
  750. .IP \(bu 2.3
  751. .\}
  752. \fB\-\-tool=nvimdiff\fR, to open Neovim instead of Vim\&.
  753. .RE
  754. .sp
  755. When using these variants, in order to specify a custom layout you will have to set configuration variables \fBmergetool\&.gvimdiff\&.layout\fR and \fBmergetool\&.nvimdiff\&.layout\fR instead of \fBmergetool\&.vimdiff\&.layout\fR (though the latter will be used as fallback if the variant\-specific one is not set)\&.
  756. .sp
  757. In addition, for backwards compatibility with previous Git versions, you can also append \fB1\fR, \fB2\fR or \fB3\fR to either \fBvimdiff\fR or any of the variants (ex: \fBvimdiff3\fR, \fBnvimdiff1\fR, etc\&...\:) to use a predefined layout\&. In other words, using \fB\-\-tool=\fR[\fBg,n,\fR]\fBvimdiffx\fR is the same as using \fB\-\-tool=\fR[\fBg,n,\fR]\fBvimdiff\fR and setting configuration variable \fBmergetool\&.\fR[\fBg,n,\fR]\fBvimdiff\&.layout\fR to\&...\:
  758. .sp
  759. .RS 4
  760. .ie n \{\
  761. \h'-04'\(bu\h'+03'\c
  762. .\}
  763. .el \{\
  764. .sp -1
  765. .IP \(bu 2.3
  766. .\}
  767. \fBx=1\fR: "@LOCAL,
  768. \fBREMOTE\fR"
  769. .RE
  770. .sp
  771. .RS 4
  772. .ie n \{\
  773. \h'-04'\(bu\h'+03'\c
  774. .\}
  775. .el \{\
  776. .sp -1
  777. .IP \(bu 2.3
  778. .\}
  779. \fBx=2\fR: "LOCAL,
  780. \fBMERGED,\fR
  781. \fBREMOTE\fR"
  782. .RE
  783. .sp
  784. .RS 4
  785. .ie n \{\
  786. \h'-04'\(bu\h'+03'\c
  787. .\}
  788. .el \{\
  789. .sp -1
  790. .IP \(bu 2.3
  791. .\}
  792. \fBx=3\fR: "MERGED"
  793. .RE
  794. .sp
  795. Example: using \fB\-\-tool=gvimdiff2\fR will open \fBgvim\fR with three columns (LOCAL, MERGED and REMOTE)\&.
  796. .RE
  797. .SH "GIT"
  798. .sp
  799. Part of the \fBgit\fR(1) suite