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-difftool.1 (10215B)


  1. '\" t
  2. .\" Title: git-difftool
  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\-DIFFTOOL" "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-difftool \- Show changes using common diff tools
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit difftool\fR [<options>] [<commit> [<commit>]] [\-\-] [<path>\&...\:]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. \fIgit difftool\fR is a Git command that allows you to compare and edit files between revisions using common diff tools\&. \fIgit difftool\fR is a frontend to \fIgit diff\fR and accepts the same options and arguments\&. See \fBgit-diff\fR(1)\&.
  40. .SH "OPTIONS"
  41. .PP
  42. \-d, \-\-dir\-diff
  43. .RS 4
  44. Copy the modified files to a temporary location and perform a directory diff on them\&. This mode never prompts before launching the diff tool\&.
  45. .RE
  46. .PP
  47. \-y, \-\-no\-prompt
  48. .RS 4
  49. Do not prompt before launching a diff tool\&.
  50. .RE
  51. .PP
  52. \-\-prompt
  53. .RS 4
  54. Prompt before each invocation of the diff tool\&. This is the default behaviour; the option is provided to override any configuration settings\&.
  55. .RE
  56. .PP
  57. \-\-rotate\-to=<file>
  58. .RS 4
  59. Start showing the diff for the given path, the paths before it will move to the end and output\&.
  60. .RE
  61. .PP
  62. \-\-skip\-to=<file>
  63. .RS 4
  64. Start showing the diff for the given path, skipping all the paths before it\&.
  65. .RE
  66. .PP
  67. \-t <tool>, \-\-tool=<tool>
  68. .RS 4
  69. Use the diff tool specified by <tool>\&. Valid values include emerge, kompare, meld, and vimdiff\&. Run
  70. \fBgit\fR
  71. \fBdifftool\fR
  72. \fB\-\-tool\-help\fR
  73. for the list of valid <tool> settings\&.
  74. .sp
  75. If a diff tool is not specified,
  76. \fIgit difftool\fR
  77. will use the configuration variable
  78. \fBdiff\&.tool\fR\&. If the configuration variable
  79. \fBdiff\&.tool\fR
  80. is not set,
  81. \fIgit difftool\fR
  82. will pick a suitable default\&.
  83. .sp
  84. You can explicitly provide a full path to the tool by setting the configuration variable
  85. \fBdifftool\&.\fR\fI<tool>\fR\fB\&.path\fR\&. For example, you can configure the absolute path to kdiff3 by setting
  86. \fBdifftool\&.kdiff3\&.path\fR\&. Otherwise,
  87. \fIgit difftool\fR
  88. assumes the tool is available in PATH\&.
  89. .sp
  90. Instead of running one of the known diff tools,
  91. \fIgit difftool\fR
  92. can be customized to run an alternative program by specifying the command line to invoke in a configuration variable
  93. \fBdifftool\&.\fR\fI<tool>\fR\fB\&.cmd\fR\&.
  94. .sp
  95. When
  96. \fIgit difftool\fR
  97. is invoked with this tool (either through the
  98. \fB\-t\fR
  99. or
  100. \fB\-\-tool\fR
  101. option or the
  102. \fBdiff\&.tool\fR
  103. configuration variable) the configured command line will be invoked with the following variables available:
  104. \fB$LOCAL\fR
  105. is set to the name of the temporary file containing the contents of the diff pre\-image and
  106. \fB$REMOTE\fR
  107. is set to the name of the temporary file containing the contents of the diff post\-image\&.
  108. \fB$MERGED\fR
  109. is the name of the file which is being compared\&.
  110. \fB$BASE\fR
  111. is provided for compatibility with custom merge tool commands and has the same value as
  112. \fB$MERGED\fR\&.
  113. .RE
  114. .PP
  115. \-\-tool\-help
  116. .RS 4
  117. Print a list of diff tools that may be used with
  118. \fB\-\-tool\fR\&.
  119. .RE
  120. .PP
  121. \-\-[no\-]symlinks
  122. .RS 4
  123. \fIgit difftool\fR\*(Aqs default behavior is to create symlinks to the working tree when run in
  124. \fB\-\-dir\-diff\fR
  125. mode and the right\-hand side of the comparison yields the same content as the file in the working tree\&.
  126. .sp
  127. Specifying
  128. \fB\-\-no\-symlinks\fR
  129. instructs
  130. \fIgit difftool\fR
  131. to create copies instead\&.
  132. \fB\-\-no\-symlinks\fR
  133. is the default on Windows\&.
  134. .RE
  135. .PP
  136. \-x <command>, \-\-extcmd=<command>
  137. .RS 4
  138. Specify a custom command for viewing diffs\&.
  139. \fIgit\-difftool\fR
  140. ignores the configured defaults and runs
  141. \fI<command>\fR
  142. \fB$LOCAL\fR
  143. \fB$REMOTE\fR
  144. when this option is specified\&. Additionally,
  145. \fB$BASE\fR
  146. is set in the environment\&.
  147. .RE
  148. .PP
  149. \-g, \-\-[no\-]gui
  150. .RS 4
  151. When
  152. \fIgit\-difftool\fR
  153. is invoked with the
  154. \fB\-g\fR
  155. or
  156. \fB\-\-gui\fR
  157. option the default diff tool will be read from the configured
  158. \fBdiff\&.guitool\fR
  159. variable instead of
  160. \fBdiff\&.tool\fR\&. This may be selected automatically using the configuration variable
  161. \fBdifftool\&.guiDefault\fR\&. The
  162. \fB\-\-no\-gui\fR
  163. option can be used to override these settings\&. If
  164. \fBdiff\&.guitool\fR
  165. is not set, we will fallback in the order of
  166. \fBmerge\&.guitool\fR,
  167. \fBdiff\&.tool\fR,
  168. \fBmerge\&.tool\fR
  169. until a tool is found\&.
  170. .RE
  171. .PP
  172. \-\-[no\-]trust\-exit\-code
  173. .RS 4
  174. Errors reported by the diff tool are ignored by default\&. Use
  175. \fB\-\-trust\-exit\-code\fR
  176. to make
  177. \fIgit\-difftool\fR
  178. exit when an invoked diff tool returns a non\-zero exit code\&.
  179. .sp
  180. \fIgit\-difftool\fR
  181. will forward the exit code of the invoked tool when
  182. \fB\-\-trust\-exit\-code\fR
  183. is used\&.
  184. .RE
  185. .sp
  186. See \fBgit-diff\fR(1) for the full list of supported options\&.
  187. .SH "CONFIGURATION"
  188. .sp
  189. \fIgit difftool\fR falls back to \fIgit mergetool\fR config variables when the difftool equivalents have not been defined\&.
  190. .sp
  191. Everything above this line in this section isn\(cqt included from the \fBgit-config\fR(1) documentation\&. The content that follows is the same as what\(cqs found there:
  192. .PP
  193. diff\&.tool
  194. .RS 4
  195. Controls which diff tool is used by
  196. \fBgit-difftool\fR(1)\&. This variable overrides the value configured in
  197. \fBmerge\&.tool\fR\&. The list below shows the valid built\-in values\&. Any other value is treated as a custom diff tool and requires that a corresponding difftool\&.<tool>\&.cmd variable is defined\&.
  198. .RE
  199. .PP
  200. diff\&.guitool
  201. .RS 4
  202. Controls which diff tool is used by
  203. \fBgit-difftool\fR(1)
  204. when the \-g/\-\-gui flag is specified\&. This variable overrides the value configured in
  205. \fBmerge\&.guitool\fR\&. The list below shows the valid built\-in values\&. Any other value is treated as a custom diff tool and requires that a corresponding difftool\&.<guitool>\&.cmd variable is defined\&.
  206. .PP
  207. \fBaraxis\fR
  208. .RS 4
  209. Use Araxis Merge (requires a graphical session)
  210. .RE
  211. .PP
  212. \fBbc\fR
  213. .RS 4
  214. Use Beyond Compare (requires a graphical session)
  215. .RE
  216. .PP
  217. \fBbc3\fR
  218. .RS 4
  219. Use Beyond Compare (requires a graphical session)
  220. .RE
  221. .PP
  222. \fBbc4\fR
  223. .RS 4
  224. Use Beyond Compare (requires a graphical session)
  225. .RE
  226. .PP
  227. \fBcodecompare\fR
  228. .RS 4
  229. Use Code Compare (requires a graphical session)
  230. .RE
  231. .PP
  232. \fBdeltawalker\fR
  233. .RS 4
  234. Use DeltaWalker (requires a graphical session)
  235. .RE
  236. .PP
  237. \fBdiffmerge\fR
  238. .RS 4
  239. Use DiffMerge (requires a graphical session)
  240. .RE
  241. .PP
  242. \fBdiffuse\fR
  243. .RS 4
  244. Use Diffuse (requires a graphical session)
  245. .RE
  246. .PP
  247. \fBecmerge\fR
  248. .RS 4
  249. Use ECMerge (requires a graphical session)
  250. .RE
  251. .PP
  252. \fBemerge\fR
  253. .RS 4
  254. Use Emacs\*(Aq Emerge
  255. .RE
  256. .PP
  257. \fBexamdiff\fR
  258. .RS 4
  259. Use ExamDiff Pro (requires a graphical session)
  260. .RE
  261. .PP
  262. \fBguiffy\fR
  263. .RS 4
  264. Use Guiffy\(cqs Diff Tool (requires a graphical session)
  265. .RE
  266. .PP
  267. \fBgvimdiff\fR
  268. .RS 4
  269. Use gVim (requires a graphical session)
  270. .RE
  271. .PP
  272. \fBkdiff3\fR
  273. .RS 4
  274. Use KDiff3 (requires a graphical session)
  275. .RE
  276. .PP
  277. \fBkompare\fR
  278. .RS 4
  279. Use Kompare (requires a graphical session)
  280. .RE
  281. .PP
  282. \fBmeld\fR
  283. .RS 4
  284. Use Meld (requires a graphical session)
  285. .RE
  286. .PP
  287. \fBnvimdiff\fR
  288. .RS 4
  289. Use Neovim
  290. .RE
  291. .PP
  292. \fBopendiff\fR
  293. .RS 4
  294. Use FileMerge (requires a graphical session)
  295. .RE
  296. .PP
  297. \fBp4merge\fR
  298. .RS 4
  299. Use HelixCore P4Merge (requires a graphical session)
  300. .RE
  301. .PP
  302. \fBsmerge\fR
  303. .RS 4
  304. Use Sublime Merge (requires a graphical session)
  305. .RE
  306. .PP
  307. \fBtkdiff\fR
  308. .RS 4
  309. Use TkDiff (requires a graphical session)
  310. .RE
  311. .PP
  312. \fBvimdiff\fR
  313. .RS 4
  314. Use Vim
  315. .RE
  316. .PP
  317. \fBvscode\fR
  318. .RS 4
  319. Use Visual Studio Code (requires a graphical session)
  320. .RE
  321. .PP
  322. \fBwinmerge\fR
  323. .RS 4
  324. Use WinMerge (requires a graphical session)
  325. .RE
  326. .PP
  327. \fBxxdiff\fR
  328. .RS 4
  329. Use xxdiff (requires a graphical session)
  330. .RE
  331. .RE
  332. .PP
  333. difftool\&.<tool>\&.cmd
  334. .RS 4
  335. Specify the command to invoke the specified diff tool\&. The specified command is evaluated in shell with the following variables available:
  336. \fILOCAL\fR
  337. is set to the name of the temporary file containing the contents of the diff pre\-image and
  338. \fIREMOTE\fR
  339. is set to the name of the temporary file containing the contents of the diff post\-image\&.
  340. .sp
  341. See the
  342. \fB\-\-tool=\fR\fI<tool>\fR
  343. option in
  344. \fBgit-difftool\fR(1)
  345. for more details\&.
  346. .RE
  347. .PP
  348. difftool\&.<tool>\&.path
  349. .RS 4
  350. Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
  351. .RE
  352. .PP
  353. difftool\&.trustExitCode
  354. .RS 4
  355. Exit difftool if the invoked diff tool returns a non\-zero exit status\&.
  356. .sp
  357. See the
  358. \fB\-\-trust\-exit\-code\fR
  359. option in
  360. \fBgit-difftool\fR(1)
  361. for more details\&.
  362. .RE
  363. .PP
  364. difftool\&.prompt
  365. .RS 4
  366. Prompt before each invocation of the diff tool\&.
  367. .RE
  368. .PP
  369. difftool\&.guiDefault
  370. .RS 4
  371. Set
  372. \fBtrue\fR
  373. to use the
  374. \fBdiff\&.guitool\fR
  375. by default (equivalent to specifying the
  376. \fB\-\-gui\fR
  377. argument), or
  378. \fBauto\fR
  379. to select
  380. \fBdiff\&.guitool\fR
  381. or
  382. \fBdiff\&.tool\fR
  383. depending on the presence of a
  384. \fBDISPLAY\fR
  385. environment variable value\&. The default is
  386. \fBfalse\fR, where the
  387. \fB\-\-gui\fR
  388. argument must be provided explicitly for the
  389. \fBdiff\&.guitool\fR
  390. to be used\&.
  391. .RE
  392. .SH "SEE ALSO"
  393. .PP
  394. \fBgit-diff\fR(1)
  395. .RS 4
  396. Show changes between commits, commit and working tree, etc
  397. .RE
  398. .PP
  399. \fBgit-mergetool\fR(1)
  400. .RS 4
  401. Run merge conflict resolution tools to resolve merge conflicts
  402. .RE
  403. .PP
  404. \fBgit-config\fR(1)
  405. .RS 4
  406. Get and set repository or global options
  407. .RE
  408. .SH "GIT"
  409. .sp
  410. Part of the \fBgit\fR(1) suite