Autogenerated HTML docs for v1.7.6-472-g4bfe7
[git/jnareb-git.git] / git-rebase.html
blob8f9b10afc8289c536798a959985a988f215eb945
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" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-rebase(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-rebase(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-rebase -
411 Forward-port local commits to the updated upstream head
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git rebase</em> [-i | --interactive] [options] [--onto &lt;newbase&gt;]
419 [&lt;upstream&gt;] [&lt;branch&gt;]
420 <em>git rebase</em> [-i | --interactive] [options] --onto &lt;newbase&gt;
421 --root [&lt;branch&gt;]
422 <em>git rebase</em> --continue | --skip | --abort</div>
423 <div class="verseblock-attribution">
424 </div></div>
425 </div>
426 <h2 id="_description">DESCRIPTION</h2>
427 <div class="sectionbody">
428 <div class="paragraph"><p>If &lt;branch&gt; is specified, <em>git rebase</em> will perform an automatic
429 <tt>git checkout &lt;branch&gt;</tt> before doing anything else. Otherwise
430 it remains on the current branch.</p></div>
431 <div class="paragraph"><p>If &lt;upstream&gt; is not specified, the upstream configured in
432 branch.&lt;name&gt;.remote and branch.&lt;name&gt;.merge options will be used; see
433 <a href="git-config.html">git-config(1)</a> for details. If you are currently not on any
434 branch or if the current branch does not have a configured upstream,
435 the rebase will abort.</p></div>
436 <div class="paragraph"><p>All changes made by commits in the current branch but that are not
437 in &lt;upstream&gt; are saved to a temporary area. This is the same set
438 of commits that would be shown by <tt>git log &lt;upstream&gt;..HEAD</tt> (or
439 <tt>git log HEAD</tt>, if --root is specified).</p></div>
440 <div class="paragraph"><p>The current branch is reset to &lt;upstream&gt;, or &lt;newbase&gt; if the
441 --onto option was supplied. This has the exact same effect as
442 <tt>git reset --hard &lt;upstream&gt;</tt> (or &lt;newbase&gt;). ORIG_HEAD is set
443 to point at the tip of the branch before the reset.</p></div>
444 <div class="paragraph"><p>The commits that were previously saved into the temporary area are
445 then reapplied to the current branch, one by one, in order. Note that
446 any commits in HEAD which introduce the same textual changes as a commit
447 in HEAD..&lt;upstream&gt; are omitted (i.e., a patch already accepted upstream
448 with a different commit message or timestamp will be skipped).</p></div>
449 <div class="paragraph"><p>It is possible that a merge failure will prevent this process from being
450 completely automatic. You will have to resolve any such merge failure
451 and run <tt>git rebase --continue</tt>. Another option is to bypass the commit
452 that caused the merge failure with <tt>git rebase --skip</tt>. To check out the
453 original &lt;branch&gt; and remove the .git/rebase-apply working files, use the
454 command <tt>git rebase --abort</tt> instead.</p></div>
455 <div class="paragraph"><p>Assume the following history exists and the current branch is "topic":</p></div>
456 <div class="listingblock">
457 <div class="content">
458 <pre><tt> A---B---C topic
460 D---E---F---G master</tt></pre>
461 </div></div>
462 <div class="paragraph"><p>From this point, the result of either of the following commands:</p></div>
463 <div class="literalblock">
464 <div class="content">
465 <pre><tt>git rebase master
466 git rebase master topic</tt></pre>
467 </div></div>
468 <div class="paragraph"><p>would be:</p></div>
469 <div class="listingblock">
470 <div class="content">
471 <pre><tt> A'--B'--C' topic
473 D---E---F---G master</tt></pre>
474 </div></div>
475 <div class="paragraph"><p><strong>NOTE:</strong> The latter form is just a short-hand of <tt>git checkout topic</tt>
476 followed by <tt>git rebase master</tt>. When rebase exits <tt>topic</tt> will
477 remain the checked-out branch.</p></div>
478 <div class="paragraph"><p>If the upstream branch already contains a change you have made (e.g.,
479 because you mailed a patch which was applied upstream), then that commit
480 will be skipped. For example, running &#8216;git rebase master` on the
481 following history (in which A&#8217; and A introduce the same set of changes,
482 but have different committer information):</p></div>
483 <div class="listingblock">
484 <div class="content">
485 <pre><tt> A---B---C topic
487 D---E---A'---F master</tt></pre>
488 </div></div>
489 <div class="paragraph"><p>will result in:</p></div>
490 <div class="listingblock">
491 <div class="content">
492 <pre><tt> B'---C' topic
494 D---E---A'---F master</tt></pre>
495 </div></div>
496 <div class="paragraph"><p>Here is how you would transplant a topic branch based on one
497 branch to another, to pretend that you forked the topic branch
498 from the latter branch, using <tt>rebase --onto</tt>.</p></div>
499 <div class="paragraph"><p>First let&#8217;s assume your <em>topic</em> is based on branch <em>next</em>.
500 For example, a feature developed in <em>topic</em> depends on some
501 functionality which is found in <em>next</em>.</p></div>
502 <div class="listingblock">
503 <div class="content">
504 <pre><tt> o---o---o---o---o master
506 o---o---o---o---o next
508 o---o---o topic</tt></pre>
509 </div></div>
510 <div class="paragraph"><p>We want to make <em>topic</em> forked from branch <em>master</em>; for example,
511 because the functionality on which <em>topic</em> depends was merged into the
512 more stable <em>master</em> branch. We want our tree to look like this:</p></div>
513 <div class="listingblock">
514 <div class="content">
515 <pre><tt> o---o---o---o---o master
517 | o'--o'--o' topic
519 o---o---o---o---o next</tt></pre>
520 </div></div>
521 <div class="paragraph"><p>We can get this using the following command:</p></div>
522 <div class="literalblock">
523 <div class="content">
524 <pre><tt>git rebase --onto master next topic</tt></pre>
525 </div></div>
526 <div class="paragraph"><p>Another example of --onto option is to rebase part of a
527 branch. If we have the following situation:</p></div>
528 <div class="listingblock">
529 <div class="content">
530 <pre><tt> H---I---J topicB
532 E---F---G topicA
534 A---B---C---D master</tt></pre>
535 </div></div>
536 <div class="paragraph"><p>then the command</p></div>
537 <div class="literalblock">
538 <div class="content">
539 <pre><tt>git rebase --onto master topicA topicB</tt></pre>
540 </div></div>
541 <div class="paragraph"><p>would result in:</p></div>
542 <div class="listingblock">
543 <div class="content">
544 <pre><tt> H'--I'--J' topicB
546 | E---F---G topicA
548 A---B---C---D master</tt></pre>
549 </div></div>
550 <div class="paragraph"><p>This is useful when topicB does not depend on topicA.</p></div>
551 <div class="paragraph"><p>A range of commits could also be removed with rebase. If we have
552 the following situation:</p></div>
553 <div class="listingblock">
554 <div class="content">
555 <pre><tt> E---F---G---H---I---J topicA</tt></pre>
556 </div></div>
557 <div class="paragraph"><p>then the command</p></div>
558 <div class="literalblock">
559 <div class="content">
560 <pre><tt>git rebase --onto topicA~5 topicA~3 topicA</tt></pre>
561 </div></div>
562 <div class="paragraph"><p>would result in the removal of commits F and G:</p></div>
563 <div class="listingblock">
564 <div class="content">
565 <pre><tt> E---H'---I'---J' topicA</tt></pre>
566 </div></div>
567 <div class="paragraph"><p>This is useful if F and G were flawed in some way, or should not be
568 part of topicA. Note that the argument to --onto and the &lt;upstream&gt;
569 parameter can be any valid commit-ish.</p></div>
570 <div class="paragraph"><p>In case of conflict, <em>git rebase</em> will stop at the first problematic commit
571 and leave conflict markers in the tree. You can use <em>git diff</em> to locate
572 the markers (&lt;&lt;&lt;&lt;&lt;&lt;) and make edits to resolve the conflict. For each
573 file you edit, you need to tell git that the conflict has been resolved,
574 typically this would be done with</p></div>
575 <div class="literalblock">
576 <div class="content">
577 <pre><tt>git add &lt;filename&gt;</tt></pre>
578 </div></div>
579 <div class="paragraph"><p>After resolving the conflict manually and updating the index with the
580 desired resolution, you can continue the rebasing process with</p></div>
581 <div class="literalblock">
582 <div class="content">
583 <pre><tt>git rebase --continue</tt></pre>
584 </div></div>
585 <div class="paragraph"><p>Alternatively, you can undo the <em>git rebase</em> with</p></div>
586 <div class="literalblock">
587 <div class="content">
588 <pre><tt>git rebase --abort</tt></pre>
589 </div></div>
590 </div>
591 <h2 id="_configuration">CONFIGURATION</h2>
592 <div class="sectionbody">
593 <div class="dlist"><dl>
594 <dt class="hdlist1">
595 rebase.stat
596 </dt>
597 <dd>
599 Whether to show a diffstat of what changed upstream since the last
600 rebase. False by default.
601 </p>
602 </dd>
603 <dt class="hdlist1">
604 rebase.autosquash
605 </dt>
606 <dd>
608 If set to true enable <em>--autosquash</em> option by default.
609 </p>
610 </dd>
611 </dl></div>
612 </div>
613 <h2 id="_options">OPTIONS</h2>
614 <div class="sectionbody">
615 <div class="dlist"><dl>
616 <dt class="hdlist1">
617 &lt;newbase&gt;
618 </dt>
619 <dd>
621 Starting point at which to create the new commits. If the
622 --onto option is not specified, the starting point is
623 &lt;upstream&gt;. May be any valid commit, and not just an
624 existing branch name.
625 </p>
626 <div class="paragraph"><p>As a special case, you may use "A...B" as a shortcut for the
627 merge base of A and B if there is exactly one merge base. You can
628 leave out at most one of A and B, in which case it defaults to HEAD.</p></div>
629 </dd>
630 <dt class="hdlist1">
631 &lt;upstream&gt;
632 </dt>
633 <dd>
635 Upstream branch to compare against. May be any valid commit,
636 not just an existing branch name. Defaults to the configured
637 upstream for the current branch.
638 </p>
639 </dd>
640 <dt class="hdlist1">
641 &lt;branch&gt;
642 </dt>
643 <dd>
645 Working branch; defaults to HEAD.
646 </p>
647 </dd>
648 <dt class="hdlist1">
649 --continue
650 </dt>
651 <dd>
653 Restart the rebasing process after having resolved a merge conflict.
654 </p>
655 </dd>
656 <dt class="hdlist1">
657 --abort
658 </dt>
659 <dd>
661 Abort the rebase operation and reset HEAD to the original
662 branch. If &lt;branch&gt; was provided when the rebase operation was
663 started, then HEAD will be reset to &lt;branch&gt;. Otherwise HEAD
664 will be reset to where it was when the rebase operation was
665 started.
666 </p>
667 </dd>
668 <dt class="hdlist1">
669 --skip
670 </dt>
671 <dd>
673 Restart the rebasing process by skipping the current patch.
674 </p>
675 </dd>
676 <dt class="hdlist1">
678 </dt>
679 <dt class="hdlist1">
680 --merge
681 </dt>
682 <dd>
684 Use merging strategies to rebase. When the recursive (default) merge
685 strategy is used, this allows rebase to be aware of renames on the
686 upstream side.
687 </p>
688 <div class="paragraph"><p>Note that a rebase merge works by replaying each commit from the working
689 branch on top of the &lt;upstream&gt; branch. Because of this, when a merge
690 conflict happens, the side reported as <em>ours</em> is the so-far rebased
691 series, starting with &lt;upstream&gt;, and <em>theirs</em> is the working branch. In
692 other words, the sides are swapped.</p></div>
693 </dd>
694 <dt class="hdlist1">
695 -s &lt;strategy&gt;
696 </dt>
697 <dt class="hdlist1">
698 --strategy=&lt;strategy&gt;
699 </dt>
700 <dd>
702 Use the given merge strategy.
703 If there is no <tt>-s</tt> option <em>git merge-recursive</em> is used
704 instead. This implies --merge.
705 </p>
706 <div class="paragraph"><p>Because <em>git rebase</em> replays each commit from the working branch
707 on top of the &lt;upstream&gt; branch using the given strategy, using
708 the <em>ours</em> strategy simply discards all patches from the &lt;branch&gt;,
709 which makes little sense.</p></div>
710 </dd>
711 <dt class="hdlist1">
712 -X &lt;strategy-option&gt;
713 </dt>
714 <dt class="hdlist1">
715 --strategy-option=&lt;strategy-option&gt;
716 </dt>
717 <dd>
719 Pass the &lt;strategy-option&gt; through to the merge strategy.
720 This implies <tt>--merge</tt> and, if no strategy has been
721 specified, <tt>-s recursive</tt>. Note the reversal of <em>ours</em> and
722 <em>theirs</em> as noted in above for the <tt>-m</tt> option.
723 </p>
724 </dd>
725 <dt class="hdlist1">
727 </dt>
728 <dt class="hdlist1">
729 --quiet
730 </dt>
731 <dd>
733 Be quiet. Implies --no-stat.
734 </p>
735 </dd>
736 <dt class="hdlist1">
738 </dt>
739 <dt class="hdlist1">
740 --verbose
741 </dt>
742 <dd>
744 Be verbose. Implies --stat.
745 </p>
746 </dd>
747 <dt class="hdlist1">
748 --stat
749 </dt>
750 <dd>
752 Show a diffstat of what changed upstream since the last rebase. The
753 diffstat is also controlled by the configuration option rebase.stat.
754 </p>
755 </dd>
756 <dt class="hdlist1">
758 </dt>
759 <dt class="hdlist1">
760 --no-stat
761 </dt>
762 <dd>
764 Do not show a diffstat as part of the rebase process.
765 </p>
766 </dd>
767 <dt class="hdlist1">
768 --no-verify
769 </dt>
770 <dd>
772 This option bypasses the pre-rebase hook. See also <a href="githooks.html">githooks(5)</a>.
773 </p>
774 </dd>
775 <dt class="hdlist1">
776 --verify
777 </dt>
778 <dd>
780 Allows the pre-rebase hook to run, which is the default. This option can
781 be used to override --no-verify. See also <a href="githooks.html">githooks(5)</a>.
782 </p>
783 </dd>
784 <dt class="hdlist1">
785 -C&lt;n&gt;
786 </dt>
787 <dd>
789 Ensure at least &lt;n&gt; lines of surrounding context match before
790 and after each change. When fewer lines of surrounding
791 context exist they all must match. By default no context is
792 ever ignored.
793 </p>
794 </dd>
795 <dt class="hdlist1">
797 </dt>
798 <dt class="hdlist1">
799 --force-rebase
800 </dt>
801 <dd>
803 Force the rebase even if the current branch is a descendant
804 of the commit you are rebasing onto. Normally non-interactive rebase will
805 exit with the message "Current branch is up to date" in such a
806 situation.
807 Incompatible with the --interactive option.
808 </p>
809 <div class="paragraph"><p>You may find this (or --no-ff with an interactive rebase) helpful after
810 reverting a topic branch merge, as this option recreates the topic branch with
811 fresh commits so it can be remerged successfully without needing to "revert
812 the reversion" (see the
813 <a href="howto/revert-a-faulty-merge.txt">revert-a-faulty-merge How-To</a> for details).</p></div>
814 </dd>
815 <dt class="hdlist1">
816 --ignore-whitespace
817 </dt>
818 <dt class="hdlist1">
819 --whitespace=&lt;option&gt;
820 </dt>
821 <dd>
823 These flag are passed to the <em>git apply</em> program
824 (see <a href="git-apply.html">git-apply(1)</a>) that applies the patch.
825 Incompatible with the --interactive option.
826 </p>
827 </dd>
828 <dt class="hdlist1">
829 --committer-date-is-author-date
830 </dt>
831 <dt class="hdlist1">
832 --ignore-date
833 </dt>
834 <dd>
836 These flags are passed to <em>git am</em> to easily change the dates
837 of the rebased commits (see <a href="git-am.html">git-am(1)</a>).
838 Incompatible with the --interactive option.
839 </p>
840 </dd>
841 <dt class="hdlist1">
843 </dt>
844 <dt class="hdlist1">
845 --interactive
846 </dt>
847 <dd>
849 Make a list of the commits which are about to be rebased. Let the
850 user edit that list before rebasing. This mode can also be used to
851 split commits (see SPLITTING COMMITS below).
852 </p>
853 </dd>
854 <dt class="hdlist1">
856 </dt>
857 <dt class="hdlist1">
858 --preserve-merges
859 </dt>
860 <dd>
862 Instead of ignoring merges, try to recreate them.
863 </p>
864 <div class="paragraph"><p>This uses the <tt>--interactive</tt> machinery internally, but combining it
865 with the <tt>--interactive</tt> option explicitly is generally not a good
866 idea unless you know what you are doing (see BUGS below).</p></div>
867 </dd>
868 <dt class="hdlist1">
869 --root
870 </dt>
871 <dd>
873 Rebase all commits reachable from &lt;branch&gt;, instead of
874 limiting them with an &lt;upstream&gt;. This allows you to rebase
875 the root commit(s) on a branch. Must be used with --onto, and
876 will skip changes already contained in &lt;newbase&gt; (instead of
877 &lt;upstream&gt;). When used together with --preserve-merges, <em>all</em>
878 root commits will be rewritten to have &lt;newbase&gt; as parent
879 instead.
880 </p>
881 </dd>
882 <dt class="hdlist1">
883 --autosquash
884 </dt>
885 <dt class="hdlist1">
886 --no-autosquash
887 </dt>
888 <dd>
890 When the commit log message begins with "squash! &#8230;" (or
891 "fixup! &#8230;"), and there is a commit whose title begins with
892 the same &#8230;, automatically modify the todo list of rebase -i
893 so that the commit marked for squashing comes right after the
894 commit to be modified, and change the action of the moved
895 commit from <tt>pick</tt> to <tt>squash</tt> (or <tt>fixup</tt>).
896 </p>
897 <div class="paragraph"><p>This option is only valid when the <em>--interactive</em> option is used.</p></div>
898 <div class="paragraph"><p>If the <em>--autosquash</em> option is enabled by default using the
899 configuration variable <tt>rebase.autosquash</tt>, this option can be
900 used to override and disable this setting.</p></div>
901 </dd>
902 <dt class="hdlist1">
903 --no-ff
904 </dt>
905 <dd>
907 With --interactive, cherry-pick all rebased commits instead of
908 fast-forwarding over the unchanged ones. This ensures that the
909 entire history of the rebased branch is composed of new commits.
910 </p>
911 <div class="paragraph"><p>Without --interactive, this is a synonym for --force-rebase.</p></div>
912 <div class="paragraph"><p>You may find this helpful after reverting a topic branch merge, as this option
913 recreates the topic branch with fresh commits so it can be remerged
914 successfully without needing to "revert the reversion" (see the
915 <a href="howto/revert-a-faulty-merge.txt">revert-a-faulty-merge How-To</a> for details).</p></div>
916 </dd>
917 </dl></div>
918 </div>
919 <h2 id="_merge_strategies">MERGE STRATEGIES</h2>
920 <div class="sectionbody">
921 <div class="paragraph"><p>The merge mechanism (<em>git-merge</em> and <em>git-pull</em> commands) allows the
922 backend <em>merge strategies</em> to be chosen with <tt>-s</tt> option. Some strategies
923 can also take their own options, which can be passed by giving <tt>-X&lt;option&gt;</tt>
924 arguments to <em>git-merge</em> and/or <em>git-pull</em>.</p></div>
925 <div class="dlist"><dl>
926 <dt class="hdlist1">
927 resolve
928 </dt>
929 <dd>
931 This can only resolve two heads (i.e. the current branch
932 and another branch you pulled from) using a 3-way merge
933 algorithm. It tries to carefully detect criss-cross
934 merge ambiguities and is considered generally safe and
935 fast.
936 </p>
937 </dd>
938 <dt class="hdlist1">
939 recursive
940 </dt>
941 <dd>
943 This can only resolve two heads using a 3-way merge
944 algorithm. When there is more than one common
945 ancestor that can be used for 3-way merge, it creates a
946 merged tree of the common ancestors and uses that as
947 the reference tree for the 3-way merge. This has been
948 reported to result in fewer merge conflicts without
949 causing mis-merges by tests done on actual merge commits
950 taken from Linux 2.6 kernel development history.
951 Additionally this can detect and handle merges involving
952 renames. This is the default merge strategy when
953 pulling or merging one branch.
954 </p>
955 <div class="paragraph"><p>The <em>recursive</em> strategy can take the following options:</p></div>
956 <div class="dlist"><dl>
957 <dt class="hdlist1">
958 ours
959 </dt>
960 <dd>
962 This option forces conflicting hunks to be auto-resolved cleanly by
963 favoring <em>our</em> version. Changes from the other tree that do not
964 conflict with our side are reflected to the merge result.
965 </p>
966 <div class="paragraph"><p>This should not be confused with the <em>ours</em> merge strategy, which does not
967 even look at what the other tree contains at all. It discards everything
968 the other tree did, declaring <em>our</em> history contains all that happened in it.</p></div>
969 </dd>
970 <dt class="hdlist1">
971 theirs
972 </dt>
973 <dd>
975 This is opposite of <em>ours</em>.
976 </p>
977 </dd>
978 <dt class="hdlist1">
979 patience
980 </dt>
981 <dd>
983 With this option, <em>merge-recursive</em> spends a little extra time
984 to avoid mismerges that sometimes occur due to unimportant
985 matching lines (e.g., braces from distinct functions). Use
986 this when the branches to be merged have diverged wildly.
987 See also <a href="git-diff.html">git-diff(1)</a> <tt>--patience</tt>.
988 </p>
989 </dd>
990 <dt class="hdlist1">
991 ignore-space-change
992 </dt>
993 <dt class="hdlist1">
994 ignore-all-space
995 </dt>
996 <dt class="hdlist1">
997 ignore-space-at-eol
998 </dt>
999 <dd>
1001 Treats lines with the indicated type of whitespace change as
1002 unchanged for the sake of a three-way merge. Whitespace
1003 changes mixed with other changes to a line are not ignored.
1004 See also <a href="git-diff.html">git-diff(1)</a> <tt>-b</tt>, <tt>-w</tt>, and
1005 <tt>--ignore-space-at-eol</tt>.
1006 </p>
1007 <div class="ulist"><ul>
1008 <li>
1010 If <em>their</em> version only introduces whitespace changes to a line,
1011 <em>our</em> version is used;
1012 </p>
1013 </li>
1014 <li>
1016 If <em>our</em> version introduces whitespace changes but <em>their</em>
1017 version includes a substantial change, <em>their</em> version is used;
1018 </p>
1019 </li>
1020 <li>
1022 Otherwise, the merge proceeds in the usual way.
1023 </p>
1024 </li>
1025 </ul></div>
1026 </dd>
1027 <dt class="hdlist1">
1028 renormalize
1029 </dt>
1030 <dd>
1032 This runs a virtual check-out and check-in of all three stages
1033 of a file when resolving a three-way merge. This option is
1034 meant to be used when merging branches with different clean
1035 filters or end-of-line normalization rules. See "Merging
1036 branches with differing checkin/checkout attributes" in
1037 <a href="gitattributes.html">gitattributes(5)</a> for details.
1038 </p>
1039 </dd>
1040 <dt class="hdlist1">
1041 no-renormalize
1042 </dt>
1043 <dd>
1045 Disables the <tt>renormalize</tt> option. This overrides the
1046 <tt>merge.renormalize</tt> configuration variable.
1047 </p>
1048 </dd>
1049 <dt class="hdlist1">
1050 rename-threshold=&lt;n&gt;
1051 </dt>
1052 <dd>
1054 Controls the similarity threshold used for rename detection.
1055 See also <a href="git-diff.html">git-diff(1)</a> <tt>-M</tt>.
1056 </p>
1057 </dd>
1058 <dt class="hdlist1">
1059 subtree[=&lt;path&gt;]
1060 </dt>
1061 <dd>
1063 This option is a more advanced form of <em>subtree</em> strategy, where
1064 the strategy makes a guess on how two trees must be shifted to
1065 match with each other when merging. Instead, the specified path
1066 is prefixed (or stripped from the beginning) to make the shape of
1067 two trees to match.
1068 </p>
1069 </dd>
1070 </dl></div>
1071 </dd>
1072 <dt class="hdlist1">
1073 octopus
1074 </dt>
1075 <dd>
1077 This resolves cases with more than two heads, but refuses to do
1078 a complex merge that needs manual resolution. It is
1079 primarily meant to be used for bundling topic branch
1080 heads together. This is the default merge strategy when
1081 pulling or merging more than one branch.
1082 </p>
1083 </dd>
1084 <dt class="hdlist1">
1085 ours
1086 </dt>
1087 <dd>
1089 This resolves any number of heads, but the resulting tree of the
1090 merge is always that of the current branch head, effectively
1091 ignoring all changes from all other branches. It is meant to
1092 be used to supersede old development history of side
1093 branches. Note that this is different from the -Xours option to
1094 the <em>recursive</em> merge strategy.
1095 </p>
1096 </dd>
1097 <dt class="hdlist1">
1098 subtree
1099 </dt>
1100 <dd>
1102 This is a modified recursive strategy. When merging trees A and
1103 B, if B corresponds to a subtree of A, B is first adjusted to
1104 match the tree structure of A, instead of reading the trees at
1105 the same level. This adjustment is also done to the common
1106 ancestor tree.
1107 </p>
1108 </dd>
1109 </dl></div>
1110 </div>
1111 <h2 id="_notes">NOTES</h2>
1112 <div class="sectionbody">
1113 <div class="paragraph"><p>You should understand the implications of using <em>git rebase</em> on a
1114 repository that you share. See also RECOVERING FROM UPSTREAM REBASE
1115 below.</p></div>
1116 <div class="paragraph"><p>When the git-rebase command is run, it will first execute a "pre-rebase"
1117 hook if one exists. You can use this hook to do sanity checks and
1118 reject the rebase if it isn&#8217;t appropriate. Please see the template
1119 pre-rebase hook script for an example.</p></div>
1120 <div class="paragraph"><p>Upon completion, &lt;branch&gt; will be the current branch.</p></div>
1121 </div>
1122 <h2 id="_interactive_mode">INTERACTIVE MODE</h2>
1123 <div class="sectionbody">
1124 <div class="paragraph"><p>Rebasing interactively means that you have a chance to edit the commits
1125 which are rebased. You can reorder the commits, and you can
1126 remove them (weeding out bad or otherwise unwanted patches).</p></div>
1127 <div class="paragraph"><p>The interactive mode is meant for this type of workflow:</p></div>
1128 <div class="olist arabic"><ol class="arabic">
1129 <li>
1131 have a wonderful idea
1132 </p>
1133 </li>
1134 <li>
1136 hack on the code
1137 </p>
1138 </li>
1139 <li>
1141 prepare a series for submission
1142 </p>
1143 </li>
1144 <li>
1146 submit
1147 </p>
1148 </li>
1149 </ol></div>
1150 <div class="paragraph"><p>where point 2. consists of several instances of</p></div>
1151 <div class="olist loweralpha"><ol class="loweralpha">
1152 <li>
1154 regular use
1155 </p>
1156 <div class="olist arabic"><ol class="arabic">
1157 <li>
1159 finish something worthy of a commit
1160 </p>
1161 </li>
1162 <li>
1164 commit
1165 </p>
1166 </li>
1167 </ol></div>
1168 </li>
1169 <li>
1171 independent fixup
1172 </p>
1173 <div class="olist arabic"><ol class="arabic">
1174 <li>
1176 realize that something does not work
1177 </p>
1178 </li>
1179 <li>
1181 fix that
1182 </p>
1183 </li>
1184 <li>
1186 commit it
1187 </p>
1188 </li>
1189 </ol></div>
1190 </li>
1191 </ol></div>
1192 <div class="paragraph"><p>Sometimes the thing fixed in b.2. cannot be amended to the not-quite
1193 perfect commit it fixes, because that commit is buried deeply in a
1194 patch series. That is exactly what interactive rebase is for: use it
1195 after plenty of "a"s and "b"s, by rearranging and editing
1196 commits, and squashing multiple commits into one.</p></div>
1197 <div class="paragraph"><p>Start it with the last commit you want to retain as-is:</p></div>
1198 <div class="literalblock">
1199 <div class="content">
1200 <pre><tt>git rebase -i &lt;after-this-commit&gt;</tt></pre>
1201 </div></div>
1202 <div class="paragraph"><p>An editor will be fired up with all the commits in your current branch
1203 (ignoring merge commits), which come after the given commit. You can
1204 reorder the commits in this list to your heart&#8217;s content, and you can
1205 remove them. The list looks more or less like this:</p></div>
1206 <div class="listingblock">
1207 <div class="content">
1208 <pre><tt>pick deadbee The oneline of this commit
1209 pick fa1afe1 The oneline of the next commit
1210 ...</tt></pre>
1211 </div></div>
1212 <div class="paragraph"><p>The oneline descriptions are purely for your pleasure; <em>git rebase</em> will
1213 not look at them but at the commit names ("deadbee" and "fa1afe1" in this
1214 example), so do not delete or edit the names.</p></div>
1215 <div class="paragraph"><p>By replacing the command "pick" with the command "edit", you can tell
1216 <em>git rebase</em> to stop after applying that commit, so that you can edit
1217 the files and/or the commit message, amend the commit, and continue
1218 rebasing.</p></div>
1219 <div class="paragraph"><p>If you just want to edit the commit message for a commit, replace the
1220 command "pick" with the command "reword".</p></div>
1221 <div class="paragraph"><p>If you want to fold two or more commits into one, replace the command
1222 "pick" for the second and subsequent commits with "squash" or "fixup".
1223 If the commits had different authors, the folded commit will be
1224 attributed to the author of the first commit. The suggested commit
1225 message for the folded commit is the concatenation of the commit
1226 messages of the first commit and of those with the "squash" command,
1227 but omits the commit messages of commits with the "fixup" command.</p></div>
1228 <div class="paragraph"><p><em>git rebase</em> will stop when "pick" has been replaced with "edit" or
1229 when a command fails due to merge errors. When you are done editing
1230 and/or resolving conflicts you can continue with <tt>git rebase --continue</tt>.</p></div>
1231 <div class="paragraph"><p>For example, if you want to reorder the last 5 commits, such that what
1232 was HEAD~4 becomes the new HEAD. To achieve that, you would call
1233 <em>git rebase</em> like this:</p></div>
1234 <div class="listingblock">
1235 <div class="content">
1236 <pre><tt>$ git rebase -i HEAD~5</tt></pre>
1237 </div></div>
1238 <div class="paragraph"><p>And move the first patch to the end of the list.</p></div>
1239 <div class="paragraph"><p>You might want to preserve merges, if you have a history like this:</p></div>
1240 <div class="listingblock">
1241 <div class="content">
1242 <pre><tt> X
1244 A---M---B
1246 ---o---O---P---Q</tt></pre>
1247 </div></div>
1248 <div class="paragraph"><p>Suppose you want to rebase the side branch starting at "A" to "Q". Make
1249 sure that the current HEAD is "B", and call</p></div>
1250 <div class="listingblock">
1251 <div class="content">
1252 <pre><tt>$ git rebase -i -p --onto Q O</tt></pre>
1253 </div></div>
1254 <div class="paragraph"><p>Reordering and editing commits usually creates untested intermediate
1255 steps. You may want to check that your history editing did not break
1256 anything by running a test, or at least recompiling at intermediate
1257 points in history by using the "exec" command (shortcut "x"). You may
1258 do so by creating a todo list like this one:</p></div>
1259 <div class="listingblock">
1260 <div class="content">
1261 <pre><tt>pick deadbee Implement feature XXX
1262 fixup f1a5c00 Fix to feature XXX
1263 exec make
1264 pick c0ffeee The oneline of the next commit
1265 edit deadbab The oneline of the commit after
1266 exec cd subdir; make test
1267 ...</tt></pre>
1268 </div></div>
1269 <div class="paragraph"><p>The interactive rebase will stop when a command fails (i.e. exits with
1270 non-0 status) to give you an opportunity to fix the problem. You can
1271 continue with <tt>git rebase --continue</tt>.</p></div>
1272 <div class="paragraph"><p>The "exec" command launches the command in a shell (the one specified
1273 in <tt>$SHELL</tt>, or the default shell if <tt>$SHELL</tt> is not set), so you can
1274 use shell features (like "cd", "&gt;", ";" &#8230;). The command is run from
1275 the root of the working tree.</p></div>
1276 </div>
1277 <h2 id="_splitting_commits">SPLITTING COMMITS</h2>
1278 <div class="sectionbody">
1279 <div class="paragraph"><p>In interactive mode, you can mark commits with the action "edit". However,
1280 this does not necessarily mean that <em>git rebase</em> expects the result of this
1281 edit to be exactly one commit. Indeed, you can undo the commit, or you can
1282 add other commits. This can be used to split a commit into two:</p></div>
1283 <div class="ulist"><ul>
1284 <li>
1286 Start an interactive rebase with <tt>git rebase -i &lt;commit&gt;^</tt>, where
1287 &lt;commit&gt; is the commit you want to split. In fact, any commit range
1288 will do, as long as it contains that commit.
1289 </p>
1290 </li>
1291 <li>
1293 Mark the commit you want to split with the action "edit".
1294 </p>
1295 </li>
1296 <li>
1298 When it comes to editing that commit, execute <tt>git reset HEAD^</tt>. The
1299 effect is that the HEAD is rewound by one, and the index follows suit.
1300 However, the working tree stays the same.
1301 </p>
1302 </li>
1303 <li>
1305 Now add the changes to the index that you want to have in the first
1306 commit. You can use <tt>git add</tt> (possibly interactively) or
1307 <em>git gui</em> (or both) to do that.
1308 </p>
1309 </li>
1310 <li>
1312 Commit the now-current index with whatever commit message is appropriate
1313 now.
1314 </p>
1315 </li>
1316 <li>
1318 Repeat the last two steps until your working tree is clean.
1319 </p>
1320 </li>
1321 <li>
1323 Continue the rebase with <tt>git rebase --continue</tt>.
1324 </p>
1325 </li>
1326 </ul></div>
1327 <div class="paragraph"><p>If you are not absolutely sure that the intermediate revisions are
1328 consistent (they compile, pass the testsuite, etc.) you should use
1329 <em>git stash</em> to stash away the not-yet-committed changes
1330 after each commit, test, and amend the commit if fixes are necessary.</p></div>
1331 </div>
1332 <h2 id="_recovering_from_upstream_rebase">RECOVERING FROM UPSTREAM REBASE</h2>
1333 <div class="sectionbody">
1334 <div class="paragraph"><p>Rebasing (or any other form of rewriting) a branch that others have
1335 based work on is a bad idea: anyone downstream of it is forced to
1336 manually fix their history. This section explains how to do the fix
1337 from the downstream&#8217;s point of view. The real fix, however, would be
1338 to avoid rebasing the upstream in the first place.</p></div>
1339 <div class="paragraph"><p>To illustrate, suppose you are in a situation where someone develops a
1340 <em>subsystem</em> branch, and you are working on a <em>topic</em> that is dependent
1341 on this <em>subsystem</em>. You might end up with a history like the
1342 following:</p></div>
1343 <div class="listingblock">
1344 <div class="content">
1345 <pre><tt> o---o---o---o---o---o---o---o---o master
1347 o---o---o---o---o subsystem
1349 *---*---* topic</tt></pre>
1350 </div></div>
1351 <div class="paragraph"><p>If <em>subsystem</em> is rebased against <em>master</em>, the following happens:</p></div>
1352 <div class="listingblock">
1353 <div class="content">
1354 <pre><tt> o---o---o---o---o---o---o---o master
1356 o---o---o---o---o o'--o'--o'--o'--o' subsystem
1358 *---*---* topic</tt></pre>
1359 </div></div>
1360 <div class="paragraph"><p>If you now continue development as usual, and eventually merge <em>topic</em>
1361 to <em>subsystem</em>, the commits from <em>subsystem</em> will remain duplicated forever:</p></div>
1362 <div class="listingblock">
1363 <div class="content">
1364 <pre><tt> o---o---o---o---o---o---o---o master
1366 o---o---o---o---o o'--o'--o'--o'--o'--M subsystem
1368 *---*---*-..........-*--* topic</tt></pre>
1369 </div></div>
1370 <div class="paragraph"><p>Such duplicates are generally frowned upon because they clutter up
1371 history, making it harder to follow. To clean things up, you need to
1372 transplant the commits on <em>topic</em> to the new <em>subsystem</em> tip, i.e.,
1373 rebase <em>topic</em>. This becomes a ripple effect: anyone downstream from
1374 <em>topic</em> is forced to rebase too, and so on!</p></div>
1375 <div class="paragraph"><p>There are two kinds of fixes, discussed in the following subsections:</p></div>
1376 <div class="dlist"><dl>
1377 <dt class="hdlist1">
1378 Easy case: The changes are literally the same.
1379 </dt>
1380 <dd>
1382 This happens if the <em>subsystem</em> rebase was a simple rebase and
1383 had no conflicts.
1384 </p>
1385 </dd>
1386 <dt class="hdlist1">
1387 Hard case: The changes are not the same.
1388 </dt>
1389 <dd>
1391 This happens if the <em>subsystem</em> rebase had conflicts, or used
1392 <tt>--interactive</tt> to omit, edit, squash, or fixup commits; or
1393 if the upstream used one of <tt>commit --amend</tt>, <tt>reset</tt>, or
1394 <tt>filter-branch</tt>.
1395 </p>
1396 </dd>
1397 </dl></div>
1398 <h3 id="_the_easy_case">The easy case</h3><div style="clear:left"></div>
1399 <div class="paragraph"><p>Only works if the changes (patch IDs based on the diff contents) on
1400 <em>subsystem</em> are literally the same before and after the rebase
1401 <em>subsystem</em> did.</p></div>
1402 <div class="paragraph"><p>In that case, the fix is easy because <em>git rebase</em> knows to skip
1403 changes that are already present in the new upstream. So if you say
1404 (assuming you&#8217;re on <em>topic</em>)</p></div>
1405 <div class="listingblock">
1406 <div class="content">
1407 <pre><tt> $ git rebase subsystem</tt></pre>
1408 </div></div>
1409 <div class="paragraph"><p>you will end up with the fixed history</p></div>
1410 <div class="listingblock">
1411 <div class="content">
1412 <pre><tt> o---o---o---o---o---o---o---o master
1414 o'--o'--o'--o'--o' subsystem
1416 *---*---* topic</tt></pre>
1417 </div></div>
1418 <h3 id="_the_hard_case">The hard case</h3><div style="clear:left"></div>
1419 <div class="paragraph"><p>Things get more complicated if the <em>subsystem</em> changes do not exactly
1420 correspond to the ones before the rebase.</p></div>
1421 <div class="admonitionblock">
1422 <table><tr>
1423 <td class="icon">
1424 <div class="title">Note</div>
1425 </td>
1426 <td class="content">While an "easy case recovery" sometimes appears to be successful
1427 even in the hard case, it may have unintended consequences. For
1428 example, a commit that was removed via <tt>git rebase
1429 --interactive</tt> will be <strong>resurrected</strong>!</td>
1430 </tr></table>
1431 </div>
1432 <div class="paragraph"><p>The idea is to manually tell <em>git rebase</em> "where the old <em>subsystem</em>
1433 ended and your <em>topic</em> began", that is, what the old merge-base
1434 between them was. You will have to find a way to name the last commit
1435 of the old <em>subsystem</em>, for example:</p></div>
1436 <div class="ulist"><ul>
1437 <li>
1439 With the <em>subsystem</em> reflog: after <em>git fetch</em>, the old tip of
1440 <em>subsystem</em> is at <tt>subsystem@{1}</tt>. Subsequent fetches will
1441 increase the number. (See <a href="git-reflog.html">git-reflog(1)</a>.)
1442 </p>
1443 </li>
1444 <li>
1446 Relative to the tip of <em>topic</em>: knowing that your <em>topic</em> has three
1447 commits, the old tip of <em>subsystem</em> must be <tt>topic~3</tt>.
1448 </p>
1449 </li>
1450 </ul></div>
1451 <div class="paragraph"><p>You can then transplant the old <tt>subsystem..topic</tt> to the new tip by
1452 saying (for the reflog case, and assuming you are on <em>topic</em> already):</p></div>
1453 <div class="listingblock">
1454 <div class="content">
1455 <pre><tt> $ git rebase --onto subsystem subsystem@{1}</tt></pre>
1456 </div></div>
1457 <div class="paragraph"><p>The ripple effect of a "hard case" recovery is especially bad:
1458 <em>everyone</em> downstream from <em>topic</em> will now have to perform a "hard
1459 case" recovery too!</p></div>
1460 </div>
1461 <h2 id="_bugs">BUGS</h2>
1462 <div class="sectionbody">
1463 <div class="paragraph"><p>The todo list presented by <tt>--preserve-merges --interactive</tt> does not
1464 represent the topology of the revision graph. Editing commits and
1465 rewording their commit messages should work fine, but attempts to
1466 reorder commits tend to produce counterintuitive results.</p></div>
1467 <div class="paragraph"><p>For example, an attempt to rearrange</p></div>
1468 <div class="listingblock">
1469 <div class="content">
1470 <pre><tt>1 --- 2 --- 3 --- 4 --- 5</tt></pre>
1471 </div></div>
1472 <div class="paragraph"><p>to</p></div>
1473 <div class="listingblock">
1474 <div class="content">
1475 <pre><tt>1 --- 2 --- 4 --- 3 --- 5</tt></pre>
1476 </div></div>
1477 <div class="paragraph"><p>by moving the "pick 4" line will result in the following history:</p></div>
1478 <div class="listingblock">
1479 <div class="content">
1480 <pre><tt> 3
1482 1 --- 2 --- 4 --- 5</tt></pre>
1483 </div></div>
1484 </div>
1485 <h2 id="_git">GIT</h2>
1486 <div class="sectionbody">
1487 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1488 </div>
1489 <div id="footer">
1490 <div id="footer-text">
1491 Last updated 2011-07-23 00:49:30 UTC
1492 </div>
1493 </div>
1494 </body>
1495 </html>