Advertisement
Guest User

git mergetool --tool-help

a guest
Nov 4th, 2021
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.71 KB | None | 0 0
  1. $ git mergetool --tool-help
  2. 'git mergetool --tool=<tool>' may be set to one of the following:
  3. araxis
  4. meld
  5. vimdiff
  6. Opens vim with a 4 windows layout distributed in the following way:
  7.  
  8. ------------------------------------------
  9. | | | |
  10. | LOCAL | BASE | REMOTE |
  11. | | | |
  12. ------------------------------------------
  13. | |
  14. | MERGED |
  15. | |
  16. ------------------------------------------
  17.  
  18. "LOCAL", "BASE" and "REMOTE" are read-only buffers showing the contents of the
  19. conflicting file in a specific git commit ("commit you are merging into",
  20. "common ancestor commit" and "commit you are merging from" respectively)
  21.  
  22. "MERGED" is a writable buffer where you have to resolve the conflicts (using the
  23. other read-only buffers as a reference). Once you are done, save and exit "vim"
  24. as usual (":wq") or, if you want to abort, exit using ":cq".
  25.  
  26. You can change the windows layout used by vim by setting configuration variable
  27. "mergetool.vimdiff.layout" which accepts a string where these separators have
  28. special meaning:
  29.  
  30. - ";" is used to "open a new tab"
  31. - "-" is used to "open a new vertical split"
  32. - "|" is used to "open a new horizontal split"
  33.  
  34. Let's see some examples to undertand how it works:
  35.  
  36. * layout = "(LOCAL | BASE | REMOTE) - MERGED"
  37.  
  38. This is exactly the same as the default layout we have already seen.
  39.  
  40. * layout = "LOCAL | MERGED | REMOTE"
  41.  
  42. If, for some reason, we are not interested in the "BASE" buffer.
  43.  
  44. ------------------------------------------
  45. | | | |
  46. | | | |
  47. | LOCAL | MERGED | REMOTE |
  48. | | | |
  49. | | | |
  50. ------------------------------------------
  51.  
  52. * layout = "MERGED"
  53.  
  54. Only the "MERGED" buffer will be shown. Note, however, that all the other
  55. ones are still loaded in vim, and you can access them with the "buffers"
  56. command.
  57.  
  58. ------------------------------------------
  59. | |
  60. | |
  61. | MERGED |
  62. | |
  63. | |
  64. ------------------------------------------
  65.  
  66. * layout = "LOCAL* | REMOTE"
  67.  
  68. When "MERGED" is not present in the layout, you must "mark" one of the
  69. buffers with an asterisk. That will become the buffer you need to edit and
  70. save after resolving the conflicts.
  71.  
  72. ------------------------------------------
  73. | | |
  74. | | |
  75. | | |
  76. | LOCAL | REMOTE |
  77. | | |
  78. | | |
  79. | | |
  80. ------------------------------------------
  81.  
  82. * layout = "(LOCAL | BASE | REMOTE) - MERGED; BASE | LOCAL; BASE | REMOTE"
  83.  
  84. Three tabs will open: the first one is a copy of the default layout, while
  85. the other two only show the differences between "BASE" and "LOCAL" and
  86. "BASE" and "REMOTE" respectively.
  87.  
  88. ------------------------------------------
  89. | <TAB #1> | TAB #2 | TAB #3 | |
  90. ------------------------------------------
  91. | | | |
  92. | LOCAL | BASE | REMOTE |
  93. | | | |
  94. ------------------------------------------
  95. | |
  96. | MERGED |
  97. | |
  98. ------------------------------------------
  99.  
  100. ------------------------------------------
  101. | TAB #1 | <TAB #2> | TAB #3 | |
  102. ------------------------------------------
  103. | | |
  104. | | |
  105. | | |
  106. | BASE | LOCAL |
  107. | | |
  108. | | |
  109. | | |
  110. ------------------------------------------
  111.  
  112. ------------------------------------------
  113. | TAB #1 | TAB #2 | <TAB #3> | |
  114. ------------------------------------------
  115. | | |
  116. | | |
  117. | | |
  118. | BASE | REMOTE |
  119. | | |
  120. | | |
  121. | | |
  122. ------------------------------------------
  123.  
  124. * layout = "(LOCAL | BASE | REMOTE) - MERGED; BASE | LOCAL; BASE | REMOTE; (LOCAL - BASE - REMOTE) | MERGED"
  125.  
  126. Same as the previous example, but adds a fourth tab with the same
  127. information as the first tab, with a different layout.
  128.  
  129. ---------------------------------------------
  130. | TAB #1 | TAB #2 | TAB #3 | <TAB #4> |
  131. ---------------------------------------------
  132. | LOCAL | |
  133. |---------------------| |
  134. | BASE | MERGED |
  135. |---------------------| |
  136. | REMOTE | |
  137. ---------------------------------------------
  138.  
  139. vimdiff1
  140. Same as 'vimdiff' using this layout: "LOCAL* | REMOTE"
  141.  
  142. This will probably be deprecated in the future. Please use "vimdiff" and
  143. manually set the "mergetool.vimdiff.layout" configuration variable instead.
  144. vimdiff2
  145. Same as 'vimdiff' using this layout: "LOCAL | MERGED | REMOTE"
  146.  
  147. This will probably be deprecated in the future. Please use "vimdiff" and
  148. manually set the "mergetool.vimdiff.layout" configuration variable instead.
  149. vimdiff3
  150. Same as 'vimdiff' using this layout: "MERGED"
  151.  
  152. This will probably be deprecated in the future. Please use "vimdiff" and
  153. manually set the "mergetool.vimdiff.layout" configuration variable instead.
  154.  
  155. user-defined:
  156. vimdiff4.cmd vim -f -d -c "4wincmd w | wincmd J | tabnew | edit $LOCAL | vertical diffsplit $BASE | tabnew | edit $REMOTE | vertical diffsplit $BASE | 2tabprevious" "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
  157.  
  158. The following tools are valid, but not currently available:
  159. bc
  160. bc3
  161. bc4
  162. codecompare
  163. deltawalker
  164. diffmerge
  165. diffuse
  166. ecmerge
  167. emerge
  168. examdiff
  169. guiffy
  170. gvimdiff
  171. Same as 'vimdiff' but opens 'gvim' instead (which uses a graphical toolkit for
  172. opening its own window).
  173. The desired layout can be set with configuration variable
  174. "mergetool.gvimdiff.layout"
  175. gvimdiff1
  176. Same as 'gvimdiff' using this layout: "LOCAL* | REMOTE"
  177.  
  178. This will probably be deprecated in the future. Please use "gvimdiff" and
  179. manually set the "mergetool.gvimdiff.layout" configuration variable instead.
  180. gvimdiff2
  181. Same as 'gvimdiff' using this layout: "LOCAL | MERGED | REMOTE"
  182.  
  183. This will probably be deprecated in the future. Please use "gvimdiff" and
  184. manually set the "mergetool.gvimdiff.layout" configuration variable instead.
  185. gvimdiff3
  186. Same as 'gvimdiff' using this layout: "MERGED"
  187.  
  188. This will probably be deprecated in the future. Please use "gvimdiff" and
  189. manually set the "mergetool.gvimdiff.layout" configuration variable instead.
  190. kdiff3
  191. nvimdiff
  192. Same as 'vimdiff' but opens 'neovim' instead (which is a fork of the original
  193. 'vim' 'focused on extensibility and usability' according to their authors)
  194. The desired layout can be set with configuration variable
  195. "mergetool.nvimdiff.layout"
  196. nvimdiff1
  197. Same as 'nvimdiff' using this layout: "LOCAL* | REMOTE"
  198.  
  199. This will probably be deprecated in the future. Please use "nvimdiff" and
  200. manually set the "mergetool.nvimdiff.layout" configuration variable instead.
  201. nvimdiff2
  202. Same as 'nvimdiff' using this layout: "LOCAL | MERGED | REMOTE"
  203.  
  204. This will probably be deprecated in the future. Please use "nvimdiff" and
  205. manually set the "mergetool.nvimdiff.layout" configuration variable instead.
  206. nvimdiff3
  207. Same as 'nvimdiff' using this layout: "MERGED"
  208.  
  209. This will probably be deprecated in the future. Please use "nvimdiff" and
  210. manually set the "mergetool.nvimdiff.layout" configuration variable instead.
  211. opendiff
  212. p4merge
  213. smerge
  214. tkdiff
  215. tortoisemerge
  216. winmerge
  217. xxdiff
  218.  
  219. Some of the tools listed above only work in a windowed
  220. environment. If run in a terminal-only session, they will fail.
  221.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement