Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.2.5" /> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 19 | a { |
| 20 | color: blue; |
| 21 | text-decoration: underline; |
| 22 | } |
| 23 | a:visited { |
| 24 | color: fuchsia; |
| 25 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 26 | |
| 27 | em { |
| 28 | font-style: italic; |
| 29 | } |
| 30 | |
| 31 | strong { |
| 32 | font-weight: bold; |
| 33 | } |
| 34 | |
| 35 | tt { |
| 36 | color: navy; |
| 37 | } |
| 38 | |
| 39 | h1, h2, h3, h4, h5, h6 { |
| 40 | color: #527bbd; |
| 41 | font-family: sans-serif; |
| 42 | margin-top: 1.2em; |
| 43 | margin-bottom: 0.5em; |
| 44 | line-height: 1.3; |
| 45 | } |
| 46 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 47 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 48 | border-bottom: 2px solid silver; |
| 49 | } |
| 50 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | padding-top: 0.5em; |
| 52 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 53 | h3 { |
| 54 | float: left; |
| 55 | } |
| 56 | h3 + * { |
| 57 | clear: left; |
| 58 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | |
| 60 | div.sectionbody { |
| 61 | font-family: serif; |
| 62 | margin-left: 0; |
| 63 | } |
| 64 | |
| 65 | hr { |
| 66 | border: 1px solid silver; |
| 67 | } |
| 68 | |
| 69 | p { |
| 70 | margin-top: 0.5em; |
| 71 | margin-bottom: 0.5em; |
| 72 | } |
| 73 | |
| 74 | pre { |
| 75 | padding: 0; |
| 76 | margin: 0; |
| 77 | } |
| 78 | |
| 79 | span#author { |
| 80 | color: #527bbd; |
| 81 | font-family: sans-serif; |
| 82 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 83 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 84 | } |
| 85 | span#email { |
| 86 | } |
| 87 | span#revision { |
| 88 | font-family: sans-serif; |
| 89 | } |
| 90 | |
| 91 | div#footer { |
| 92 | font-family: sans-serif; |
| 93 | font-size: small; |
| 94 | border-top: 2px solid silver; |
| 95 | padding-top: 0.5em; |
| 96 | margin-top: 4.0em; |
| 97 | } |
| 98 | div#footer-text { |
| 99 | float: left; |
| 100 | padding-bottom: 0.5em; |
| 101 | } |
| 102 | div#footer-badges { |
| 103 | float: right; |
| 104 | padding-bottom: 0.5em; |
| 105 | } |
| 106 | |
| 107 | div#preamble, |
| 108 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 109 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 110 | div.admonitionblock { |
| 111 | margin-right: 10%; |
| 112 | margin-top: 1.5em; |
| 113 | margin-bottom: 1.5em; |
| 114 | } |
| 115 | div.admonitionblock { |
| 116 | margin-top: 2.5em; |
| 117 | margin-bottom: 2.5em; |
| 118 | } |
| 119 | |
| 120 | div.content { /* Block element content. */ |
| 121 | padding: 0; |
| 122 | } |
| 123 | |
| 124 | /* Block element titles. */ |
| 125 | div.title, caption.title { |
| 126 | font-family: sans-serif; |
| 127 | font-weight: bold; |
| 128 | text-align: left; |
| 129 | margin-top: 1.0em; |
| 130 | margin-bottom: 0.5em; |
| 131 | } |
| 132 | div.title + * { |
| 133 | margin-top: 0; |
| 134 | } |
| 135 | |
| 136 | td div.title:first-child { |
| 137 | margin-top: 0.0em; |
| 138 | } |
| 139 | div.content div.title:first-child { |
| 140 | margin-top: 0.0em; |
| 141 | } |
| 142 | div.content + div.title { |
| 143 | margin-top: 0.0em; |
| 144 | } |
| 145 | |
| 146 | div.sidebarblock > div.content { |
| 147 | background: #ffffee; |
| 148 | border: 1px solid silver; |
| 149 | padding: 0.5em; |
| 150 | } |
| 151 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 152 | div.listingblock { |
| 153 | margin-right: 0%; |
| 154 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 155 | div.listingblock > div.content { |
| 156 | border: 1px solid silver; |
| 157 | background: #f4f4f4; |
| 158 | padding: 0.5em; |
| 159 | } |
| 160 | |
| 161 | div.quoteblock > div.content { |
| 162 | padding-left: 2.0em; |
| 163 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 164 | |
| 165 | div.attribution { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 166 | text-align: right; |
| 167 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 168 | div.verseblock + div.attribution { |
| 169 | text-align: left; |
| 170 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 171 | |
| 172 | div.admonitionblock .icon { |
| 173 | vertical-align: top; |
| 174 | font-size: 1.1em; |
| 175 | font-weight: bold; |
| 176 | text-decoration: underline; |
| 177 | color: #527bbd; |
| 178 | padding-right: 0.5em; |
| 179 | } |
| 180 | div.admonitionblock td.content { |
| 181 | padding-left: 0.5em; |
| 182 | border-left: 2px solid silver; |
| 183 | } |
| 184 | |
| 185 | div.exampleblock > div.content { |
| 186 | border-left: 2px solid silver; |
| 187 | padding: 0.5em; |
| 188 | } |
| 189 | |
| 190 | div.verseblock div.content { |
| 191 | white-space: pre; |
| 192 | } |
| 193 | |
| 194 | div.imageblock div.content { padding-left: 0; } |
| 195 | div.imageblock img { border: 1px solid silver; } |
| 196 | span.image img { border-style: none; } |
| 197 | |
| 198 | dl { |
| 199 | margin-top: 0.8em; |
| 200 | margin-bottom: 0.8em; |
| 201 | } |
| 202 | dt { |
| 203 | margin-top: 0.5em; |
| 204 | margin-bottom: 0; |
| 205 | font-style: italic; |
| 206 | } |
| 207 | dd > *:first-child { |
| 208 | margin-top: 0; |
| 209 | } |
| 210 | |
| 211 | ul, ol { |
| 212 | list-style-position: outside; |
| 213 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 214 | div.olist2 ol { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 215 | list-style-type: lower-alpha; |
| 216 | } |
| 217 | |
| 218 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 219 | border: 3px solid #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 220 | } |
| 221 | thead { |
| 222 | font-family: sans-serif; |
| 223 | font-weight: bold; |
| 224 | } |
| 225 | tfoot { |
| 226 | font-weight: bold; |
| 227 | } |
| 228 | |
| 229 | div.hlist { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 233 | div.hlist td { |
| 234 | padding-bottom: 5px; |
| 235 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 236 | td.hlist1 { |
| 237 | vertical-align: top; |
| 238 | font-style: italic; |
| 239 | padding-right: 0.8em; |
| 240 | } |
| 241 | td.hlist2 { |
| 242 | vertical-align: top; |
| 243 | } |
| 244 | |
| 245 | @media print { |
| 246 | div#footer-badges { display: none; } |
| 247 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 248 | |
| 249 | div#toctitle { |
| 250 | color: #527bbd; |
| 251 | font-family: sans-serif; |
| 252 | font-size: 1.1em; |
| 253 | font-weight: bold; |
| 254 | margin-top: 1.0em; |
| 255 | margin-bottom: 0.1em; |
| 256 | } |
| 257 | |
| 258 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 259 | margin-top: 0; |
| 260 | margin-bottom: 0; |
| 261 | } |
| 262 | div.toclevel2 { |
| 263 | margin-left: 2em; |
| 264 | font-size: 0.9em; |
| 265 | } |
| 266 | div.toclevel3 { |
| 267 | margin-left: 4em; |
| 268 | font-size: 0.9em; |
| 269 | } |
| 270 | div.toclevel4 { |
| 271 | margin-left: 6em; |
| 272 | font-size: 0.9em; |
| 273 | } |
| 274 | include1::./stylesheets/xhtml11-manpage.css[] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 275 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 276 | |
| 277 | div.sidebar-content { |
| 278 | background: #ffffee; |
| 279 | border: 1px solid silver; |
| 280 | padding: 0.5em; |
| 281 | } |
| 282 | div.sidebar-title, div.image-title { |
| 283 | font-family: sans-serif; |
| 284 | font-weight: bold; |
| 285 | margin-top: 0.0em; |
| 286 | margin-bottom: 0.5em; |
| 287 | } |
| 288 | |
| 289 | div.listingblock div.content { |
| 290 | border: 1px solid silver; |
| 291 | background: #f4f4f4; |
| 292 | padding: 0.5em; |
| 293 | } |
| 294 | |
| 295 | div.quoteblock-content { |
| 296 | padding-left: 2.0em; |
| 297 | } |
| 298 | |
| 299 | div.exampleblock-content { |
| 300 | border-left: 2px solid silver; |
| 301 | padding-left: 0.5em; |
| 302 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 303 | |
| 304 | /* IE6 sets dynamically generated links as visited. */ |
| 305 | div#toc a:visited { color: blue; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 306 | </style> |
| 307 | <title>git-merge(1)</title> |
| 308 | </head> |
| 309 | <body> |
| 310 | <div id="header"> |
| 311 | <h1> |
| 312 | git-merge(1) Manual Page |
| 313 | </h1> |
| 314 | <h2>NAME</h2> |
| 315 | <div class="sectionbody"> |
| 316 | <p>git-merge - |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 317 | Join two or more development histories together |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 318 | </p> |
| 319 | </div> |
| 320 | </div> |
| 321 | <h2>SYNOPSIS</h2> |
| 322 | <div class="sectionbody"> |
Junio C Hamano | ee6d961 | 2006-11-27 20:03:22 | [diff] [blame] | 323 | <div class="verseblock"> |
Junio C Hamano | b04bb3f | 2010-04-14 14:07:36 | [diff] [blame] | 324 | <div class="content"><em>git merge</em> [-n] [--stat] [--no-commit] [--squash] |
| 325 | [-s <strategy>] [-X <strategy-option>] |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 326 | [--[no-]rerere-autoupdate] [-m <msg>] <commit>… |
| 327 | <em>git merge</em> <msg> HEAD <commit>…</div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 328 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 329 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 330 | <div class="sectionbody"> |
Junio C Hamano | d0d892c | 2010-01-24 20:06:29 | [diff] [blame] | 331 | <div class="para"><p>Incorporates changes from the named commits (since the time their |
| 332 | histories diverged from the current branch) into the current |
| 333 | branch. This command is used by <em>git pull</em> to incorporate changes |
| 334 | from another repository and can be used by hand to merge changes |
| 335 | from one branch into another.</p></div> |
| 336 | <div class="para"><p>Assume the following history exists and the current branch is |
| 337 | "<tt>master</tt>":</p></div> |
| 338 | <div class="listingblock"> |
| 339 | <div class="content"> |
| 340 | <pre><tt> A---B---C topic |
| 341 | / |
| 342 | D---E---F---G master</tt></pre> |
| 343 | </div></div> |
| 344 | <div class="para"><p>Then "<tt>git merge topic</tt>" will replay the changes made on the |
| 345 | <tt>topic</tt> branch since it diverged from <tt>master</tt> (i.e., <tt>E</tt>) until |
| 346 | its current commit (<tt>C</tt>) on top of <tt>master</tt>, and record the result |
| 347 | in a new commit along with the names of the two parent commits and |
| 348 | a log message from the user describing the changes.</p></div> |
| 349 | <div class="listingblock"> |
| 350 | <div class="content"> |
| 351 | <pre><tt> A---B---C topic |
| 352 | / \ |
| 353 | D---E---F---G---H master</tt></pre> |
| 354 | </div></div> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 355 | <div class="para"><p>The second syntax (<msg> <tt>HEAD</tt> <commit>…) is supported for |
Junio C Hamano | 1974bf2 | 2007-10-31 05:57:20 | [diff] [blame] | 356 | historical reasons. Do not use it from the command line or in |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 357 | new scripts. It is the same as <tt>git merge -m <msg> <commit>…</tt>.</p></div> |
| 358 | <div class="para"><p><strong>Warning</strong>: Running <em>git merge</em> with uncommitted changes is |
| 359 | discouraged: while possible, it leaves you in a state that is hard to |
| 360 | back out of in the case of a conflict.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 361 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 362 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 363 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 364 | <div class="vlist"><dl> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 365 | <dt> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 366 | --commit |
| 367 | </dt> |
| 368 | <dt> |
| 369 | --no-commit |
| 370 | </dt> |
| 371 | <dd> |
| 372 | <p> |
| 373 | Perform the merge and commit the result. This option can |
| 374 | be used to override --no-commit. |
| 375 | </p> |
| 376 | <div class="para"><p>With --no-commit perform the merge but pretend the merge |
| 377 | failed and do not autocommit, to give the user a chance to |
| 378 | inspect and further tweak the merge result before committing.</p></div> |
| 379 | </dd> |
| 380 | <dt> |
| 381 | --ff |
| 382 | </dt> |
| 383 | <dt> |
| 384 | --no-ff |
| 385 | </dt> |
| 386 | <dd> |
| 387 | <p> |
| 388 | Do not generate a merge commit if the merge resolved as |
| 389 | a fast-forward, only update the branch pointer. This is |
| 390 | the default behavior of git-merge. |
| 391 | </p> |
| 392 | <div class="para"><p>With --no-ff Generate a merge commit even if the merge |
| 393 | resolved as a fast-forward.</p></div> |
| 394 | </dd> |
| 395 | <dt> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 396 | --log[=<n>] |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 397 | </dt> |
| 398 | <dt> |
| 399 | --no-log |
| 400 | </dt> |
| 401 | <dd> |
| 402 | <p> |
| 403 | In addition to branch names, populate the log message with |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 404 | one-line descriptions from at most <n> actual commits that are being |
| 405 | merged. See also <a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>. |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 406 | </p> |
| 407 | <div class="para"><p>With --no-log do not list one-line descriptions from the |
| 408 | actual commits being merged.</p></div> |
| 409 | </dd> |
| 410 | <dt> |
| 411 | --stat |
| 412 | </dt> |
| 413 | <dt> |
| 414 | -n |
| 415 | </dt> |
| 416 | <dt> |
| 417 | --no-stat |
| 418 | </dt> |
| 419 | <dd> |
| 420 | <p> |
| 421 | Show a diffstat at the end of the merge. The diffstat is also |
| 422 | controlled by the configuration option merge.stat. |
| 423 | </p> |
| 424 | <div class="para"><p>With -n or --no-stat do not show a diffstat at the end of the |
| 425 | merge.</p></div> |
| 426 | </dd> |
| 427 | <dt> |
| 428 | --squash |
| 429 | </dt> |
| 430 | <dt> |
| 431 | --no-squash |
| 432 | </dt> |
| 433 | <dd> |
| 434 | <p> |
| 435 | Produce the working tree and index state as if a real |
| 436 | merge happened (except for the merge information), |
| 437 | but do not actually make a commit or |
| 438 | move the <tt>HEAD</tt>, nor record <tt>$GIT_DIR/MERGE_HEAD</tt> to |
| 439 | cause the next <tt>git commit</tt> command to create a merge |
| 440 | commit. This allows you to create a single commit on |
| 441 | top of the current branch whose effect is the same as |
| 442 | merging another branch (or more in case of an octopus). |
| 443 | </p> |
| 444 | <div class="para"><p>With --no-squash perform the merge and commit the result. This |
| 445 | option can be used to override --squash.</p></div> |
| 446 | </dd> |
| 447 | <dt> |
Junio C Hamano | 446ed77 | 2009-11-10 22:02:20 | [diff] [blame] | 448 | --ff-only |
| 449 | </dt> |
| 450 | <dd> |
| 451 | <p> |
| 452 | Refuse to merge and exit with a non-zero status unless the |
| 453 | current <tt>HEAD</tt> is already up-to-date or the merge can be |
| 454 | resolved as a fast-forward. |
| 455 | </p> |
| 456 | </dd> |
| 457 | <dt> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 458 | -s <strategy> |
| 459 | </dt> |
| 460 | <dt> |
| 461 | --strategy=<strategy> |
| 462 | </dt> |
| 463 | <dd> |
| 464 | <p> |
| 465 | Use the given merge strategy; can be supplied more than |
| 466 | once to specify them in the order they should be tried. |
| 467 | If there is no <tt>-s</tt> option, a built-in list of strategies |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 468 | is used instead (<em>git merge-recursive</em> when merging a single |
| 469 | head, <em>git merge-octopus</em> otherwise). |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 470 | </p> |
| 471 | </dd> |
| 472 | <dt> |
Junio C Hamano | b04bb3f | 2010-04-14 14:07:36 | [diff] [blame] | 473 | -X <option> |
| 474 | </dt> |
| 475 | <dt> |
| 476 | --strategy-option=<option> |
| 477 | </dt> |
| 478 | <dd> |
| 479 | <p> |
| 480 | Pass merge strategy specific option through to the merge |
| 481 | strategy. |
| 482 | </p> |
| 483 | </dd> |
| 484 | <dt> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 485 | --summary |
| 486 | </dt> |
| 487 | <dt> |
| 488 | --no-summary |
| 489 | </dt> |
| 490 | <dd> |
| 491 | <p> |
| 492 | Synonyms to --stat and --no-stat; these are deprecated and will be |
| 493 | removed in the future. |
| 494 | </p> |
| 495 | </dd> |
| 496 | <dt> |
Junio C Hamano | 610d176 | 2008-11-28 06:27:13 | [diff] [blame] | 497 | -q |
| 498 | </dt> |
| 499 | <dt> |
| 500 | --quiet |
| 501 | </dt> |
| 502 | <dd> |
| 503 | <p> |
| 504 | Operate quietly. |
| 505 | </p> |
| 506 | </dd> |
| 507 | <dt> |
| 508 | -v |
| 509 | </dt> |
| 510 | <dt> |
| 511 | --verbose |
| 512 | </dt> |
| 513 | <dd> |
| 514 | <p> |
| 515 | Be verbose. |
| 516 | </p> |
| 517 | </dd> |
| 518 | <dt> |
Junio C Hamano | 1974bf2 | 2007-10-31 05:57:20 | [diff] [blame] | 519 | -m <msg> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 520 | </dt> |
| 521 | <dd> |
| 522 | <p> |
Junio C Hamano | c0e55e7 | 2009-10-10 00:56:29 | [diff] [blame] | 523 | Set the commit message to be used for the merge commit (in |
Junio C Hamano | f5de4cf | 2010-06-19 00:33:17 | [diff] [blame] | 524 | case one is created). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 525 | </p> |
Junio C Hamano | f5de4cf | 2010-06-19 00:33:17 | [diff] [blame] | 526 | <div class="literalblock"> |
| 527 | <div class="content"> |
| 528 | <pre><tt>If `--log` is specified, a shortlog of the commits being merged |
| 529 | will be appended to the specified message.</tt></pre> |
| 530 | </div></div> |
| 531 | <div class="literalblock"> |
| 532 | <div class="content"> |
| 533 | <pre><tt>The 'git fmt-merge-msg' command can be |
| 534 | used to give a good default for automated 'git merge' |
| 535 | invocations.</tt></pre> |
| 536 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 537 | </dd> |
| 538 | <dt> |
Junio C Hamano | 19107ef | 2010-01-19 06:20:59 | [diff] [blame] | 539 | --rerere-autoupdate |
| 540 | </dt> |
| 541 | <dt> |
| 542 | --no-rerere-autoupdate |
| 543 | </dt> |
| 544 | <dd> |
| 545 | <p> |
| 546 | Allow the rerere mechanism to update the index with the |
| 547 | result of auto-conflict resolution if possible. |
| 548 | </p> |
| 549 | </dd> |
| 550 | <dt> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 551 | <commit>… |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 552 | </dt> |
| 553 | <dd> |
| 554 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 555 | Commits, usually other branch heads, to merge into our branch. |
| 556 | You need at least one <commit>. Specifying more than one |
| 557 | <commit> obviously means you are trying an Octopus. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 558 | </p> |
| 559 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 560 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 561 | </div> |
Junio C Hamano | d0d892c | 2010-01-24 20:06:29 | [diff] [blame] | 562 | <h2 id="_pre_merge_checks">PRE-MERGE CHECKS</h2> |
| 563 | <div class="sectionbody"> |
| 564 | <div class="para"><p>Before applying outside changes, you should get your own work in |
| 565 | good shape and committed locally, so it will not be clobbered if |
| 566 | there are conflicts. See also <a href="git-stash.html">git-stash(1)</a>. |
| 567 | <em>git pull</em> and <em>git merge</em> will stop without doing anything when |
| 568 | local uncommitted changes overlap with files that <em>git pull</em>/<em>git |
| 569 | merge</em> may need to update.</p></div> |
| 570 | <div class="para"><p>To avoid recording unrelated changes in the merge commit, |
| 571 | <em>git pull</em> and <em>git merge</em> will also abort if there are any changes |
| 572 | registered in the index relative to the <tt>HEAD</tt> commit. (One |
| 573 | exception is when the changed index entries are in the state that |
| 574 | would result from the merge already.)</p></div> |
| 575 | <div class="para"><p>If all named commits are already ancestors of <tt>HEAD</tt>, <em>git merge</em> |
| 576 | will exit early with the message "Already up-to-date."</p></div> |
| 577 | </div> |
| 578 | <h2 id="_fast_forward_merge">FAST-FORWARD MERGE</h2> |
| 579 | <div class="sectionbody"> |
| 580 | <div class="para"><p>Often the current branch head is an ancestor of the named commit. |
| 581 | This is the most common case especially when invoked from <em>git |
| 582 | pull</em>: you are tracking an upstream repository, you have committed |
| 583 | no local changes, and now you want to update to a newer upstream |
| 584 | revision. In this case, a new commit is not needed to store the |
| 585 | combined history; instead, the <tt>HEAD</tt> (along with the index) is |
| 586 | updated to point at the named commit, without creating an extra |
| 587 | merge commit.</p></div> |
| 588 | <div class="para"><p>This behavior can be suppressed with the <tt>--no-ff</tt> option.</p></div> |
| 589 | </div> |
| 590 | <h2 id="_true_merge">TRUE MERGE</h2> |
| 591 | <div class="sectionbody"> |
| 592 | <div class="para"><p>Except in a fast-forward merge (see above), the branches to be |
| 593 | merged must be tied together by a merge commit that has both of them |
| 594 | as its parents.</p></div> |
| 595 | <div class="para"><p>A merged version reconciling the changes from all branches to be |
| 596 | merged is committed, and your <tt>HEAD</tt>, index, and working tree are |
| 597 | updated to it. It is possible to have modifications in the working |
| 598 | tree as long as they do not overlap; the update will preserve them.</p></div> |
| 599 | <div class="para"><p>When it is not obvious how to reconcile the changes, the following |
| 600 | happens:</p></div> |
| 601 | <div class="olist"><ol> |
| 602 | <li> |
| 603 | <p> |
| 604 | The <tt>HEAD</tt> pointer stays the same. |
| 605 | </p> |
| 606 | </li> |
| 607 | <li> |
| 608 | <p> |
| 609 | The <tt>MERGE_HEAD</tt> ref is set to point to the other branch head. |
| 610 | </p> |
| 611 | </li> |
| 612 | <li> |
| 613 | <p> |
| 614 | Paths that merged cleanly are updated both in the index file and |
| 615 | in your working tree. |
| 616 | </p> |
| 617 | </li> |
| 618 | <li> |
| 619 | <p> |
| 620 | For conflicting paths, the index file records up to three |
| 621 | versions: stage 1 stores the version from the common ancestor, |
| 622 | stage 2 from <tt>HEAD</tt>, and stage 3 from <tt>MERGE_HEAD</tt> (you |
| 623 | can inspect the stages with <tt>git ls-files -u</tt>). The working |
| 624 | tree files contain the result of the "merge" program; i.e. 3-way |
| 625 | merge results with familiar conflict markers <tt><<<</tt> <tt>===</tt> <tt>>>></tt>. |
| 626 | </p> |
| 627 | </li> |
| 628 | <li> |
| 629 | <p> |
| 630 | No other changes are made. In particular, the local |
| 631 | modifications you had before you started merge will stay the |
| 632 | same and the index entries for them stay as they were, |
| 633 | i.e. matching <tt>HEAD</tt>. |
| 634 | </p> |
| 635 | </li> |
| 636 | </ol></div> |
| 637 | <div class="para"><p>If you tried a merge which resulted in complex conflicts and |
| 638 | want to start over, you can recover with <tt>git reset --merge</tt>.</p></div> |
| 639 | </div> |
| 640 | <h2 id="_how_conflicts_are_presented">HOW CONFLICTS ARE PRESENTED</h2> |
| 641 | <div class="sectionbody"> |
| 642 | <div class="para"><p>During a merge, the working tree files are updated to reflect the result |
| 643 | of the merge. Among the changes made to the common ancestor's version, |
| 644 | non-overlapping ones (that is, you changed an area of the file while the |
| 645 | other side left that area intact, or vice versa) are incorporated in the |
| 646 | final result verbatim. When both sides made changes to the same area, |
| 647 | however, git cannot randomly pick one side over the other, and asks you to |
| 648 | resolve it by leaving what both sides did to that area.</p></div> |
| 649 | <div class="para"><p>By default, git uses the same style as that is used by "merge" program |
| 650 | from the RCS suite to present such a conflicted hunk, like this:</p></div> |
| 651 | <div class="listingblock"> |
| 652 | <div class="content"> |
| 653 | <pre><tt>Here are lines that are either unchanged from the common |
| 654 | ancestor, or cleanly resolved because only one side changed. |
| 655 | <<<<<<< yours:sample.txt |
| 656 | Conflict resolution is hard; |
| 657 | let's go shopping. |
| 658 | ======= |
| 659 | Git makes conflict resolution easy. |
| 660 | >>>>>>> theirs:sample.txt |
| 661 | And here is another line that is cleanly resolved or unmodified.</tt></pre> |
| 662 | </div></div> |
| 663 | <div class="para"><p>The area where a pair of conflicting changes happened is marked with markers |
| 664 | <tt><<<<<<<</tt>, <tt>=======</tt>, and <tt>>>>>>>></tt>. The part before the <tt>=======</tt> |
| 665 | is typically your side, and the part afterwards is typically their side.</p></div> |
| 666 | <div class="para"><p>The default format does not show what the original said in the conflicting |
| 667 | area. You cannot tell how many lines are deleted and replaced with |
| 668 | Barbie's remark on your side. The only thing you can tell is that your |
| 669 | side wants to say it is hard and you'd prefer to go shopping, while the |
| 670 | other side wants to claim it is easy.</p></div> |
| 671 | <div class="para"><p>An alternative style can be used by setting the "merge.conflictstyle" |
| 672 | configuration variable to "diff3". In "diff3" style, the above conflict |
| 673 | may look like this:</p></div> |
| 674 | <div class="listingblock"> |
| 675 | <div class="content"> |
| 676 | <pre><tt>Here are lines that are either unchanged from the common |
| 677 | ancestor, or cleanly resolved because only one side changed. |
| 678 | <<<<<<< yours:sample.txt |
| 679 | Conflict resolution is hard; |
| 680 | let's go shopping. |
| 681 | ||||||| |
| 682 | Conflict resolution is hard. |
| 683 | ======= |
| 684 | Git makes conflict resolution easy. |
| 685 | >>>>>>> theirs:sample.txt |
| 686 | And here is another line that is cleanly resolved or unmodified.</tt></pre> |
| 687 | </div></div> |
| 688 | <div class="para"><p>In addition to the <tt><<<<<<<</tt>, <tt>=======</tt>, and <tt>>>>>>>></tt> markers, it uses |
| 689 | another <tt>|||||||</tt> marker that is followed by the original text. You can |
| 690 | tell that the original just stated a fact, and your side simply gave in to |
| 691 | that statement and gave up, while the other side tried to have a more |
| 692 | positive attitude. You can sometimes come up with a better resolution by |
| 693 | viewing the original.</p></div> |
| 694 | </div> |
| 695 | <h2 id="_how_to_resolve_conflicts">HOW TO RESOLVE CONFLICTS</h2> |
| 696 | <div class="sectionbody"> |
| 697 | <div class="para"><p>After seeing a conflict, you can do two things:</p></div> |
| 698 | <div class="ilist"><ul> |
| 699 | <li> |
| 700 | <p> |
| 701 | Decide not to merge. The only clean-ups you need are to reset |
| 702 | the index file to the <tt>HEAD</tt> commit to reverse 2. and to clean |
| 703 | up working tree changes made by 2. and 3.; <tt>git-reset --hard</tt> can |
| 704 | be used for this. |
| 705 | </p> |
| 706 | </li> |
| 707 | <li> |
| 708 | <p> |
| 709 | Resolve the conflicts. Git will mark the conflicts in |
| 710 | the working tree. Edit the files into shape and |
| 711 | <em>git add</em> them to the index. Use <em>git commit</em> to seal the deal. |
| 712 | </p> |
| 713 | </li> |
| 714 | </ul></div> |
| 715 | <div class="para"><p>You can work through the conflict with a number of tools:</p></div> |
| 716 | <div class="ilist"><ul> |
| 717 | <li> |
| 718 | <p> |
| 719 | Use a mergetool. <tt>git mergetool</tt> to launch a graphical |
| 720 | mergetool which will work you through the merge. |
| 721 | </p> |
| 722 | </li> |
| 723 | <li> |
| 724 | <p> |
| 725 | Look at the diffs. <tt>git diff</tt> will show a three-way diff, |
| 726 | highlighting changes from both the <tt>HEAD</tt> and <tt>MERGE_HEAD</tt> |
| 727 | versions. |
| 728 | </p> |
| 729 | </li> |
| 730 | <li> |
| 731 | <p> |
| 732 | Look at the diffs from each branch. <tt>git log --merge -p <path></tt> |
| 733 | will show diffs first for the <tt>HEAD</tt> version and then the |
| 734 | <tt>MERGE_HEAD</tt> version. |
| 735 | </p> |
| 736 | </li> |
| 737 | <li> |
| 738 | <p> |
| 739 | Look at the originals. <tt>git show :1:filename</tt> shows the |
| 740 | common ancestor, <tt>git show :2:filename</tt> shows the <tt>HEAD</tt> |
| 741 | version, and <tt>git show :3:filename</tt> shows the <tt>MERGE_HEAD</tt> |
| 742 | version. |
| 743 | </p> |
| 744 | </li> |
| 745 | </ul></div> |
| 746 | </div> |
| 747 | <h2 id="_examples">EXAMPLES</h2> |
| 748 | <div class="sectionbody"> |
| 749 | <div class="ilist"><ul> |
| 750 | <li> |
| 751 | <p> |
| 752 | Merge branches <tt>fixes</tt> and <tt>enhancements</tt> on top of |
| 753 | the current branch, making an octopus merge: |
| 754 | </p> |
| 755 | <div class="listingblock"> |
| 756 | <div class="content"> |
| 757 | <pre><tt>$ git merge fixes enhancements</tt></pre> |
| 758 | </div></div> |
| 759 | </li> |
| 760 | <li> |
| 761 | <p> |
| 762 | Merge branch <tt>obsolete</tt> into the current branch, using <tt>ours</tt> |
| 763 | merge strategy: |
| 764 | </p> |
| 765 | <div class="listingblock"> |
| 766 | <div class="content"> |
| 767 | <pre><tt>$ git merge -s ours obsolete</tt></pre> |
| 768 | </div></div> |
| 769 | </li> |
| 770 | <li> |
| 771 | <p> |
| 772 | Merge branch <tt>maint</tt> into the current branch, but do not make |
| 773 | a new commit automatically: |
| 774 | </p> |
| 775 | <div class="listingblock"> |
| 776 | <div class="content"> |
| 777 | <pre><tt>$ git merge --no-commit maint</tt></pre> |
| 778 | </div></div> |
| 779 | <div class="para"><p>This can be used when you want to include further changes to the |
| 780 | merge, or want to write your own merge commit message.</p></div> |
| 781 | <div class="para"><p>You should refrain from abusing this option to sneak substantial |
| 782 | changes into a merge commit. Small fixups like bumping |
| 783 | release/version name would be acceptable.</p></div> |
| 784 | </li> |
| 785 | </ul></div> |
| 786 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 787 | <h2 id="_merge_strategies">MERGE STRATEGIES</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 788 | <div class="sectionbody"> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 789 | <div class="para"><p>The merge mechanism (<em>git-merge</em> and <em>git-pull</em> commands) allows the |
| 790 | backend <em>merge strategies</em> to be chosen with <tt>-s</tt> option. Some strategies |
| 791 | can also take their own options, which can be passed by giving <tt>-X<option></tt> |
| 792 | arguments to <em>git-merge</em> and/or <em>git-pull</em>.</p></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 793 | <div class="vlist"><dl> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 794 | <dt> |
| 795 | resolve |
| 796 | </dt> |
| 797 | <dd> |
| 798 | <p> |
| 799 | This can only resolve two heads (i.e. the current branch |
Junio C Hamano | 1de7572 | 2009-03-26 08:39:38 | [diff] [blame] | 800 | and another branch you pulled from) using a 3-way merge |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 801 | algorithm. It tries to carefully detect criss-cross |
| 802 | merge ambiguities and is considered generally safe and |
| 803 | fast. |
| 804 | </p> |
| 805 | </dd> |
| 806 | <dt> |
| 807 | recursive |
| 808 | </dt> |
| 809 | <dd> |
| 810 | <p> |
Junio C Hamano | 1de7572 | 2009-03-26 08:39:38 | [diff] [blame] | 811 | This can only resolve two heads using a 3-way merge |
| 812 | algorithm. When there is more than one common |
| 813 | ancestor that can be used for 3-way merge, it creates a |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 814 | merged tree of the common ancestors and uses that as |
| 815 | the reference tree for the 3-way merge. This has been |
| 816 | reported to result in fewer merge conflicts without |
| 817 | causing mis-merges by tests done on actual merge commits |
| 818 | taken from Linux 2.6 kernel development history. |
| 819 | Additionally this can detect and handle merges involving |
| 820 | renames. This is the default merge strategy when |
| 821 | pulling or merging one branch. |
| 822 | </p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 823 | <div class="para"><p>The <em>recursive</em> strategy can take the following options:</p></div> |
| 824 | <div class="vlist"><dl> |
| 825 | <dt> |
| 826 | ours |
| 827 | </dt> |
| 828 | <dd> |
| 829 | <p> |
| 830 | This option forces conflicting hunks to be auto-resolved cleanly by |
| 831 | favoring <em>our</em> version. Changes from the other tree that do not |
| 832 | conflict with our side are reflected to the merge result. |
| 833 | </p> |
| 834 | <div class="para"><p>This should not be confused with the <em>ours</em> merge strategy, which does not |
| 835 | even look at what the other tree contains at all. It discards everything |
| 836 | the other tree did, declaring <em>our</em> history contains all that happened in it.</p></div> |
| 837 | </dd> |
| 838 | <dt> |
| 839 | theirs |
| 840 | </dt> |
| 841 | <dd> |
| 842 | <p> |
| 843 | This is opposite of <em>ours</em>. |
| 844 | </p> |
| 845 | </dd> |
| 846 | <dt> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame^] | 847 | patience |
| 848 | </dt> |
| 849 | <dd> |
| 850 | <p> |
| 851 | With this option, <em>merge-recursive</em> spends a little extra time |
| 852 | to avoid mismerges that sometimes occur due to unimportant |
| 853 | matching lines (e.g., braces from distinct functions). Use |
| 854 | this when the branches to be merged have diverged wildly. |
| 855 | See also <a href="git-diff.html">git-diff(1)</a> <tt>--patience</tt>. |
| 856 | </p> |
| 857 | </dd> |
| 858 | <dt> |
| 859 | ignore-space-change |
| 860 | </dt> |
| 861 | <dt> |
| 862 | ignore-all-space |
| 863 | </dt> |
| 864 | <dt> |
| 865 | ignore-space-at-eol |
| 866 | </dt> |
| 867 | <dd> |
| 868 | <p> |
| 869 | Treats lines with the indicated type of whitespace change as |
| 870 | unchanged for the sake of a three-way merge. Whitespace |
| 871 | changes mixed with other changes to a line are not ignored. |
| 872 | See also <a href="git-diff.html">git-diff(1)</a> <tt>-b</tt>, <tt>-w</tt>, and |
| 873 | <tt>--ignore-space-at-eol</tt>. |
| 874 | </p> |
| 875 | <div class="ilist"><ul> |
| 876 | <li> |
| 877 | <p> |
| 878 | If <em>their</em> version only introduces whitespace changes to a line, |
| 879 | <em>our</em> version is used; |
| 880 | </p> |
| 881 | </li> |
| 882 | <li> |
| 883 | <p> |
| 884 | If <em>our</em> version introduces whitespace changes but <em>their</em> |
| 885 | version includes a substantial change, <em>their</em> version is used; |
| 886 | </p> |
| 887 | </li> |
| 888 | <li> |
| 889 | <p> |
| 890 | Otherwise, the merge proceeds in the usual way. |
| 891 | </p> |
| 892 | </li> |
| 893 | </ul></div> |
| 894 | </dd> |
| 895 | <dt> |
Junio C Hamano | 2db3e75 | 2010-09-03 21:33:06 | [diff] [blame] | 896 | renormalize |
| 897 | </dt> |
| 898 | <dd> |
| 899 | <p> |
| 900 | This runs a virtual check-out and check-in of all three stages |
| 901 | of a file when resolving a three-way merge. This option is |
| 902 | meant to be used when merging branches with different clean |
| 903 | filters or end-of-line normalization rules. See "Merging |
| 904 | branches with differing checkin/checkout attributes" in |
| 905 | <a href="gitattributes.html">gitattributes(5)</a> for details. |
| 906 | </p> |
| 907 | </dd> |
| 908 | <dt> |
| 909 | no-renormalize |
| 910 | </dt> |
| 911 | <dd> |
| 912 | <p> |
| 913 | Disables the <tt>renormalize</tt> option. This overrides the |
| 914 | <tt>merge.renormalize</tt> configuration variable. |
| 915 | </p> |
| 916 | </dd> |
| 917 | <dt> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame^] | 918 | rename-threshold=<n> |
| 919 | </dt> |
| 920 | <dd> |
| 921 | <p> |
| 922 | Controls the similarity threshold used for rename detection. |
| 923 | See also <a href="git-diff.html">git-diff(1)</a> <tt>-M</tt>. |
| 924 | </p> |
| 925 | </dd> |
| 926 | <dt> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 927 | subtree[=<path>] |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 928 | </dt> |
| 929 | <dd> |
| 930 | <p> |
| 931 | This option is a more advanced form of <em>subtree</em> strategy, where |
| 932 | the strategy makes a guess on how two trees must be shifted to |
| 933 | match with each other when merging. Instead, the specified path |
| 934 | is prefixed (or stripped from the beginning) to make the shape of |
| 935 | two trees to match. |
| 936 | </p> |
| 937 | </dd> |
| 938 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 939 | </dd> |
| 940 | <dt> |
| 941 | octopus |
| 942 | </dt> |
| 943 | <dd> |
| 944 | <p> |
Junio C Hamano | 1de7572 | 2009-03-26 08:39:38 | [diff] [blame] | 945 | This resolves cases with more than two heads, but refuses to do |
| 946 | a complex merge that needs manual resolution. It is |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 947 | primarily meant to be used for bundling topic branch |
| 948 | heads together. This is the default merge strategy when |
Junio C Hamano | 1de7572 | 2009-03-26 08:39:38 | [diff] [blame] | 949 | pulling or merging more than one branch. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 950 | </p> |
| 951 | </dd> |
| 952 | <dt> |
| 953 | ours |
| 954 | </dt> |
| 955 | <dd> |
| 956 | <p> |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 957 | This resolves any number of heads, but the resulting tree of the |
| 958 | merge is always that of the current branch head, effectively |
| 959 | ignoring all changes from all other branches. It is meant to |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 960 | be used to supersede old development history of side |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 961 | branches. Note that this is different from the -Xours option to |
| 962 | the <em>recursive</em> merge strategy. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 963 | </p> |
| 964 | </dd> |
Junio C Hamano | e6c9203 | 2008-03-19 09:24:34 | [diff] [blame] | 965 | <dt> |
| 966 | subtree |
| 967 | </dt> |
| 968 | <dd> |
| 969 | <p> |
| 970 | This is a modified recursive strategy. When merging trees A and |
| 971 | B, if B corresponds to a subtree of A, B is first adjusted to |
| 972 | match the tree structure of A, instead of reading the trees at |
| 973 | the same level. This adjustment is also done to the common |
| 974 | ancestor tree. |
| 975 | </p> |
| 976 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 977 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 978 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 979 | <h2 id="_configuration">CONFIGURATION</h2> |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 980 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 981 | <div class="vlist"><dl> |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 982 | <dt> |
Junio C Hamano | 4653c6f | 2008-11-26 22:50:20 | [diff] [blame] | 983 | merge.conflictstyle |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 984 | </dt> |
| 985 | <dd> |
| 986 | <p> |
Junio C Hamano | 4653c6f | 2008-11-26 22:50:20 | [diff] [blame] | 987 | Specify the style in which conflicted hunks are written out to |
| 988 | working tree files upon merge. The default is "merge", which |
Junio C Hamano | ec87f52 | 2008-12-10 08:35:25 | [diff] [blame] | 989 | shows a <tt><<<<<<<</tt> conflict marker, changes made by one side, |
| 990 | a <tt>=======</tt> marker, changes made by the other side, and then |
| 991 | a <tt>>>>>>>></tt> marker. An alternate style, "diff3", adds a <tt>|||||||</tt> |
| 992 | marker and the original text before the <tt>=======</tt> marker. |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 993 | </p> |
| 994 | </dd> |
| 995 | <dt> |
| 996 | merge.log |
| 997 | </dt> |
| 998 | <dd> |
| 999 | <p> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1000 | In addition to branch names, populate the log message with at |
| 1001 | most the specified number of one-line descriptions from the |
| 1002 | actual commits that are being merged. Defaults to false, and |
| 1003 | true is a synoym for 20. |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1004 | </p> |
| 1005 | </dd> |
| 1006 | <dt> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 1007 | merge.renameLimit |
| 1008 | </dt> |
| 1009 | <dd> |
| 1010 | <p> |
| 1011 | The number of files to consider when performing rename detection |
| 1012 | during a merge; if not specified, defaults to the value of |
| 1013 | diff.renameLimit. |
| 1014 | </p> |
| 1015 | </dd> |
| 1016 | <dt> |
Junio C Hamano | 2db3e75 | 2010-09-03 21:33:06 | [diff] [blame] | 1017 | merge.renormalize |
| 1018 | </dt> |
| 1019 | <dd> |
| 1020 | <p> |
| 1021 | Tell git that canonical representation of files in the |
| 1022 | repository has changed over time (e.g. earlier commits record |
| 1023 | text files with CRLF line endings, but recent ones use LF line |
| 1024 | endings). In such a repository, git can convert the data |
| 1025 | recorded in commits to a canonical form before performing a |
| 1026 | merge to reduce unnecessary conflicts. For more information, |
| 1027 | see section "Merging branches with differing checkin/checkout |
| 1028 | attributes" in <a href="gitattributes.html">gitattributes(5)</a>. |
| 1029 | </p> |
| 1030 | </dd> |
| 1031 | <dt> |
Junio C Hamano | 4653c6f | 2008-11-26 22:50:20 | [diff] [blame] | 1032 | merge.stat |
| 1033 | </dt> |
| 1034 | <dd> |
| 1035 | <p> |
| 1036 | Whether to print the diffstat between ORIG_HEAD and the merge result |
| 1037 | at the end of the merge. True by default. |
| 1038 | </p> |
| 1039 | </dd> |
| 1040 | <dt> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1041 | merge.tool |
| 1042 | </dt> |
| 1043 | <dd> |
| 1044 | <p> |
| 1045 | Controls which merge resolution program is used by |
| 1046 | <a href="git-mergetool.html">git-mergetool(1)</a>. Valid built-in values are: "kdiff3", |
Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 1047 | "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", |
Junio C Hamano | 3f680f3 | 2009-11-16 02:10:54 | [diff] [blame] | 1048 | "diffuse", "ecmerge", "tortoisemerge", "p4merge", "araxis" and |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1049 | "opendiff". Any other value is treated is custom merge tool |
Junio C Hamano | cb1c44f | 2008-08-06 06:19:33 | [diff] [blame] | 1050 | and there must be a corresponding mergetool.<tool>.cmd option. |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1051 | </p> |
| 1052 | </dd> |
| 1053 | <dt> |
| 1054 | merge.verbosity |
| 1055 | </dt> |
| 1056 | <dd> |
| 1057 | <p> |
| 1058 | Controls the amount of output shown by the recursive merge |
| 1059 | strategy. Level 0 outputs nothing except a final error |
| 1060 | message if conflicts were detected. Level 1 outputs only |
| 1061 | conflicts, 2 outputs conflicts and file changes. Level 5 and |
| 1062 | above outputs debugging information. The default is level 2. |
Junio C Hamano | ec87f52 | 2008-12-10 08:35:25 | [diff] [blame] | 1063 | Can be overridden by the <em>GIT_MERGE_VERBOSITY</em> environment variable. |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1064 | </p> |
| 1065 | </dd> |
Junio C Hamano | 1b50ce9 | 2007-10-03 12:05:53 | [diff] [blame] | 1066 | <dt> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1067 | merge.<driver>.name |
| 1068 | </dt> |
| 1069 | <dd> |
| 1070 | <p> |
Junio C Hamano | ec87f52 | 2008-12-10 08:35:25 | [diff] [blame] | 1071 | Defines a human-readable name for a custom low-level |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1072 | merge driver. See <a href="gitattributes.html">gitattributes(5)</a> for details. |
| 1073 | </p> |
| 1074 | </dd> |
| 1075 | <dt> |
| 1076 | merge.<driver>.driver |
| 1077 | </dt> |
| 1078 | <dd> |
| 1079 | <p> |
| 1080 | Defines the command that implements a custom low-level |
| 1081 | merge driver. See <a href="gitattributes.html">gitattributes(5)</a> for details. |
| 1082 | </p> |
| 1083 | </dd> |
| 1084 | <dt> |
| 1085 | merge.<driver>.recursive |
| 1086 | </dt> |
| 1087 | <dd> |
| 1088 | <p> |
| 1089 | Names a low-level merge driver to be used when |
| 1090 | performing an internal merge between common ancestors. |
| 1091 | See <a href="gitattributes.html">gitattributes(5)</a> for details. |
| 1092 | </p> |
| 1093 | </dd> |
| 1094 | <dt> |
Junio C Hamano | 1b50ce9 | 2007-10-03 12:05:53 | [diff] [blame] | 1095 | branch.<name>.mergeoptions |
| 1096 | </dt> |
| 1097 | <dd> |
| 1098 | <p> |
| 1099 | Sets default options for merging into branch <name>. The syntax and |
Junio C Hamano | c0e55e7 | 2009-10-10 00:56:29 | [diff] [blame] | 1100 | supported options are the same as those of <em>git merge</em>, but option |
| 1101 | values containing whitespace characters are currently not supported. |
Junio C Hamano | 1b50ce9 | 2007-10-03 12:05:53 | [diff] [blame] | 1102 | </p> |
| 1103 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1104 | </dl></div> |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1105 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1106 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1107 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1108 | <div class="para"><p><a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>, <a href="git-pull.html">git-pull(1)</a>, |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1109 | <a href="gitattributes.html">gitattributes(5)</a>, |
| 1110 | <a href="git-reset.html">git-reset(1)</a>, |
| 1111 | <a href="git-diff.html">git-diff(1)</a>, <a href="git-ls-files.html">git-ls-files(1)</a>, |
| 1112 | <a href="git-add.html">git-add(1)</a>, <a href="git-rm.html">git-rm(1)</a>, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1113 | <a href="git-mergetool.html">git-mergetool(1)</a></p></div> |
Junio C Hamano | fa2ad88 | 2009-12-03 09:15:44 | [diff] [blame] | 1114 | </div> |
| 1115 | <h2 id="_author">Author</h2> |
| 1116 | <div class="sectionbody"> |
| 1117 | <div class="para"><p>Written by Junio C Hamano <gitster@pobox.com></p></div> |
| 1118 | </div> |
| 1119 | <h2 id="_documentation">Documentation</h2> |
| 1120 | <div class="sectionbody"> |
| 1121 | <div class="para"><p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p></div> |
| 1122 | </div> |
| 1123 | <h2 id="_git">GIT</h2> |
| 1124 | <div class="sectionbody"> |
| 1125 | <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
| 1126 | </div> |
| 1127 | <div id="footer"> |
| 1128 | <div id="footer-text"> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame^] | 1129 | Last updated 2010-10-27 06:08:20 UTC |
Junio C Hamano | fa2ad88 | 2009-12-03 09:15:44 | [diff] [blame] | 1130 | </div> |
| 1131 | </div> |
| 1132 | </body> |
| 1133 | </html> |