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-merge.1 (44432B)


  1. '\" t
  2. .\" Title: git-merge
  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\-MERGE" "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-merge \- Join two or more development histories together
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit merge\fR [\-n] [\-\-stat] [\-\-no\-commit] [\-\-squash] [\-\-[no\-]edit]
  36. [\-\-no\-verify] [\-s <strategy>] [\-X <strategy\-option>] [\-S[<keyid>]]
  37. [\-\-[no\-]allow\-unrelated\-histories]
  38. [\-\-[no\-]rerere\-autoupdate] [\-m <msg>] [\-F <file>]
  39. [\-\-into\-name <branch>] [<commit>\&...\:]
  40. \fIgit merge\fR (\-\-continue | \-\-abort | \-\-quit)
  41. .fi
  42. .SH "DESCRIPTION"
  43. .sp
  44. Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch\&. This command is used by \fBgit\fR \fBpull\fR to incorporate changes from another repository and can be used by hand to merge changes from one branch into another\&.
  45. .sp
  46. Assume the following history exists and the current branch is \fBmaster\fR:
  47. .sp
  48. .if n \{\
  49. .RS 4
  50. .\}
  51. .nf
  52. A\-\-\-B\-\-\-C topic
  53. /
  54. D\-\-\-E\-\-\-F\-\-\-G master
  55. .fi
  56. .if n \{\
  57. .RE
  58. .\}
  59. .sp
  60. Then \fBgit\fR \fBmerge\fR \fBtopic\fR will replay the changes made on the \fBtopic\fR branch since it diverged from \fBmaster\fR (i\&.e\&., \fBE\fR) until its current commit (\fBC\fR) on top of \fBmaster\fR, and record the result in a new commit along with the names of the two parent commits and a log message from the user describing the changes\&. Before the operation, \fBORIG_HEAD\fR is set to the tip of the current branch (\fBC\fR)\&.
  61. .sp
  62. .if n \{\
  63. .RS 4
  64. .\}
  65. .nf
  66. A\-\-\-B\-\-\-C topic
  67. / \e
  68. D\-\-\-E\-\-\-F\-\-\-G\-\-\-H master
  69. .fi
  70. .if n \{\
  71. .RE
  72. .\}
  73. .sp
  74. A merge stops if there\(cqs a conflict that cannot be resolved automatically or if \fB\-\-no\-commit\fR was provided when initiating the merge\&. At that point you can run \fBgit\fR \fBmerge\fR \fB\-\-abort\fR or \fBgit\fR \fBmerge\fR \fB\-\-continue\fR\&.
  75. .sp
  76. \fBgit\fR \fBmerge\fR \fB\-\-abort\fR will abort the merge process and try to reconstruct the pre\-merge state\&. However, if there were uncommitted changes when the merge started (and especially if those changes were further modified after the merge was started), \fBgit\fR \fBmerge\fR \fB\-\-abort\fR will in some cases be unable to reconstruct the original (pre\-merge) changes\&. Therefore:
  77. .sp
  78. \fBWarning\fR: Running \fBgit\fR \fBmerge\fR with non\-trivial uncommitted changes is discouraged: while possible, it may leave you in a state that is hard to back out of in the case of a conflict\&.
  79. .SH "OPTIONS"
  80. .PP
  81. \-\-commit, \-\-no\-commit
  82. .RS 4
  83. Perform the merge and commit the result\&. This option can be used to override \-\-no\-commit\&.
  84. .sp
  85. With \-\-no\-commit perform the merge and stop just before creating a merge commit, to give the user a chance to inspect and further tweak the merge result before committing\&.
  86. .sp
  87. Note that fast\-forward updates do not create a merge commit and therefore there is no way to stop those merges with \-\-no\-commit\&. Thus, if you want to ensure your branch is not changed or updated by the merge command, use \-\-no\-ff with \-\-no\-commit\&.
  88. .RE
  89. .PP
  90. \-\-edit, \-e, \-\-no\-edit
  91. .RS 4
  92. Invoke an editor before committing successful mechanical merge to further edit the auto\-generated merge message, so that the user can explain and justify the merge\&. The
  93. \fB\-\-no\-edit\fR
  94. option can be used to accept the auto\-generated message (this is generally discouraged)\&. The
  95. \fB\-\-edit\fR
  96. (or
  97. \fB\-e\fR) option is still useful if you are giving a draft message with the
  98. \fB\-m\fR
  99. option from the command line and want to edit it in the editor\&.
  100. .sp
  101. Older scripts may depend on the historical behaviour of not allowing the user to edit the merge log message\&. They will see an editor opened when they run
  102. \fBgit\fR
  103. \fBmerge\fR\&. To make it easier to adjust such scripts to the updated behaviour, the environment variable
  104. \fBGIT_MERGE_AUTOEDIT\fR
  105. can be set to
  106. \fBno\fR
  107. at the beginning of them\&.
  108. .RE
  109. .PP
  110. \-\-cleanup=<mode>
  111. .RS 4
  112. This option determines how the merge message will be cleaned up before committing\&. See
  113. \fBgit-commit\fR(1)
  114. for more details\&. In addition, if the
  115. \fI<mode>\fR
  116. is given a value of
  117. \fBscissors\fR, scissors will be appended to
  118. \fBMERGE_MSG\fR
  119. before being passed on to the commit machinery in the case of a merge conflict\&.
  120. .RE
  121. .PP
  122. \-\-ff, \-\-no\-ff, \-\-ff\-only
  123. .RS 4
  124. Specifies how a merge is handled when the merged\-in history is already a descendant of the current history\&.
  125. \fB\-\-ff\fR
  126. is the default unless merging an annotated (and possibly signed) tag that is not stored in its natural place in the
  127. \fBrefs/tags/\fR
  128. hierarchy, in which case
  129. \fB\-\-no\-ff\fR
  130. is assumed\&.
  131. .sp
  132. With
  133. \fB\-\-ff\fR, when possible resolve the merge as a fast\-forward (only update the branch pointer to match the merged branch; do not create a merge commit)\&. When not possible (when the merged\-in history is not a descendant of the current history), create a merge commit\&.
  134. .sp
  135. With
  136. \fB\-\-no\-ff\fR, create a merge commit in all cases, even when the merge could instead be resolved as a fast\-forward\&.
  137. .sp
  138. With
  139. \fB\-\-ff\-only\fR, resolve the merge as a fast\-forward when possible\&. When not possible, refuse to merge and exit with a non\-zero status\&.
  140. .RE
  141. .PP
  142. \-S[<keyid>], \-\-gpg\-sign[=<keyid>], \-\-no\-gpg\-sign
  143. .RS 4
  144. GPG\-sign the resulting merge commit\&. The
  145. \fBkeyid\fR
  146. argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space\&.
  147. \fB\-\-no\-gpg\-sign\fR
  148. is useful to countermand both
  149. \fBcommit\&.gpgSign\fR
  150. configuration variable, and earlier
  151. \fB\-\-gpg\-sign\fR\&.
  152. .RE
  153. .PP
  154. \-\-log[=<n>], \-\-no\-log
  155. .RS 4
  156. In addition to branch names, populate the log message with one\-line descriptions from at most <n> actual commits that are being merged\&. See also
  157. \fBgit-fmt-merge-msg\fR(1)\&.
  158. .sp
  159. With \-\-no\-log do not list one\-line descriptions from the actual commits being merged\&.
  160. .RE
  161. .PP
  162. \fB\-\-signoff\fR, \fB\-\-no\-signoff\fR
  163. .RS 4
  164. Add a
  165. \fBSigned\-off\-by\fR
  166. trailer by the committer at the end of the commit log message\&. The meaning of a signoff depends on the project to which you\(cqre committing\&. For example, it may certify that the committer has the rights to submit the work under the project\(cqs license or agrees to some contributor representation, such as a Developer Certificate of Origin\&. (See
  167. \m[blue]\fBhttps://developercertificate\&.org\fR\m[]
  168. for the one used by the Linux kernel and Git projects\&.) Consult the documentation or leadership of the project to which you\(cqre contributing to understand how the signoffs are used in that project\&.
  169. .sp
  170. The
  171. \fB\-\-no\-signoff\fR
  172. option can be used to countermand an earlier
  173. \fB\-\-signoff\fR
  174. option on the command line\&.
  175. .RE
  176. .PP
  177. \-\-stat, \-n, \-\-no\-stat
  178. .RS 4
  179. Show a diffstat at the end of the merge\&. The diffstat is also controlled by the configuration option merge\&.stat\&.
  180. .sp
  181. With \-n or \-\-no\-stat do not show a diffstat at the end of the merge\&.
  182. .RE
  183. .PP
  184. \-\-squash, \-\-no\-squash
  185. .RS 4
  186. Produce the working tree and index state as if a real merge happened (except for the merge information), but do not actually make a commit, move the
  187. \fBHEAD\fR, or record
  188. \fB$GIT_DIR/MERGE_HEAD\fR
  189. (to cause the next
  190. \fBgit\fR
  191. \fBcommit\fR
  192. command to create a merge commit)\&. This allows you to create a single commit on top of the current branch whose effect is the same as merging another branch (or more in case of an octopus)\&.
  193. .sp
  194. With \-\-no\-squash perform the merge and commit the result\&. This option can be used to override \-\-squash\&.
  195. .sp
  196. With \-\-squash, \-\-commit is not allowed, and will fail\&.
  197. .RE
  198. .PP
  199. \-\-[no\-]verify
  200. .RS 4
  201. By default, the pre\-merge and commit\-msg hooks are run\&. When
  202. \fB\-\-no\-verify\fR
  203. is given, these are bypassed\&. See also
  204. \fBgithooks\fR(5)\&.
  205. .RE
  206. .PP
  207. \-s <strategy>, \-\-strategy=<strategy>
  208. .RS 4
  209. Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried\&. If there is no
  210. \fB\-s\fR
  211. option, a built\-in list of strategies is used instead (\fBort\fR
  212. when merging a single head,
  213. \fBoctopus\fR
  214. otherwise)\&.
  215. .RE
  216. .PP
  217. \-X <option>, \-\-strategy\-option=<option>
  218. .RS 4
  219. Pass merge strategy specific option through to the merge strategy\&.
  220. .RE
  221. .PP
  222. \-\-verify\-signatures, \-\-no\-verify\-signatures
  223. .RS 4
  224. Verify that the tip commit of the side branch being merged is signed with a valid key, i\&.e\&. a key that has a valid uid: in the default trust model, this means the signing key has been signed by a trusted key\&. If the tip commit of the side branch is not signed with a valid key, the merge is aborted\&.
  225. .RE
  226. .PP
  227. \-\-summary, \-\-no\-summary
  228. .RS 4
  229. Synonyms to \-\-stat and \-\-no\-stat; these are deprecated and will be removed in the future\&.
  230. .RE
  231. .PP
  232. \-q, \-\-quiet
  233. .RS 4
  234. Operate quietly\&. Implies \-\-no\-progress\&.
  235. .RE
  236. .PP
  237. \-v, \-\-verbose
  238. .RS 4
  239. Be verbose\&.
  240. .RE
  241. .PP
  242. \-\-progress, \-\-no\-progress
  243. .RS 4
  244. Turn progress on/off explicitly\&. If neither is specified, progress is shown if standard error is connected to a terminal\&. Note that not all merge strategies may support progress reporting\&.
  245. .RE
  246. .PP
  247. \-\-autostash, \-\-no\-autostash
  248. .RS 4
  249. Automatically create a temporary stash entry before the operation begins, record it in the ref
  250. \fBMERGE_AUTOSTASH\fR
  251. and apply it after the operation ends\&. This means that you can run the operation on a dirty worktree\&. However, use with care: the final stash application after a successful merge might result in non\-trivial conflicts\&.
  252. .RE
  253. .PP
  254. \-\-allow\-unrelated\-histories
  255. .RS 4
  256. By default,
  257. \fBgit\fR
  258. \fBmerge\fR
  259. command refuses to merge histories that do not share a common ancestor\&. This option can be used to override this safety when merging histories of two projects that started their lives independently\&. As that is a very rare occasion, no configuration variable to enable this by default exists and will not be added\&.
  260. .RE
  261. .PP
  262. \-m <msg>
  263. .RS 4
  264. Set the commit message to be used for the merge commit (in case one is created)\&.
  265. .sp
  266. If
  267. \fB\-\-log\fR
  268. is specified, a shortlog of the commits being merged will be appended to the specified message\&.
  269. .sp
  270. The
  271. \fBgit\fR
  272. \fBfmt\-merge\-msg\fR
  273. command can be used to give a good default for automated
  274. \fBgit\fR
  275. \fBmerge\fR
  276. invocations\&. The automated message can include the branch description\&.
  277. .RE
  278. .PP
  279. \-\-into\-name <branch>
  280. .RS 4
  281. Prepare the default merge message as if merging to the branch
  282. \fI<branch>\fR, instead of the name of the real branch to which the merge is made\&.
  283. .RE
  284. .PP
  285. \-F <file>, \-\-file=<file>
  286. .RS 4
  287. Read the commit message to be used for the merge commit (in case one is created)\&.
  288. .sp
  289. If
  290. \fB\-\-log\fR
  291. is specified, a shortlog of the commits being merged will be appended to the specified message\&.
  292. .RE
  293. .PP
  294. \-\-rerere\-autoupdate, \-\-no\-rerere\-autoupdate
  295. .RS 4
  296. After the rerere mechanism reuses a recorded resolution on the current conflict to update the files in the working tree, allow it to also update the index with the result of resolution\&.
  297. \fB\-\-no\-rerere\-autoupdate\fR
  298. is a good way to double\-check what
  299. \fBrerere\fR
  300. did and catch potential mismerges, before committing the result to the index with a separate
  301. \fBgit\fR
  302. \fBadd\fR\&.
  303. .RE
  304. .PP
  305. \-\-overwrite\-ignore, \-\-no\-overwrite\-ignore
  306. .RS 4
  307. Silently overwrite ignored files from the merge result\&. This is the default behavior\&. Use
  308. \fB\-\-no\-overwrite\-ignore\fR
  309. to abort\&.
  310. .RE
  311. .PP
  312. \-\-abort
  313. .RS 4
  314. Abort the current conflict resolution process, and try to reconstruct the pre\-merge state\&. If an autostash entry is present, apply it to the worktree\&.
  315. .sp
  316. If there were uncommitted worktree changes present when the merge started,
  317. \fBgit\fR
  318. \fBmerge\fR
  319. \fB\-\-abort\fR
  320. will in some cases be unable to reconstruct these changes\&. It is therefore recommended to always commit or stash your changes before running
  321. \fBgit\fR
  322. \fBmerge\fR\&.
  323. .sp
  324. \fBgit\fR
  325. \fBmerge\fR
  326. \fB\-\-abort\fR
  327. is equivalent to
  328. \fBgit\fR
  329. \fBreset\fR
  330. \fB\-\-merge\fR
  331. when
  332. \fBMERGE_HEAD\fR
  333. is present unless
  334. \fBMERGE_AUTOSTASH\fR
  335. is also present in which case
  336. \fBgit\fR
  337. \fBmerge\fR
  338. \fB\-\-abort\fR
  339. applies the stash entry to the worktree whereas
  340. \fBgit\fR
  341. \fBreset\fR
  342. \fB\-\-merge\fR
  343. will save the stashed changes in the stash list\&.
  344. .RE
  345. .PP
  346. \-\-quit
  347. .RS 4
  348. Forget about the current merge in progress\&. Leave the index and the working tree as\-is\&. If
  349. \fBMERGE_AUTOSTASH\fR
  350. is present, the stash entry will be saved to the stash list\&.
  351. .RE
  352. .PP
  353. \-\-continue
  354. .RS 4
  355. After a
  356. \fBgit\fR
  357. \fBmerge\fR
  358. stops due to conflicts you can conclude the merge by running
  359. \fBgit\fR
  360. \fBmerge\fR
  361. \fB\-\-continue\fR
  362. (see "HOW TO RESOLVE CONFLICTS" section below)\&.
  363. .RE
  364. .PP
  365. <commit>\&...\:
  366. .RS 4
  367. Commits, usually other branch heads, to merge into our branch\&. Specifying more than one commit will create a merge with more than two parents (affectionately called an Octopus merge)\&.
  368. .sp
  369. If no commit is given from the command line, merge the remote\-tracking branches that the current branch is configured to use as its upstream\&. See also the configuration section of this manual page\&.
  370. .sp
  371. When
  372. \fBFETCH_HEAD\fR
  373. (and no other commit) is specified, the branches recorded in the \&.\fBgit/FETCH_HEAD\fR
  374. file by the previous invocation of
  375. \fBgit\fR
  376. \fBfetch\fR
  377. for merging are merged to the current branch\&.
  378. .RE
  379. .SH "PRE\-MERGE CHECKS"
  380. .sp
  381. Before applying outside changes, you should get your own work in good shape and committed locally, so it will not be clobbered if there are conflicts\&. See also \fBgit-stash\fR(1)\&. \fBgit\fR \fBpull\fR and \fBgit\fR \fBmerge\fR will stop without doing anything when local uncommitted changes overlap with files that \fBgit\fR \fBpull\fR/\fBgit\fR \fBmerge\fR may need to update\&.
  382. .sp
  383. To avoid recording unrelated changes in the merge commit, \fBgit\fR \fBpull\fR and \fBgit\fR \fBmerge\fR will also abort if there are any changes registered in the index relative to the \fBHEAD\fR commit\&. (Special narrow exceptions to this rule may exist depending on which merge strategy is in use, but generally, the index must match HEAD\&.)
  384. .sp
  385. If all named commits are already ancestors of \fBHEAD\fR, \fBgit\fR \fBmerge\fR will exit early with the message "Already up to date\&."
  386. .SH "FAST\-FORWARD MERGE"
  387. .sp
  388. Often the current branch head is an ancestor of the named commit\&. This is the most common case especially when invoked from \fBgit\fR \fBpull\fR: you are tracking an upstream repository, you have committed no local changes, and now you want to update to a newer upstream revision\&. In this case, a new commit is not needed to store the combined history; instead, the \fBHEAD\fR (along with the index) is updated to point at the named commit, without creating an extra merge commit\&.
  389. .sp
  390. This behavior can be suppressed with the \fB\-\-no\-ff\fR option\&.
  391. .SH "TRUE MERGE"
  392. .sp
  393. Except in a fast\-forward merge (see above), the branches to be merged must be tied together by a merge commit that has both of them as its parents\&.
  394. .sp
  395. A merged version reconciling the changes from all branches to be merged is committed, and your \fBHEAD\fR, index, and working tree are updated to it\&. It is possible to have modifications in the working tree as long as they do not overlap; the update will preserve them\&.
  396. .sp
  397. When it is not obvious how to reconcile the changes, the following happens:
  398. .sp
  399. .RS 4
  400. .ie n \{\
  401. \h'-04' 1.\h'+01'\c
  402. .\}
  403. .el \{\
  404. .sp -1
  405. .IP " 1." 4.2
  406. .\}
  407. The
  408. \fBHEAD\fR
  409. pointer stays the same\&.
  410. .RE
  411. .sp
  412. .RS 4
  413. .ie n \{\
  414. \h'-04' 2.\h'+01'\c
  415. .\}
  416. .el \{\
  417. .sp -1
  418. .IP " 2." 4.2
  419. .\}
  420. The
  421. \fBMERGE_HEAD\fR
  422. ref is set to point to the other branch head\&.
  423. .RE
  424. .sp
  425. .RS 4
  426. .ie n \{\
  427. \h'-04' 3.\h'+01'\c
  428. .\}
  429. .el \{\
  430. .sp -1
  431. .IP " 3." 4.2
  432. .\}
  433. Paths that merged cleanly are updated both in the index file and in your working tree\&.
  434. .RE
  435. .sp
  436. .RS 4
  437. .ie n \{\
  438. \h'-04' 4.\h'+01'\c
  439. .\}
  440. .el \{\
  441. .sp -1
  442. .IP " 4." 4.2
  443. .\}
  444. For conflicting paths, the index file records up to three versions: stage 1 stores the version from the common ancestor, stage 2 from
  445. \fBHEAD\fR, and stage 3 from
  446. \fBMERGE_HEAD\fR
  447. (you can inspect the stages with
  448. \fBgit\fR
  449. \fBls\-files\fR
  450. \fB\-u\fR)\&. The working tree files contain the result of the merge operation; i\&.e\&. 3\-way merge results with familiar conflict markers <<<
  451. \fB===\fR
  452. >>>\&.
  453. .RE
  454. .sp
  455. .RS 4
  456. .ie n \{\
  457. \h'-04' 5.\h'+01'\c
  458. .\}
  459. .el \{\
  460. .sp -1
  461. .IP " 5." 4.2
  462. .\}
  463. A ref named
  464. \fBAUTO_MERGE\fR
  465. is written, pointing to a tree corresponding to the current content of the working tree (including conflict markers for textual conflicts)\&. Note that this ref is only written when the
  466. \fIort\fR
  467. merge strategy is used (the default)\&.
  468. .RE
  469. .sp
  470. .RS 4
  471. .ie n \{\
  472. \h'-04' 6.\h'+01'\c
  473. .\}
  474. .el \{\
  475. .sp -1
  476. .IP " 6." 4.2
  477. .\}
  478. No other changes are made\&. In particular, the local modifications you had before you started merge will stay the same and the index entries for them stay as they were, i\&.e\&. matching
  479. \fBHEAD\fR\&.
  480. .RE
  481. .sp
  482. If you tried a merge which resulted in complex conflicts and want to start over, you can recover with \fBgit\fR \fBmerge\fR \fB\-\-abort\fR\&.
  483. .SH "MERGING TAG"
  484. .sp
  485. When merging an annotated (and possibly signed) tag, Git always creates a merge commit even if a fast\-forward merge is possible, and the commit message template is prepared with the tag message\&. Additionally, if the tag is signed, the signature check is reported as a comment in the message template\&. See also \fBgit-tag\fR(1)\&.
  486. .sp
  487. When you want to just integrate with the work leading to the commit that happens to be tagged, e\&.g\&. synchronizing with an upstream release point, you may not want to make an unnecessary merge commit\&.
  488. .sp
  489. In such a case, you can "unwrap" the tag yourself before feeding it to \fBgit\fR \fBmerge\fR, or pass \fB\-\-ff\-only\fR when you do not have any work on your own\&. e\&.g\&.
  490. .sp
  491. .if n \{\
  492. .RS 4
  493. .\}
  494. .nf
  495. git fetch origin
  496. git merge v1\&.2\&.3^0
  497. git merge \-\-ff\-only v1\&.2\&.3
  498. .fi
  499. .if n \{\
  500. .RE
  501. .\}
  502. .SH "HOW CONFLICTS ARE PRESENTED"
  503. .sp
  504. During a merge, the working tree files are updated to reflect the result of the merge\&. Among the changes made to the common ancestor\(cqs version, non\-overlapping ones (that is, you changed an area of the file while the other side left that area intact, or vice versa) are incorporated in the final result verbatim\&. When both sides made changes to the same area, however, Git cannot randomly pick one side over the other, and asks you to resolve it by leaving what both sides did to that area\&.
  505. .sp
  506. By default, Git uses the same style as the one used by the "merge" program from the RCS suite to present such a conflicted hunk, like this:
  507. .sp
  508. .if n \{\
  509. .RS 4
  510. .\}
  511. .nf
  512. Here are lines that are either unchanged from the common
  513. ancestor, or cleanly resolved because only one side changed,
  514. or cleanly resolved because both sides changed the same way\&.
  515. <<<<<<< yours:sample\&.txt
  516. Conflict resolution is hard;
  517. let\*(Aqs go shopping\&.
  518. =======
  519. Git makes conflict resolution easy\&.
  520. >>>>>>> theirs:sample\&.txt
  521. And here is another line that is cleanly resolved or unmodified\&.
  522. .fi
  523. .if n \{\
  524. .RE
  525. .\}
  526. .sp
  527. The area where a pair of conflicting changes happened is marked with markers <<<<<<<, \fB=======\fR, and >>>>>>>\&. The part before the \fB=======\fR is typically your side, and the part afterwards is typically their side\&.
  528. .sp
  529. The default format does not show what the original said in the conflicting area\&. You cannot tell how many lines are deleted and replaced with Barbie\(cqs remark on your side\&. The only thing you can tell is that your side wants to say it is hard and you\(cqd prefer to go shopping, while the other side wants to claim it is easy\&.
  530. .sp
  531. An alternative style can be used by setting the \fBmerge\&.conflictStyle\fR configuration variable to either "diff3" or "zdiff3"\&. In "diff3" style, the above conflict may look like this:
  532. .sp
  533. .if n \{\
  534. .RS 4
  535. .\}
  536. .nf
  537. Here are lines that are either unchanged from the common
  538. ancestor, or cleanly resolved because only one side changed,
  539. <<<<<<< yours:sample\&.txt
  540. or cleanly resolved because both sides changed the same way\&.
  541. Conflict resolution is hard;
  542. let\*(Aqs go shopping\&.
  543. ||||||| base:sample\&.txt
  544. or cleanly resolved because both sides changed identically\&.
  545. Conflict resolution is hard\&.
  546. =======
  547. or cleanly resolved because both sides changed the same way\&.
  548. Git makes conflict resolution easy\&.
  549. >>>>>>> theirs:sample\&.txt
  550. And here is another line that is cleanly resolved or unmodified\&.
  551. .fi
  552. .if n \{\
  553. .RE
  554. .\}
  555. .sp
  556. while in "zdiff3" style, it may look like this:
  557. .sp
  558. .if n \{\
  559. .RS 4
  560. .\}
  561. .nf
  562. Here are lines that are either unchanged from the common
  563. ancestor, or cleanly resolved because only one side changed,
  564. or cleanly resolved because both sides changed the same way\&.
  565. <<<<<<< yours:sample\&.txt
  566. Conflict resolution is hard;
  567. let\*(Aqs go shopping\&.
  568. ||||||| base:sample\&.txt
  569. or cleanly resolved because both sides changed identically\&.
  570. Conflict resolution is hard\&.
  571. =======
  572. Git makes conflict resolution easy\&.
  573. >>>>>>> theirs:sample\&.txt
  574. And here is another line that is cleanly resolved or unmodified\&.
  575. .fi
  576. .if n \{\
  577. .RE
  578. .\}
  579. .sp
  580. In addition to the <<<<<<<, \fB=======\fR, and >>>>>>> markers, it uses another ||||||| marker that is followed by the original text\&. You can tell that the original just stated a fact, and your side simply gave in to that statement and gave up, while the other side tried to have a more positive attitude\&. You can sometimes come up with a better resolution by viewing the original\&.
  581. .SH "HOW TO RESOLVE CONFLICTS"
  582. .sp
  583. After seeing a conflict, you can do two things:
  584. .sp
  585. .RS 4
  586. .ie n \{\
  587. \h'-04'\(bu\h'+03'\c
  588. .\}
  589. .el \{\
  590. .sp -1
  591. .IP \(bu 2.3
  592. .\}
  593. Decide not to merge\&. The only clean\-ups you need are to reset the index file to the
  594. \fBHEAD\fR
  595. commit to reverse 2\&. and to clean up working tree changes made by 2\&. and 3\&.;
  596. \fBgit\fR
  597. \fBmerge\fR
  598. \fB\-\-abort\fR
  599. can be used for this\&.
  600. .RE
  601. .sp
  602. .RS 4
  603. .ie n \{\
  604. \h'-04'\(bu\h'+03'\c
  605. .\}
  606. .el \{\
  607. .sp -1
  608. .IP \(bu 2.3
  609. .\}
  610. Resolve the conflicts\&. Git will mark the conflicts in the working tree\&. Edit the files into shape and
  611. \fBgit\fR
  612. \fBadd\fR
  613. them to the index\&. Use
  614. \fBgit\fR
  615. \fBcommit\fR
  616. or
  617. \fBgit\fR
  618. \fBmerge\fR
  619. \fB\-\-continue\fR
  620. to seal the deal\&. The latter command checks whether there is a (interrupted) merge in progress before calling
  621. \fBgit\fR
  622. \fBcommit\fR\&.
  623. .RE
  624. .sp
  625. You can work through the conflict with a number of tools:
  626. .sp
  627. .RS 4
  628. .ie n \{\
  629. \h'-04'\(bu\h'+03'\c
  630. .\}
  631. .el \{\
  632. .sp -1
  633. .IP \(bu 2.3
  634. .\}
  635. Use a mergetool\&.
  636. \fBgit\fR
  637. \fBmergetool\fR
  638. to launch a graphical mergetool which will work through the merge with you\&.
  639. .RE
  640. .sp
  641. .RS 4
  642. .ie n \{\
  643. \h'-04'\(bu\h'+03'\c
  644. .\}
  645. .el \{\
  646. .sp -1
  647. .IP \(bu 2.3
  648. .\}
  649. Look at the diffs\&.
  650. \fBgit\fR
  651. \fBdiff\fR
  652. will show a three\-way diff, highlighting changes from both the
  653. \fBHEAD\fR
  654. and
  655. \fBMERGE_HEAD\fR
  656. versions\&.
  657. \fBgit\fR
  658. \fBdiff\fR
  659. \fBAUTO_MERGE\fR
  660. will show what changes you\(cqve made so far to resolve textual conflicts\&.
  661. .RE
  662. .sp
  663. .RS 4
  664. .ie n \{\
  665. \h'-04'\(bu\h'+03'\c
  666. .\}
  667. .el \{\
  668. .sp -1
  669. .IP \(bu 2.3
  670. .\}
  671. Look at the diffs from each branch\&.
  672. \fBgit\fR
  673. \fBlog\fR
  674. \fB\-\-merge\fR
  675. \fB\-p\fR
  676. \fI<path>\fR
  677. will show diffs first for the
  678. \fBHEAD\fR
  679. version and then the
  680. \fBMERGE_HEAD\fR
  681. version\&.
  682. .RE
  683. .sp
  684. .RS 4
  685. .ie n \{\
  686. \h'-04'\(bu\h'+03'\c
  687. .\}
  688. .el \{\
  689. .sp -1
  690. .IP \(bu 2.3
  691. .\}
  692. Look at the originals\&.
  693. \fBgit\fR
  694. \fBshow\fR
  695. \fB:1:filename\fR
  696. shows the common ancestor,
  697. \fBgit\fR
  698. \fBshow\fR
  699. \fB:2:filename\fR
  700. shows the
  701. \fBHEAD\fR
  702. version, and
  703. \fBgit\fR
  704. \fBshow\fR
  705. \fB:3:filename\fR
  706. shows the
  707. \fBMERGE_HEAD\fR
  708. version\&.
  709. .RE
  710. .SH "EXAMPLES"
  711. .sp
  712. .RS 4
  713. .ie n \{\
  714. \h'-04'\(bu\h'+03'\c
  715. .\}
  716. .el \{\
  717. .sp -1
  718. .IP \(bu 2.3
  719. .\}
  720. Merge branches
  721. \fBfixes\fR
  722. and
  723. \fBenhancements\fR
  724. on top of the current branch, making an octopus merge:
  725. .sp
  726. .if n \{\
  727. .RS 4
  728. .\}
  729. .nf
  730. $ git merge fixes enhancements
  731. .fi
  732. .if n \{\
  733. .RE
  734. .\}
  735. .RE
  736. .sp
  737. .RS 4
  738. .ie n \{\
  739. \h'-04'\(bu\h'+03'\c
  740. .\}
  741. .el \{\
  742. .sp -1
  743. .IP \(bu 2.3
  744. .\}
  745. Merge branch
  746. \fBobsolete\fR
  747. into the current branch, using
  748. \fBours\fR
  749. merge strategy:
  750. .sp
  751. .if n \{\
  752. .RS 4
  753. .\}
  754. .nf
  755. $ git merge \-s ours obsolete
  756. .fi
  757. .if n \{\
  758. .RE
  759. .\}
  760. .RE
  761. .sp
  762. .RS 4
  763. .ie n \{\
  764. \h'-04'\(bu\h'+03'\c
  765. .\}
  766. .el \{\
  767. .sp -1
  768. .IP \(bu 2.3
  769. .\}
  770. Merge branch
  771. \fBmaint\fR
  772. into the current branch, but do not make a new commit automatically:
  773. .sp
  774. .if n \{\
  775. .RS 4
  776. .\}
  777. .nf
  778. $ git merge \-\-no\-commit maint
  779. .fi
  780. .if n \{\
  781. .RE
  782. .\}
  783. .sp
  784. This can be used when you want to include further changes to the merge, or want to write your own merge commit message\&.
  785. .sp
  786. You should refrain from abusing this option to sneak substantial changes into a merge commit\&. Small fixups like bumping release/version name would be acceptable\&.
  787. .RE
  788. .SH "MERGE STRATEGIES"
  789. .sp
  790. The merge mechanism (\fBgit\fR \fBmerge\fR and \fBgit\fR \fBpull\fR commands) allows the backend \fImerge strategies\fR to be chosen with \fB\-s\fR option\&. Some strategies can also take their own options, which can be passed by giving \fB\-X\fR\fI<option>\fR arguments to \fBgit\fR \fBmerge\fR and/or \fBgit\fR \fBpull\fR\&.
  791. .PP
  792. ort
  793. .RS 4
  794. This is the default merge strategy when pulling or merging one branch\&. This strategy can only resolve two heads using a 3\-way merge algorithm\&. When there is more than one common ancestor that can be used for 3\-way merge, it creates a merged tree of the common ancestors and uses that as the reference tree for the 3\-way merge\&. This has been reported to result in fewer merge conflicts without causing mismerges by tests done on actual merge commits taken from Linux 2\&.6 kernel development history\&. Additionally this strategy can detect and handle merges involving renames\&. It does not make use of detected copies\&. The name for this algorithm is an acronym ("Ostensibly Recursive\(cqs Twin") and came from the fact that it was written as a replacement for the previous default algorithm,
  795. \fBrecursive\fR\&.
  796. .sp
  797. In the case where the path is a submodule, if the submodule commit used on one side of the merge is a descendant of the submodule commit used on the other side of the merge, Git attempts to fast\-forward to the descendant\&. Otherwise, Git will treat this case as a conflict, suggesting as a resolution a submodule commit that is descendant of the conflicting ones, if one exists\&.
  798. .sp
  799. The
  800. \fIort\fR
  801. strategy can take the following options:
  802. .PP
  803. ours
  804. .RS 4
  805. This option forces conflicting hunks to be auto\-resolved cleanly by favoring
  806. \fIour\fR
  807. version\&. Changes from the other tree that do not conflict with our side are reflected in the merge result\&. For a binary file, the entire contents are taken from our side\&.
  808. .sp
  809. This should not be confused with the
  810. \fIours\fR
  811. merge strategy, which does not even look at what the other tree contains at all\&. It discards everything the other tree did, declaring
  812. \fIour\fR
  813. history contains all that happened in it\&.
  814. .RE
  815. .PP
  816. theirs
  817. .RS 4
  818. This is the opposite of
  819. \fIours\fR; note that, unlike
  820. \fIours\fR, there is no
  821. \fItheirs\fR
  822. merge strategy to confuse this merge option with\&.
  823. .RE
  824. .PP
  825. ignore\-space\-change, ignore\-all\-space, ignore\-space\-at\-eol, ignore\-cr\-at\-eol
  826. .RS 4
  827. Treats lines with the indicated type of whitespace change as unchanged for the sake of a three\-way merge\&. Whitespace changes mixed with other changes to a line are not ignored\&. See also
  828. \fBgit-diff\fR(1)
  829. \fB\-b\fR,
  830. \fB\-w\fR,
  831. \fB\-\-ignore\-space\-at\-eol\fR, and
  832. \fB\-\-ignore\-cr\-at\-eol\fR\&.
  833. .sp
  834. .RS 4
  835. .ie n \{\
  836. \h'-04'\(bu\h'+03'\c
  837. .\}
  838. .el \{\
  839. .sp -1
  840. .IP \(bu 2.3
  841. .\}
  842. If
  843. \fItheir\fR
  844. version only introduces whitespace changes to a line,
  845. \fIour\fR
  846. version is used;
  847. .RE
  848. .sp
  849. .RS 4
  850. .ie n \{\
  851. \h'-04'\(bu\h'+03'\c
  852. .\}
  853. .el \{\
  854. .sp -1
  855. .IP \(bu 2.3
  856. .\}
  857. If
  858. \fIour\fR
  859. version introduces whitespace changes but
  860. \fItheir\fR
  861. version includes a substantial change,
  862. \fItheir\fR
  863. version is used;
  864. .RE
  865. .sp
  866. .RS 4
  867. .ie n \{\
  868. \h'-04'\(bu\h'+03'\c
  869. .\}
  870. .el \{\
  871. .sp -1
  872. .IP \(bu 2.3
  873. .\}
  874. Otherwise, the merge proceeds in the usual way\&.
  875. .RE
  876. .RE
  877. .PP
  878. renormalize
  879. .RS 4
  880. This runs a virtual check\-out and check\-in of all three stages of any file which needs a three\-way merge\&. This option is meant to be used when merging branches with different clean filters or end\-of\-line normalization rules\&. See "Merging branches with differing checkin/checkout attributes" in
  881. \fBgitattributes\fR(5)
  882. for details\&.
  883. .RE
  884. .PP
  885. no\-renormalize
  886. .RS 4
  887. Disables the
  888. \fBrenormalize\fR
  889. option\&. This overrides the
  890. \fBmerge\&.renormalize\fR
  891. configuration variable\&.
  892. .RE
  893. .PP
  894. find\-renames[=<n>]
  895. .RS 4
  896. Turn on rename detection, optionally setting the similarity threshold\&. This is the default\&. This overrides the
  897. \fImerge\&.renames\fR
  898. configuration variable\&. See also
  899. \fBgit-diff\fR(1)
  900. \fB\-\-find\-renames\fR\&.
  901. .RE
  902. .PP
  903. rename\-threshold=<n>
  904. .RS 4
  905. Deprecated synonym for
  906. \fBfind\-renames=\fR\fI<n>\fR\&.
  907. .RE
  908. .PP
  909. subtree[=<path>]
  910. .RS 4
  911. This option is a more advanced form of
  912. \fIsubtree\fR
  913. strategy, where the strategy makes a guess on how two trees must be shifted to match with each other when merging\&. Instead, the specified path is prefixed (or stripped from the beginning) to make the shape of two trees to match\&.
  914. .RE
  915. .RE
  916. .PP
  917. recursive
  918. .RS 4
  919. This can only resolve two heads using a 3\-way merge algorithm\&. When there is more than one common ancestor that can be used for 3\-way merge, it creates a merged tree of the common ancestors and uses that as the reference tree for the 3\-way merge\&. This has been reported to result in fewer merge conflicts without causing mismerges by tests done on actual merge commits taken from Linux 2\&.6 kernel development history\&. Additionally this can detect and handle merges involving renames\&. It does not make use of detected copies\&. This was the default strategy for resolving two heads from Git v0\&.99\&.9k until v2\&.33\&.0\&.
  920. .sp
  921. For a path that is a submodule, the same caution as
  922. \fIort\fR
  923. applies to this strategy\&.
  924. .sp
  925. The
  926. \fIrecursive\fR
  927. strategy takes the same options as
  928. \fIort\fR\&. However, there are three additional options that
  929. \fIort\fR
  930. ignores (not documented above) that are potentially useful with the
  931. \fIrecursive\fR
  932. strategy:
  933. .PP
  934. patience
  935. .RS 4
  936. Deprecated synonym for
  937. \fBdiff\-algorithm=patience\fR\&.
  938. .RE
  939. .PP
  940. diff\-algorithm=[patience|minimal|histogram|myers]
  941. .RS 4
  942. Use a different diff algorithm while merging, which can help avoid mismerges that occur due to unimportant matching lines (such as braces from distinct functions)\&. See also
  943. \fBgit-diff\fR(1)
  944. \fB\-\-diff\-algorithm\fR\&. Note that
  945. \fBort\fR
  946. specifically uses
  947. \fBdiff\-algorithm=histogram\fR, while
  948. \fBrecursive\fR
  949. defaults to the
  950. \fBdiff\&.algorithm\fR
  951. config setting\&.
  952. .RE
  953. .PP
  954. no\-renames
  955. .RS 4
  956. Turn off rename detection\&. This overrides the
  957. \fBmerge\&.renames\fR
  958. configuration variable\&. See also
  959. \fBgit-diff\fR(1)
  960. \fB\-\-no\-renames\fR\&.
  961. .RE
  962. .RE
  963. .PP
  964. resolve
  965. .RS 4
  966. This can only resolve two heads (i\&.e\&. the current branch and another branch you pulled from) using a 3\-way merge algorithm\&. It tries to carefully detect criss\-cross merge ambiguities\&. It does not handle renames\&.
  967. .RE
  968. .PP
  969. octopus
  970. .RS 4
  971. This resolves cases with more than two heads, but refuses to do a complex merge that needs manual resolution\&. It is primarily meant to be used for bundling topic branch heads together\&. This is the default merge strategy when pulling or merging more than one branch\&.
  972. .RE
  973. .PP
  974. ours
  975. .RS 4
  976. This resolves any number of heads, but the resulting tree of the merge is always that of the current branch head, effectively ignoring all changes from all other branches\&. It is meant to be used to supersede old development history of side branches\&. Note that this is different from the \-Xours option to the
  977. \fIrecursive\fR
  978. merge strategy\&.
  979. .RE
  980. .PP
  981. subtree
  982. .RS 4
  983. This is a modified
  984. \fBort\fR
  985. strategy\&. When merging trees A and B, if B corresponds to a subtree of A, B is first adjusted to match the tree structure of A, instead of reading the trees at the same level\&. This adjustment is also done to the common ancestor tree\&.
  986. .RE
  987. .sp
  988. With the strategies that use 3\-way merge (including the default, \fIort\fR), if a change is made on both branches, but later reverted on one of the branches, that change will be present in the merged result; some people find this behavior confusing\&. It occurs because only the heads and the merge base are considered when performing a merge, not the individual commits\&. The merge algorithm therefore considers the reverted change as no change at all, and substitutes the changed version instead\&.
  989. .SH "CONFIGURATION"
  990. .PP
  991. branch\&.<name>\&.mergeOptions
  992. .RS 4
  993. Sets default options for merging into branch <name>\&. The syntax and supported options are the same as those of
  994. \fBgit\fR
  995. \fBmerge\fR, but option values containing whitespace characters are currently not supported\&.
  996. .RE
  997. .sp
  998. 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:
  999. .PP
  1000. merge\&.conflictStyle
  1001. .RS 4
  1002. Specify the style in which conflicted hunks are written out to working tree files upon merge\&. The default is "merge", which shows a <<<<<<< conflict marker, changes made by one side, a
  1003. \fB=======\fR
  1004. marker, changes made by the other side, and then a >>>>>>> marker\&. An alternate style, "diff3", adds a ||||||| marker and the original text before the
  1005. \fB=======\fR
  1006. marker\&. The "merge" style tends to produce smaller conflict regions than diff3, both because of the exclusion of the original text, and because when a subset of lines match on the two sides, they are just pulled out of the conflict region\&. Another alternate style, "zdiff3", is similar to diff3 but removes matching lines on the two sides from the conflict region when those matching lines appear near either the beginning or end of a conflict region\&.
  1007. .RE
  1008. .PP
  1009. merge\&.defaultToUpstream
  1010. .RS 4
  1011. If merge is called without any commit argument, merge the upstream branches configured for the current branch by using their last observed values stored in their remote\-tracking branches\&. The values of the
  1012. \fBbranch\&.\fR<current
  1013. \fBbranch\fR>\fB\&.merge\fR
  1014. that name the branches at the remote named by
  1015. \fBbranch\&.\fR<current
  1016. \fBbranch\fR>\fB\&.remote\fR
  1017. are consulted, and then they are mapped via
  1018. \fBremote\&.\fR\fI<remote>\fR\fB\&.fetch\fR
  1019. to their corresponding remote\-tracking branches, and the tips of these tracking branches are merged\&. Defaults to true\&.
  1020. .RE
  1021. .PP
  1022. merge\&.ff
  1023. .RS 4
  1024. By default, Git does not create an extra merge commit when merging a commit that is a descendant of the current commit\&. Instead, the tip of the current branch is fast\-forwarded\&. When set to
  1025. \fBfalse\fR, this variable tells Git to create an extra merge commit in such a case (equivalent to giving the
  1026. \fB\-\-no\-ff\fR
  1027. option from the command line)\&. When set to
  1028. \fBonly\fR, only such fast\-forward merges are allowed (equivalent to giving the
  1029. \fB\-\-ff\-only\fR
  1030. option from the command line)\&.
  1031. .RE
  1032. .PP
  1033. merge\&.verifySignatures
  1034. .RS 4
  1035. If true, this is equivalent to the \-\-verify\-signatures command line option\&. See
  1036. \fBgit-merge\fR(1)
  1037. for details\&.
  1038. .RE
  1039. .PP
  1040. merge\&.branchdesc
  1041. .RS 4
  1042. In addition to branch names, populate the log message with the branch description text associated with them\&. Defaults to false\&.
  1043. .RE
  1044. .PP
  1045. merge\&.log
  1046. .RS 4
  1047. In addition to branch names, populate the log message with at most the specified number of one\-line descriptions from the actual commits that are being merged\&. Defaults to false, and true is a synonym for 20\&.
  1048. .RE
  1049. .PP
  1050. merge\&.suppressDest
  1051. .RS 4
  1052. By adding a glob that matches the names of integration branches to this multi\-valued configuration variable, the default merge message computed for merges into these integration branches will omit "into <branch name>" from its title\&.
  1053. .sp
  1054. An element with an empty value can be used to clear the list of globs accumulated from previous configuration entries\&. When there is no
  1055. \fBmerge\&.suppressDest\fR
  1056. variable defined, the default value of
  1057. \fBmaster\fR
  1058. is used for backward compatibility\&.
  1059. .RE
  1060. .PP
  1061. merge\&.renameLimit
  1062. .RS 4
  1063. The number of files to consider in the exhaustive portion of rename detection during a merge\&. If not specified, defaults to the value of diff\&.renameLimit\&. If neither merge\&.renameLimit nor diff\&.renameLimit are specified, currently defaults to 7000\&. This setting has no effect if rename detection is turned off\&.
  1064. .RE
  1065. .PP
  1066. merge\&.renames
  1067. .RS 4
  1068. Whether Git detects renames\&. If set to "false", rename detection is disabled\&. If set to "true", basic rename detection is enabled\&. Defaults to the value of diff\&.renames\&.
  1069. .RE
  1070. .PP
  1071. merge\&.directoryRenames
  1072. .RS 4
  1073. Whether Git detects directory renames, affecting what happens at merge time to new files added to a directory on one side of history when that directory was renamed on the other side of history\&. If merge\&.directoryRenames is set to "false", directory rename detection is disabled, meaning that such new files will be left behind in the old directory\&. If set to "true", directory rename detection is enabled, meaning that such new files will be moved into the new directory\&. If set to "conflict", a conflict will be reported for such paths\&. If merge\&.renames is false, merge\&.directoryRenames is ignored and treated as false\&. Defaults to "conflict"\&.
  1074. .RE
  1075. .PP
  1076. merge\&.renormalize
  1077. .RS 4
  1078. Tell Git that canonical representation of files in the repository has changed over time (e\&.g\&. earlier commits record text files with CRLF line endings, but recent ones use LF line endings)\&. In such a repository, for each file where a three\-way content merge is needed, Git can convert the data recorded in commits to a canonical form before performing a merge to reduce unnecessary conflicts\&. For more information, see section "Merging branches with differing checkin/checkout attributes" in
  1079. \fBgitattributes\fR(5)\&.
  1080. .RE
  1081. .PP
  1082. merge\&.stat
  1083. .RS 4
  1084. Whether to print the diffstat between ORIG_HEAD and the merge result at the end of the merge\&. True by default\&.
  1085. .RE
  1086. .PP
  1087. merge\&.autoStash
  1088. .RS 4
  1089. When set to true, automatically create a temporary stash entry before the operation begins, and apply it after the operation ends\&. This means that you can run merge on a dirty worktree\&. However, use with care: the final stash application after a successful merge might result in non\-trivial conflicts\&. This option can be overridden by the
  1090. \fB\-\-no\-autostash\fR
  1091. and
  1092. \fB\-\-autostash\fR
  1093. options of
  1094. \fBgit-merge\fR(1)\&. Defaults to false\&.
  1095. .RE
  1096. .PP
  1097. merge\&.tool
  1098. .RS 4
  1099. Controls which merge tool is used by
  1100. \fBgit-mergetool\fR(1)\&. The list below shows the valid built\-in values\&. Any other value is treated as a custom merge tool and requires that a corresponding mergetool\&.<tool>\&.cmd variable is defined\&.
  1101. .RE
  1102. .PP
  1103. merge\&.guitool
  1104. .RS 4
  1105. Controls which merge tool is used by
  1106. \fBgit-mergetool\fR(1)
  1107. when the \-g/\-\-gui flag is specified\&. The list below shows the valid built\-in values\&. Any other value is treated as a custom merge tool and requires that a corresponding mergetool\&.<guitool>\&.cmd variable is defined\&.
  1108. .PP
  1109. \fBaraxis\fR
  1110. .RS 4
  1111. Use Araxis Merge (requires a graphical session)
  1112. .RE
  1113. .PP
  1114. \fBbc\fR
  1115. .RS 4
  1116. Use Beyond Compare (requires a graphical session)
  1117. .RE
  1118. .PP
  1119. \fBbc3\fR
  1120. .RS 4
  1121. Use Beyond Compare (requires a graphical session)
  1122. .RE
  1123. .PP
  1124. \fBbc4\fR
  1125. .RS 4
  1126. Use Beyond Compare (requires a graphical session)
  1127. .RE
  1128. .PP
  1129. \fBcodecompare\fR
  1130. .RS 4
  1131. Use Code Compare (requires a graphical session)
  1132. .RE
  1133. .PP
  1134. \fBdeltawalker\fR
  1135. .RS 4
  1136. Use DeltaWalker (requires a graphical session)
  1137. .RE
  1138. .PP
  1139. \fBdiffmerge\fR
  1140. .RS 4
  1141. Use DiffMerge (requires a graphical session)
  1142. .RE
  1143. .PP
  1144. \fBdiffuse\fR
  1145. .RS 4
  1146. Use Diffuse (requires a graphical session)
  1147. .RE
  1148. .PP
  1149. \fBecmerge\fR
  1150. .RS 4
  1151. Use ECMerge (requires a graphical session)
  1152. .RE
  1153. .PP
  1154. \fBemerge\fR
  1155. .RS 4
  1156. Use Emacs\*(Aq Emerge
  1157. .RE
  1158. .PP
  1159. \fBexamdiff\fR
  1160. .RS 4
  1161. Use ExamDiff Pro (requires a graphical session)
  1162. .RE
  1163. .PP
  1164. \fBguiffy\fR
  1165. .RS 4
  1166. Use Guiffy\(cqs Diff Tool (requires a graphical session)
  1167. .RE
  1168. .PP
  1169. \fBgvimdiff\fR
  1170. .RS 4
  1171. Use gVim (requires a graphical session) with a custom layout (see
  1172. \fBgit\fR
  1173. \fBhelp\fR
  1174. \fBmergetool\fR\*(Aqs
  1175. \fBBACKEND\fR
  1176. \fBSPECIFIC\fR
  1177. \fBHINTS\fR
  1178. section)
  1179. .RE
  1180. .PP
  1181. \fBgvimdiff1\fR
  1182. .RS 4
  1183. Use gVim (requires a graphical session) with a 2 panes layout (LOCAL and REMOTE)
  1184. .RE
  1185. .PP
  1186. \fBgvimdiff2\fR
  1187. .RS 4
  1188. Use gVim (requires a graphical session) with a 3 panes layout (LOCAL, MERGED and REMOTE)
  1189. .RE
  1190. .PP
  1191. \fBgvimdiff3\fR
  1192. .RS 4
  1193. Use gVim (requires a graphical session) where only the MERGED file is shown
  1194. .RE
  1195. .PP
  1196. \fBkdiff3\fR
  1197. .RS 4
  1198. Use KDiff3 (requires a graphical session)
  1199. .RE
  1200. .PP
  1201. \fBmeld\fR
  1202. .RS 4
  1203. Use Meld (requires a graphical session) with optional
  1204. \fBauto\fR
  1205. \fBmerge\fR
  1206. (see
  1207. \fBgit\fR
  1208. \fBhelp\fR
  1209. \fBmergetool\fR\*(Aqs
  1210. \fBCONFIGURATION\fR
  1211. section)
  1212. .RE
  1213. .PP
  1214. \fBnvimdiff\fR
  1215. .RS 4
  1216. Use Neovim with a custom layout (see
  1217. \fBgit\fR
  1218. \fBhelp\fR
  1219. \fBmergetool\fR\*(Aqs
  1220. \fBBACKEND\fR
  1221. \fBSPECIFIC\fR
  1222. \fBHINTS\fR
  1223. section)
  1224. .RE
  1225. .PP
  1226. \fBnvimdiff1\fR
  1227. .RS 4
  1228. Use Neovim with a 2 panes layout (LOCAL and REMOTE)
  1229. .RE
  1230. .PP
  1231. \fBnvimdiff2\fR
  1232. .RS 4
  1233. Use Neovim with a 3 panes layout (LOCAL, MERGED and REMOTE)
  1234. .RE
  1235. .PP
  1236. \fBnvimdiff3\fR
  1237. .RS 4
  1238. Use Neovim where only the MERGED file is shown
  1239. .RE
  1240. .PP
  1241. \fBopendiff\fR
  1242. .RS 4
  1243. Use FileMerge (requires a graphical session)
  1244. .RE
  1245. .PP
  1246. \fBp4merge\fR
  1247. .RS 4
  1248. Use HelixCore P4Merge (requires a graphical session)
  1249. .RE
  1250. .PP
  1251. \fBsmerge\fR
  1252. .RS 4
  1253. Use Sublime Merge (requires a graphical session)
  1254. .RE
  1255. .PP
  1256. \fBtkdiff\fR
  1257. .RS 4
  1258. Use TkDiff (requires a graphical session)
  1259. .RE
  1260. .PP
  1261. \fBtortoisemerge\fR
  1262. .RS 4
  1263. Use TortoiseMerge (requires a graphical session)
  1264. .RE
  1265. .PP
  1266. \fBvimdiff\fR
  1267. .RS 4
  1268. Use Vim with a custom layout (see
  1269. \fBgit\fR
  1270. \fBhelp\fR
  1271. \fBmergetool\fR\*(Aqs
  1272. \fBBACKEND\fR
  1273. \fBSPECIFIC\fR
  1274. \fBHINTS\fR
  1275. section)
  1276. .RE
  1277. .PP
  1278. \fBvimdiff1\fR
  1279. .RS 4
  1280. Use Vim with a 2 panes layout (LOCAL and REMOTE)
  1281. .RE
  1282. .PP
  1283. \fBvimdiff2\fR
  1284. .RS 4
  1285. Use Vim with a 3 panes layout (LOCAL, MERGED and REMOTE)
  1286. .RE
  1287. .PP
  1288. \fBvimdiff3\fR
  1289. .RS 4
  1290. Use Vim where only the MERGED file is shown
  1291. .RE
  1292. .PP
  1293. \fBvscode\fR
  1294. .RS 4
  1295. Use Visual Studio Code (requires a graphical session)
  1296. .RE
  1297. .PP
  1298. \fBwinmerge\fR
  1299. .RS 4
  1300. Use WinMerge (requires a graphical session)
  1301. .RE
  1302. .PP
  1303. \fBxxdiff\fR
  1304. .RS 4
  1305. Use xxdiff (requires a graphical session)
  1306. .RE
  1307. .RE
  1308. .PP
  1309. merge\&.verbosity
  1310. .RS 4
  1311. Controls the amount of output shown by the recursive merge strategy\&. Level 0 outputs nothing except a final error message if conflicts were detected\&. Level 1 outputs only conflicts, 2 outputs conflicts and file changes\&. Level 5 and above outputs debugging information\&. The default is level 2\&. Can be overridden by the
  1312. \fBGIT_MERGE_VERBOSITY\fR
  1313. environment variable\&.
  1314. .RE
  1315. .PP
  1316. merge\&.<driver>\&.name
  1317. .RS 4
  1318. Defines a human\-readable name for a custom low\-level merge driver\&. See
  1319. \fBgitattributes\fR(5)
  1320. for details\&.
  1321. .RE
  1322. .PP
  1323. merge\&.<driver>\&.driver
  1324. .RS 4
  1325. Defines the command that implements a custom low\-level merge driver\&. See
  1326. \fBgitattributes\fR(5)
  1327. for details\&.
  1328. .RE
  1329. .PP
  1330. merge\&.<driver>\&.recursive
  1331. .RS 4
  1332. Names a low\-level merge driver to be used when performing an internal merge between common ancestors\&. See
  1333. \fBgitattributes\fR(5)
  1334. for details\&.
  1335. .RE
  1336. .SH "SEE ALSO"
  1337. .sp
  1338. \fBgit-fmt-merge-msg\fR(1), \fBgit-pull\fR(1), \fBgitattributes\fR(5), \fBgit-reset\fR(1), \fBgit-diff\fR(1), \fBgit-ls-files\fR(1), \fBgit-add\fR(1), \fBgit-rm\fR(1), \fBgit-mergetool\fR(1)
  1339. .SH "GIT"
  1340. .sp
  1341. Part of the \fBgit\fR(1) suite