Autogenerated HTML docs for v1.7.4.1-176-g501cc
[git/jnareb-git.git] / git-rebase.html
blob5b586fb6d5306bbeda103c8d6b231b466e4800a3
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;]</div>
422 <div class="verseblock-attribution">
423 </div></div>
424 <div class="paragraph"><p><em>git rebase</em> --continue | --skip | --abort</p></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>All changes made by commits in the current branch but that are not
432 in &lt;upstream&gt; are saved to a temporary area. This is the same set
433 of commits that would be shown by <tt>git log &lt;upstream&gt;..HEAD</tt> (or
434 <tt>git log HEAD</tt>, if --root is specified).</p></div>
435 <div class="paragraph"><p>The current branch is reset to &lt;upstream&gt;, or &lt;newbase&gt; if the
436 --onto option was supplied. This has the exact same effect as
437 <tt>git reset --hard &lt;upstream&gt;</tt> (or &lt;newbase&gt;). ORIG_HEAD is set
438 to point at the tip of the branch before the reset.</p></div>
439 <div class="paragraph"><p>The commits that were previously saved into the temporary area are
440 then reapplied to the current branch, one by one, in order. Note that
441 any commits in HEAD which introduce the same textual changes as a commit
442 in HEAD..&lt;upstream&gt; are omitted (i.e., a patch already accepted upstream
443 with a different commit message or timestamp will be skipped).</p></div>
444 <div class="paragraph"><p>It is possible that a merge failure will prevent this process from being
445 completely automatic. You will have to resolve any such merge failure
446 and run <tt>git rebase --continue</tt>. Another option is to bypass the commit
447 that caused the merge failure with <tt>git rebase --skip</tt>. To restore the
448 original &lt;branch&gt; and remove the .git/rebase-apply working files, use the
449 command <tt>git rebase --abort</tt> instead.</p></div>
450 <div class="paragraph"><p>Assume the following history exists and the current branch is "topic":</p></div>
451 <div class="listingblock">
452 <div class="content">
453 <pre><tt> A---B---C topic
455 D---E---F---G master</tt></pre>
456 </div></div>
457 <div class="paragraph"><p>From this point, the result of either of the following commands:</p></div>
458 <div class="literalblock">
459 <div class="content">
460 <pre><tt>git rebase master
461 git rebase master topic</tt></pre>
462 </div></div>
463 <div class="paragraph"><p>would be:</p></div>
464 <div class="listingblock">
465 <div class="content">
466 <pre><tt> A'--B'--C' topic
468 D---E---F---G master</tt></pre>
469 </div></div>
470 <div class="paragraph"><p>The latter form is just a short-hand of <tt>git checkout topic</tt>
471 followed by <tt>git rebase master</tt>.</p></div>
472 <div class="paragraph"><p>If the upstream branch already contains a change you have made (e.g.,
473 because you mailed a patch which was applied upstream), then that commit
474 will be skipped. For example, running &#8216;git rebase master` on the
475 following history (in which A&#8217; and A introduce the same set of changes,
476 but have different committer information):</p></div>
477 <div class="listingblock">
478 <div class="content">
479 <pre><tt> A---B---C topic
481 D---E---A'---F master</tt></pre>
482 </div></div>
483 <div class="paragraph"><p>will result in:</p></div>
484 <div class="listingblock">
485 <div class="content">
486 <pre><tt> B'---C' topic
488 D---E---A'---F master</tt></pre>
489 </div></div>
490 <div class="paragraph"><p>Here is how you would transplant a topic branch based on one
491 branch to another, to pretend that you forked the topic branch
492 from the latter branch, using <tt>rebase --onto</tt>.</p></div>
493 <div class="paragraph"><p>First let&#8217;s assume your <em>topic</em> is based on branch <em>next</em>.
494 For example, a feature developed in <em>topic</em> depends on some
495 functionality which is found in <em>next</em>.</p></div>
496 <div class="listingblock">
497 <div class="content">
498 <pre><tt> o---o---o---o---o master
500 o---o---o---o---o next
502 o---o---o topic</tt></pre>
503 </div></div>
504 <div class="paragraph"><p>We want to make <em>topic</em> forked from branch <em>master</em>; for example,
505 because the functionality on which <em>topic</em> depends was merged into the
506 more stable <em>master</em> branch. We want our tree to look like this:</p></div>
507 <div class="listingblock">
508 <div class="content">
509 <pre><tt> o---o---o---o---o master
511 | o'--o'--o' topic
513 o---o---o---o---o next</tt></pre>
514 </div></div>
515 <div class="paragraph"><p>We can get this using the following command:</p></div>
516 <div class="literalblock">
517 <div class="content">
518 <pre><tt>git rebase --onto master next topic</tt></pre>
519 </div></div>
520 <div class="paragraph"><p>Another example of --onto option is to rebase part of a
521 branch. If we have the following situation:</p></div>
522 <div class="listingblock">
523 <div class="content">
524 <pre><tt> H---I---J topicB
526 E---F---G topicA
528 A---B---C---D master</tt></pre>
529 </div></div>
530 <div class="paragraph"><p>then the command</p></div>
531 <div class="literalblock">
532 <div class="content">
533 <pre><tt>git rebase --onto master topicA topicB</tt></pre>
534 </div></div>
535 <div class="paragraph"><p>would result in:</p></div>
536 <div class="listingblock">
537 <div class="content">
538 <pre><tt> H'--I'--J' topicB
540 | E---F---G topicA
542 A---B---C---D master</tt></pre>
543 </div></div>
544 <div class="paragraph"><p>This is useful when topicB does not depend on topicA.</p></div>
545 <div class="paragraph"><p>A range of commits could also be removed with rebase. If we have
546 the following situation:</p></div>
547 <div class="listingblock">
548 <div class="content">
549 <pre><tt> E---F---G---H---I---J topicA</tt></pre>
550 </div></div>
551 <div class="paragraph"><p>then the command</p></div>
552 <div class="literalblock">
553 <div class="content">
554 <pre><tt>git rebase --onto topicA~5 topicA~3 topicA</tt></pre>
555 </div></div>
556 <div class="paragraph"><p>would result in the removal of commits F and G:</p></div>
557 <div class="listingblock">
558 <div class="content">
559 <pre><tt> E---H'---I'---J' topicA</tt></pre>
560 </div></div>
561 <div class="paragraph"><p>This is useful if F and G were flawed in some way, or should not be
562 part of topicA. Note that the argument to --onto and the &lt;upstream&gt;
563 parameter can be any valid commit-ish.</p></div>
564 <div class="paragraph"><p>In case of conflict, <em>git rebase</em> will stop at the first problematic commit
565 and leave conflict markers in the tree. You can use <em>git diff</em> to locate
566 the markers (&lt;&lt;&lt;&lt;&lt;&lt;) and make edits to resolve the conflict. For each
567 file you edit, you need to tell git that the conflict has been resolved,
568 typically this would be done with</p></div>
569 <div class="literalblock">
570 <div class="content">
571 <pre><tt>git add &lt;filename&gt;</tt></pre>
572 </div></div>
573 <div class="paragraph"><p>After resolving the conflict manually and updating the index with the
574 desired resolution, you can continue the rebasing process with</p></div>
575 <div class="literalblock">
576 <div class="content">
577 <pre><tt>git rebase --continue</tt></pre>
578 </div></div>
579 <div class="paragraph"><p>Alternatively, you can undo the <em>git rebase</em> with</p></div>
580 <div class="literalblock">
581 <div class="content">
582 <pre><tt>git rebase --abort</tt></pre>
583 </div></div>
584 </div>
585 <h2 id="_configuration">CONFIGURATION</h2>
586 <div class="sectionbody">
587 <div class="dlist"><dl>
588 <dt class="hdlist1">
589 rebase.stat
590 </dt>
591 <dd>
593 Whether to show a diffstat of what changed upstream since the last
594 rebase. False by default.
595 </p>
596 </dd>
597 <dt class="hdlist1">
598 rebase.autosquash
599 </dt>
600 <dd>
602 If set to true enable <em>--autosquash</em> option by default.
603 </p>
604 </dd>
605 </dl></div>
606 </div>
607 <h2 id="_options">OPTIONS</h2>
608 <div class="sectionbody">
609 <div class="dlist"><dl>
610 <dt class="hdlist1">
611 &lt;newbase&gt;
612 </dt>
613 <dd>
615 Starting point at which to create the new commits. If the
616 --onto option is not specified, the starting point is
617 &lt;upstream&gt;. May be any valid commit, and not just an
618 existing branch name.
619 </p>
620 <div class="paragraph"><p>As a special case, you may use "A...B" as a shortcut for the
621 merge base of A and B if there is exactly one merge base. You can
622 leave out at most one of A and B, in which case it defaults to HEAD.</p></div>
623 </dd>
624 <dt class="hdlist1">
625 &lt;upstream&gt;
626 </dt>
627 <dd>
629 Upstream branch to compare against. May be any valid commit,
630 not just an existing branch name.
631 </p>
632 </dd>
633 <dt class="hdlist1">
634 &lt;branch&gt;
635 </dt>
636 <dd>
638 Working branch; defaults to HEAD.
639 </p>
640 </dd>
641 <dt class="hdlist1">
642 --continue
643 </dt>
644 <dd>
646 Restart the rebasing process after having resolved a merge conflict.
647 </p>
648 </dd>
649 <dt class="hdlist1">
650 --abort
651 </dt>
652 <dd>
654 Restore the original branch and abort the rebase operation.
655 </p>
656 </dd>
657 <dt class="hdlist1">
658 --skip
659 </dt>
660 <dd>
662 Restart the rebasing process by skipping the current patch.
663 </p>
664 </dd>
665 <dt class="hdlist1">
667 </dt>
668 <dt class="hdlist1">
669 --merge
670 </dt>
671 <dd>
673 Use merging strategies to rebase. When the recursive (default) merge
674 strategy is used, this allows rebase to be aware of renames on the
675 upstream side.
676 </p>
677 <div class="paragraph"><p>Note that a rebase merge works by replaying each commit from the working
678 branch on top of the &lt;upstream&gt; branch. Because of this, when a merge
679 conflict happens, the side reported as <em>ours</em> is the so-far rebased
680 series, starting with &lt;upstream&gt;, and <em>theirs</em> is the working branch. In
681 other words, the sides are swapped.</p></div>
682 </dd>
683 <dt class="hdlist1">
684 -s &lt;strategy&gt;
685 </dt>
686 <dt class="hdlist1">
687 --strategy=&lt;strategy&gt;
688 </dt>
689 <dd>
691 Use the given merge strategy.
692 If there is no <tt>-s</tt> option <em>git merge-recursive</em> is used
693 instead. This implies --merge.
694 </p>
695 <div class="paragraph"><p>Because <em>git rebase</em> replays each commit from the working branch
696 on top of the &lt;upstream&gt; branch using the given strategy, using
697 the <em>ours</em> strategy simply discards all patches from the &lt;branch&gt;,
698 which makes little sense.</p></div>
699 </dd>
700 <dt class="hdlist1">
701 -X &lt;strategy-option&gt;
702 </dt>
703 <dt class="hdlist1">
704 --strategy-option=&lt;strategy-option&gt;
705 </dt>
706 <dd>
708 Pass the &lt;strategy-option&gt; through to the merge strategy.
709 This implies <tt>--merge</tt> and, if no strategy has been
710 specified, <tt>-s recursive</tt>. Note the reversal of <em>ours</em> and
711 <em>theirs</em> as noted in above for the <tt>-m</tt> option.
712 </p>
713 </dd>
714 <dt class="hdlist1">
716 </dt>
717 <dt class="hdlist1">
718 --quiet
719 </dt>
720 <dd>
722 Be quiet. Implies --no-stat.
723 </p>
724 </dd>
725 <dt class="hdlist1">
727 </dt>
728 <dt class="hdlist1">
729 --verbose
730 </dt>
731 <dd>
733 Be verbose. Implies --stat.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 --stat
738 </dt>
739 <dd>
741 Show a diffstat of what changed upstream since the last rebase. The
742 diffstat is also controlled by the configuration option rebase.stat.
743 </p>
744 </dd>
745 <dt class="hdlist1">
747 </dt>
748 <dt class="hdlist1">
749 --no-stat
750 </dt>
751 <dd>
753 Do not show a diffstat as part of the rebase process.
754 </p>
755 </dd>
756 <dt class="hdlist1">
757 --no-verify
758 </dt>
759 <dd>
761 This option bypasses the pre-rebase hook. See also <a href="githooks.html">githooks(5)</a>.
762 </p>
763 </dd>
764 <dt class="hdlist1">
765 --verify
766 </dt>
767 <dd>
769 Allows the pre-rebase hook to run, which is the default. This option can
770 be used to override --no-verify. See also <a href="githooks.html">githooks(5)</a>.
771 </p>
772 </dd>
773 <dt class="hdlist1">
774 -C&lt;n&gt;
775 </dt>
776 <dd>
778 Ensure at least &lt;n&gt; lines of surrounding context match before
779 and after each change. When fewer lines of surrounding
780 context exist they all must match. By default no context is
781 ever ignored.
782 </p>
783 </dd>
784 <dt class="hdlist1">
786 </dt>
787 <dt class="hdlist1">
788 --force-rebase
789 </dt>
790 <dd>
792 Force the rebase even if the current branch is a descendant
793 of the commit you are rebasing onto. Normally non-interactive rebase will
794 exit with the message "Current branch is up to date" in such a
795 situation.
796 Incompatible with the --interactive option.
797 </p>
798 <div class="paragraph"><p>You may find this (or --no-ff with an interactive rebase) helpful after
799 reverting a topic branch merge, as this option recreates the topic branch with
800 fresh commits so it can be remerged successfully without needing to "revert
801 the reversion" (see the
802 <a href="howto/revert-a-faulty-merge.txt">revert-a-faulty-merge How-To</a> for details).</p></div>
803 </dd>
804 <dt class="hdlist1">
805 --ignore-whitespace
806 </dt>
807 <dt class="hdlist1">
808 --whitespace=&lt;option&gt;
809 </dt>
810 <dd>
812 These flag are passed to the <em>git apply</em> program
813 (see <a href="git-apply.html">git-apply(1)</a>) that applies the patch.
814 Incompatible with the --interactive option.
815 </p>
816 </dd>
817 <dt class="hdlist1">
818 --committer-date-is-author-date
819 </dt>
820 <dt class="hdlist1">
821 --ignore-date
822 </dt>
823 <dd>
825 These flags are passed to <em>git am</em> to easily change the dates
826 of the rebased commits (see <a href="git-am.html">git-am(1)</a>).
827 Incompatible with the --interactive option.
828 </p>
829 </dd>
830 <dt class="hdlist1">
832 </dt>
833 <dt class="hdlist1">
834 --interactive
835 </dt>
836 <dd>
838 Make a list of the commits which are about to be rebased. Let the
839 user edit that list before rebasing. This mode can also be used to
840 split commits (see SPLITTING COMMITS below).
841 </p>
842 </dd>
843 <dt class="hdlist1">
845 </dt>
846 <dt class="hdlist1">
847 --preserve-merges
848 </dt>
849 <dd>
851 Instead of ignoring merges, try to recreate them.
852 </p>
853 <div class="paragraph"><p>This uses the <tt>--interactive</tt> machinery internally, but combining it
854 with the <tt>--interactive</tt> option explicitly is generally not a good
855 idea unless you know what you are doing (see BUGS below).</p></div>
856 </dd>
857 <dt class="hdlist1">
858 --root
859 </dt>
860 <dd>
862 Rebase all commits reachable from &lt;branch&gt;, instead of
863 limiting them with an &lt;upstream&gt;. This allows you to rebase
864 the root commit(s) on a branch. Must be used with --onto, and
865 will skip changes already contained in &lt;newbase&gt; (instead of
866 &lt;upstream&gt;). When used together with --preserve-merges, <em>all</em>
867 root commits will be rewritten to have &lt;newbase&gt; as parent
868 instead.
869 </p>
870 </dd>
871 <dt class="hdlist1">
872 --autosquash
873 </dt>
874 <dt class="hdlist1">
875 --no-autosquash
876 </dt>
877 <dd>
879 When the commit log message begins with "squash! &#8230;" (or
880 "fixup! &#8230;"), and there is a commit whose title begins with
881 the same &#8230;, automatically modify the todo list of rebase -i
882 so that the commit marked for squashing comes right after the
883 commit to be modified, and change the action of the moved
884 commit from <tt>pick</tt> to <tt>squash</tt> (or <tt>fixup</tt>).
885 </p>
886 <div class="paragraph"><p>This option is only valid when the <em>--interactive</em> option is used.</p></div>
887 <div class="paragraph"><p>If the <em>--autosquash</em> option is enabled by default using the
888 configuration variable <tt>rebase.autosquash</tt>, this option can be
889 used to override and disable this setting.</p></div>
890 </dd>
891 <dt class="hdlist1">
892 --no-ff
893 </dt>
894 <dd>
896 With --interactive, cherry-pick all rebased commits instead of
897 fast-forwarding over the unchanged ones. This ensures that the
898 entire history of the rebased branch is composed of new commits.
899 </p>
900 <div class="paragraph"><p>Without --interactive, this is a synonym for --force-rebase.</p></div>
901 <div class="paragraph"><p>You may find this helpful after reverting a topic branch merge, as this option
902 recreates the topic branch with fresh commits so it can be remerged
903 successfully without needing to "revert the reversion" (see the
904 <a href="howto/revert-a-faulty-merge.txt">revert-a-faulty-merge How-To</a> for details).</p></div>
905 </dd>
906 </dl></div>
907 </div>
908 <h2 id="_merge_strategies">MERGE STRATEGIES</h2>
909 <div class="sectionbody">
910 <div class="paragraph"><p>The merge mechanism (<em>git-merge</em> and <em>git-pull</em> commands) allows the
911 backend <em>merge strategies</em> to be chosen with <tt>-s</tt> option. Some strategies
912 can also take their own options, which can be passed by giving <tt>-X&lt;option&gt;</tt>
913 arguments to <em>git-merge</em> and/or <em>git-pull</em>.</p></div>
914 <div class="dlist"><dl>
915 <dt class="hdlist1">
916 resolve
917 </dt>
918 <dd>
920 This can only resolve two heads (i.e. the current branch
921 and another branch you pulled from) using a 3-way merge
922 algorithm. It tries to carefully detect criss-cross
923 merge ambiguities and is considered generally safe and
924 fast.
925 </p>
926 </dd>
927 <dt class="hdlist1">
928 recursive
929 </dt>
930 <dd>
932 This can only resolve two heads using a 3-way merge
933 algorithm. When there is more than one common
934 ancestor that can be used for 3-way merge, it creates a
935 merged tree of the common ancestors and uses that as
936 the reference tree for the 3-way merge. This has been
937 reported to result in fewer merge conflicts without
938 causing mis-merges by tests done on actual merge commits
939 taken from Linux 2.6 kernel development history.
940 Additionally this can detect and handle merges involving
941 renames. This is the default merge strategy when
942 pulling or merging one branch.
943 </p>
944 <div class="paragraph"><p>The <em>recursive</em> strategy can take the following options:</p></div>
945 <div class="dlist"><dl>
946 <dt class="hdlist1">
947 ours
948 </dt>
949 <dd>
951 This option forces conflicting hunks to be auto-resolved cleanly by
952 favoring <em>our</em> version. Changes from the other tree that do not
953 conflict with our side are reflected to the merge result.
954 </p>
955 <div class="paragraph"><p>This should not be confused with the <em>ours</em> merge strategy, which does not
956 even look at what the other tree contains at all. It discards everything
957 the other tree did, declaring <em>our</em> history contains all that happened in it.</p></div>
958 </dd>
959 <dt class="hdlist1">
960 theirs
961 </dt>
962 <dd>
964 This is opposite of <em>ours</em>.
965 </p>
966 </dd>
967 <dt class="hdlist1">
968 patience
969 </dt>
970 <dd>
972 With this option, <em>merge-recursive</em> spends a little extra time
973 to avoid mismerges that sometimes occur due to unimportant
974 matching lines (e.g., braces from distinct functions). Use
975 this when the branches to be merged have diverged wildly.
976 See also <a href="git-diff.html">git-diff(1)</a> <tt>--patience</tt>.
977 </p>
978 </dd>
979 <dt class="hdlist1">
980 ignore-space-change
981 </dt>
982 <dt class="hdlist1">
983 ignore-all-space
984 </dt>
985 <dt class="hdlist1">
986 ignore-space-at-eol
987 </dt>
988 <dd>
990 Treats lines with the indicated type of whitespace change as
991 unchanged for the sake of a three-way merge. Whitespace
992 changes mixed with other changes to a line are not ignored.
993 See also <a href="git-diff.html">git-diff(1)</a> <tt>-b</tt>, <tt>-w</tt>, and
994 <tt>--ignore-space-at-eol</tt>.
995 </p>
996 <div class="ulist"><ul>
997 <li>
999 If <em>their</em> version only introduces whitespace changes to a line,
1000 <em>our</em> version is used;
1001 </p>
1002 </li>
1003 <li>
1005 If <em>our</em> version introduces whitespace changes but <em>their</em>
1006 version includes a substantial change, <em>their</em> version is used;
1007 </p>
1008 </li>
1009 <li>
1011 Otherwise, the merge proceeds in the usual way.
1012 </p>
1013 </li>
1014 </ul></div>
1015 </dd>
1016 <dt class="hdlist1">
1017 renormalize
1018 </dt>
1019 <dd>
1021 This runs a virtual check-out and check-in of all three stages
1022 of a file when resolving a three-way merge. This option is
1023 meant to be used when merging branches with different clean
1024 filters or end-of-line normalization rules. See "Merging
1025 branches with differing checkin/checkout attributes" in
1026 <a href="gitattributes.html">gitattributes(5)</a> for details.
1027 </p>
1028 </dd>
1029 <dt class="hdlist1">
1030 no-renormalize
1031 </dt>
1032 <dd>
1034 Disables the <tt>renormalize</tt> option. This overrides the
1035 <tt>merge.renormalize</tt> configuration variable.
1036 </p>
1037 </dd>
1038 <dt class="hdlist1">
1039 rename-threshold=&lt;n&gt;
1040 </dt>
1041 <dd>
1043 Controls the similarity threshold used for rename detection.
1044 See also <a href="git-diff.html">git-diff(1)</a> <tt>-M</tt>.
1045 </p>
1046 </dd>
1047 <dt class="hdlist1">
1048 subtree[=&lt;path&gt;]
1049 </dt>
1050 <dd>
1052 This option is a more advanced form of <em>subtree</em> strategy, where
1053 the strategy makes a guess on how two trees must be shifted to
1054 match with each other when merging. Instead, the specified path
1055 is prefixed (or stripped from the beginning) to make the shape of
1056 two trees to match.
1057 </p>
1058 </dd>
1059 </dl></div>
1060 </dd>
1061 <dt class="hdlist1">
1062 octopus
1063 </dt>
1064 <dd>
1066 This resolves cases with more than two heads, but refuses to do
1067 a complex merge that needs manual resolution. It is
1068 primarily meant to be used for bundling topic branch
1069 heads together. This is the default merge strategy when
1070 pulling or merging more than one branch.
1071 </p>
1072 </dd>
1073 <dt class="hdlist1">
1074 ours
1075 </dt>
1076 <dd>
1078 This resolves any number of heads, but the resulting tree of the
1079 merge is always that of the current branch head, effectively
1080 ignoring all changes from all other branches. It is meant to
1081 be used to supersede old development history of side
1082 branches. Note that this is different from the -Xours option to
1083 the <em>recursive</em> merge strategy.
1084 </p>
1085 </dd>
1086 <dt class="hdlist1">
1087 subtree
1088 </dt>
1089 <dd>
1091 This is a modified recursive strategy. When merging trees A and
1092 B, if B corresponds to a subtree of A, B is first adjusted to
1093 match the tree structure of A, instead of reading the trees at
1094 the same level. This adjustment is also done to the common
1095 ancestor tree.
1096 </p>
1097 </dd>
1098 </dl></div>
1099 </div>
1100 <h2 id="_notes">NOTES</h2>
1101 <div class="sectionbody">
1102 <div class="paragraph"><p>You should understand the implications of using <em>git rebase</em> on a
1103 repository that you share. See also RECOVERING FROM UPSTREAM REBASE
1104 below.</p></div>
1105 <div class="paragraph"><p>When the git-rebase command is run, it will first execute a "pre-rebase"
1106 hook if one exists. You can use this hook to do sanity checks and
1107 reject the rebase if it isn&#8217;t appropriate. Please see the template
1108 pre-rebase hook script for an example.</p></div>
1109 <div class="paragraph"><p>Upon completion, &lt;branch&gt; will be the current branch.</p></div>
1110 </div>
1111 <h2 id="_interactive_mode">INTERACTIVE MODE</h2>
1112 <div class="sectionbody">
1113 <div class="paragraph"><p>Rebasing interactively means that you have a chance to edit the commits
1114 which are rebased. You can reorder the commits, and you can
1115 remove them (weeding out bad or otherwise unwanted patches).</p></div>
1116 <div class="paragraph"><p>The interactive mode is meant for this type of workflow:</p></div>
1117 <div class="olist arabic"><ol class="arabic">
1118 <li>
1120 have a wonderful idea
1121 </p>
1122 </li>
1123 <li>
1125 hack on the code
1126 </p>
1127 </li>
1128 <li>
1130 prepare a series for submission
1131 </p>
1132 </li>
1133 <li>
1135 submit
1136 </p>
1137 </li>
1138 </ol></div>
1139 <div class="paragraph"><p>where point 2. consists of several instances of</p></div>
1140 <div class="olist loweralpha"><ol class="loweralpha">
1141 <li>
1143 regular use
1144 </p>
1145 <div class="olist arabic"><ol class="arabic">
1146 <li>
1148 finish something worthy of a commit
1149 </p>
1150 </li>
1151 <li>
1153 commit
1154 </p>
1155 </li>
1156 </ol></div>
1157 </li>
1158 <li>
1160 independent fixup
1161 </p>
1162 <div class="olist arabic"><ol class="arabic">
1163 <li>
1165 realize that something does not work
1166 </p>
1167 </li>
1168 <li>
1170 fix that
1171 </p>
1172 </li>
1173 <li>
1175 commit it
1176 </p>
1177 </li>
1178 </ol></div>
1179 </li>
1180 </ol></div>
1181 <div class="paragraph"><p>Sometimes the thing fixed in b.2. cannot be amended to the not-quite
1182 perfect commit it fixes, because that commit is buried deeply in a
1183 patch series. That is exactly what interactive rebase is for: use it
1184 after plenty of "a"s and "b"s, by rearranging and editing
1185 commits, and squashing multiple commits into one.</p></div>
1186 <div class="paragraph"><p>Start it with the last commit you want to retain as-is:</p></div>
1187 <div class="literalblock">
1188 <div class="content">
1189 <pre><tt>git rebase -i &lt;after-this-commit&gt;</tt></pre>
1190 </div></div>
1191 <div class="paragraph"><p>An editor will be fired up with all the commits in your current branch
1192 (ignoring merge commits), which come after the given commit. You can
1193 reorder the commits in this list to your heart&#8217;s content, and you can
1194 remove them. The list looks more or less like this:</p></div>
1195 <div class="listingblock">
1196 <div class="content">
1197 <pre><tt>pick deadbee The oneline of this commit
1198 pick fa1afe1 The oneline of the next commit
1199 ...</tt></pre>
1200 </div></div>
1201 <div class="paragraph"><p>The oneline descriptions are purely for your pleasure; <em>git rebase</em> will
1202 not look at them but at the commit names ("deadbee" and "fa1afe1" in this
1203 example), so do not delete or edit the names.</p></div>
1204 <div class="paragraph"><p>By replacing the command "pick" with the command "edit", you can tell
1205 <em>git rebase</em> to stop after applying that commit, so that you can edit
1206 the files and/or the commit message, amend the commit, and continue
1207 rebasing.</p></div>
1208 <div class="paragraph"><p>If you just want to edit the commit message for a commit, replace the
1209 command "pick" with the command "reword".</p></div>
1210 <div class="paragraph"><p>If you want to fold two or more commits into one, replace the command
1211 "pick" for the second and subsequent commits with "squash" or "fixup".
1212 If the commits had different authors, the folded commit will be
1213 attributed to the author of the first commit. The suggested commit
1214 message for the folded commit is the concatenation of the commit
1215 messages of the first commit and of those with the "squash" command,
1216 but omits the commit messages of commits with the "fixup" command.</p></div>
1217 <div class="paragraph"><p><em>git rebase</em> will stop when "pick" has been replaced with "edit" or
1218 when a command fails due to merge errors. When you are done editing
1219 and/or resolving conflicts you can continue with <tt>git rebase --continue</tt>.</p></div>
1220 <div class="paragraph"><p>For example, if you want to reorder the last 5 commits, such that what
1221 was HEAD~4 becomes the new HEAD. To achieve that, you would call
1222 <em>git rebase</em> like this:</p></div>
1223 <div class="listingblock">
1224 <div class="content">
1225 <pre><tt>$ git rebase -i HEAD~5</tt></pre>
1226 </div></div>
1227 <div class="paragraph"><p>And move the first patch to the end of the list.</p></div>
1228 <div class="paragraph"><p>You might want to preserve merges, if you have a history like this:</p></div>
1229 <div class="listingblock">
1230 <div class="content">
1231 <pre><tt> X
1233 A---M---B
1235 ---o---O---P---Q</tt></pre>
1236 </div></div>
1237 <div class="paragraph"><p>Suppose you want to rebase the side branch starting at "A" to "Q". Make
1238 sure that the current HEAD is "B", and call</p></div>
1239 <div class="listingblock">
1240 <div class="content">
1241 <pre><tt>$ git rebase -i -p --onto Q O</tt></pre>
1242 </div></div>
1243 <div class="paragraph"><p>Reordering and editing commits usually creates untested intermediate
1244 steps. You may want to check that your history editing did not break
1245 anything by running a test, or at least recompiling at intermediate
1246 points in history by using the "exec" command (shortcut "x"). You may
1247 do so by creating a todo list like this one:</p></div>
1248 <div class="listingblock">
1249 <div class="content">
1250 <pre><tt>pick deadbee Implement feature XXX
1251 fixup f1a5c00 Fix to feature XXX
1252 exec make
1253 pick c0ffeee The oneline of the next commit
1254 edit deadbab The oneline of the commit after
1255 exec cd subdir; make test
1256 ...</tt></pre>
1257 </div></div>
1258 <div class="paragraph"><p>The interactive rebase will stop when a command fails (i.e. exits with
1259 non-0 status) to give you an opportunity to fix the problem. You can
1260 continue with <tt>git rebase --continue</tt>.</p></div>
1261 <div class="paragraph"><p>The "exec" command launches the command in a shell (the one specified
1262 in <tt>$SHELL</tt>, or the default shell if <tt>$SHELL</tt> is not set), so you can
1263 use shell features (like "cd", "&gt;", ";" &#8230;). The command is run from
1264 the root of the working tree.</p></div>
1265 </div>
1266 <h2 id="_splitting_commits">SPLITTING COMMITS</h2>
1267 <div class="sectionbody">
1268 <div class="paragraph"><p>In interactive mode, you can mark commits with the action "edit". However,
1269 this does not necessarily mean that <em>git rebase</em> expects the result of this
1270 edit to be exactly one commit. Indeed, you can undo the commit, or you can
1271 add other commits. This can be used to split a commit into two:</p></div>
1272 <div class="ulist"><ul>
1273 <li>
1275 Start an interactive rebase with <tt>git rebase -i &lt;commit&gt;^</tt>, where
1276 &lt;commit&gt; is the commit you want to split. In fact, any commit range
1277 will do, as long as it contains that commit.
1278 </p>
1279 </li>
1280 <li>
1282 Mark the commit you want to split with the action "edit".
1283 </p>
1284 </li>
1285 <li>
1287 When it comes to editing that commit, execute <tt>git reset HEAD^</tt>. The
1288 effect is that the HEAD is rewound by one, and the index follows suit.
1289 However, the working tree stays the same.
1290 </p>
1291 </li>
1292 <li>
1294 Now add the changes to the index that you want to have in the first
1295 commit. You can use <tt>git add</tt> (possibly interactively) or
1296 <em>git gui</em> (or both) to do that.
1297 </p>
1298 </li>
1299 <li>
1301 Commit the now-current index with whatever commit message is appropriate
1302 now.
1303 </p>
1304 </li>
1305 <li>
1307 Repeat the last two steps until your working tree is clean.
1308 </p>
1309 </li>
1310 <li>
1312 Continue the rebase with <tt>git rebase --continue</tt>.
1313 </p>
1314 </li>
1315 </ul></div>
1316 <div class="paragraph"><p>If you are not absolutely sure that the intermediate revisions are
1317 consistent (they compile, pass the testsuite, etc.) you should use
1318 <em>git stash</em> to stash away the not-yet-committed changes
1319 after each commit, test, and amend the commit if fixes are necessary.</p></div>
1320 </div>
1321 <h2 id="_recovering_from_upstream_rebase">RECOVERING FROM UPSTREAM REBASE</h2>
1322 <div class="sectionbody">
1323 <div class="paragraph"><p>Rebasing (or any other form of rewriting) a branch that others have
1324 based work on is a bad idea: anyone downstream of it is forced to
1325 manually fix their history. This section explains how to do the fix
1326 from the downstream&#8217;s point of view. The real fix, however, would be
1327 to avoid rebasing the upstream in the first place.</p></div>
1328 <div class="paragraph"><p>To illustrate, suppose you are in a situation where someone develops a
1329 <em>subsystem</em> branch, and you are working on a <em>topic</em> that is dependent
1330 on this <em>subsystem</em>. You might end up with a history like the
1331 following:</p></div>
1332 <div class="listingblock">
1333 <div class="content">
1334 <pre><tt> o---o---o---o---o---o---o---o---o master
1336 o---o---o---o---o subsystem
1338 *---*---* topic</tt></pre>
1339 </div></div>
1340 <div class="paragraph"><p>If <em>subsystem</em> is rebased against <em>master</em>, the following happens:</p></div>
1341 <div class="listingblock">
1342 <div class="content">
1343 <pre><tt> o---o---o---o---o---o---o---o master
1345 o---o---o---o---o o'--o'--o'--o'--o' subsystem
1347 *---*---* topic</tt></pre>
1348 </div></div>
1349 <div class="paragraph"><p>If you now continue development as usual, and eventually merge <em>topic</em>
1350 to <em>subsystem</em>, the commits from <em>subsystem</em> will remain duplicated forever:</p></div>
1351 <div class="listingblock">
1352 <div class="content">
1353 <pre><tt> o---o---o---o---o---o---o---o master
1355 o---o---o---o---o o'--o'--o'--o'--o'--M subsystem
1357 *---*---*-..........-*--* topic</tt></pre>
1358 </div></div>
1359 <div class="paragraph"><p>Such duplicates are generally frowned upon because they clutter up
1360 history, making it harder to follow. To clean things up, you need to
1361 transplant the commits on <em>topic</em> to the new <em>subsystem</em> tip, i.e.,
1362 rebase <em>topic</em>. This becomes a ripple effect: anyone downstream from
1363 <em>topic</em> is forced to rebase too, and so on!</p></div>
1364 <div class="paragraph"><p>There are two kinds of fixes, discussed in the following subsections:</p></div>
1365 <div class="dlist"><dl>
1366 <dt class="hdlist1">
1367 Easy case: The changes are literally the same.
1368 </dt>
1369 <dd>
1371 This happens if the <em>subsystem</em> rebase was a simple rebase and
1372 had no conflicts.
1373 </p>
1374 </dd>
1375 <dt class="hdlist1">
1376 Hard case: The changes are not the same.
1377 </dt>
1378 <dd>
1380 This happens if the <em>subsystem</em> rebase had conflicts, or used
1381 <tt>--interactive</tt> to omit, edit, squash, or fixup commits; or
1382 if the upstream used one of <tt>commit --amend</tt>, <tt>reset</tt>, or
1383 <tt>filter-branch</tt>.
1384 </p>
1385 </dd>
1386 </dl></div>
1387 <h3 id="_the_easy_case">The easy case</h3><div style="clear:left"></div>
1388 <div class="paragraph"><p>Only works if the changes (patch IDs based on the diff contents) on
1389 <em>subsystem</em> are literally the same before and after the rebase
1390 <em>subsystem</em> did.</p></div>
1391 <div class="paragraph"><p>In that case, the fix is easy because <em>git rebase</em> knows to skip
1392 changes that are already present in the new upstream. So if you say
1393 (assuming you&#8217;re on <em>topic</em>)</p></div>
1394 <div class="listingblock">
1395 <div class="content">
1396 <pre><tt> $ git rebase subsystem</tt></pre>
1397 </div></div>
1398 <div class="paragraph"><p>you will end up with the fixed history</p></div>
1399 <div class="listingblock">
1400 <div class="content">
1401 <pre><tt> o---o---o---o---o---o---o---o master
1403 o'--o'--o'--o'--o' subsystem
1405 *---*---* topic</tt></pre>
1406 </div></div>
1407 <h3 id="_the_hard_case">The hard case</h3><div style="clear:left"></div>
1408 <div class="paragraph"><p>Things get more complicated if the <em>subsystem</em> changes do not exactly
1409 correspond to the ones before the rebase.</p></div>
1410 <div class="admonitionblock">
1411 <table><tr>
1412 <td class="icon">
1413 <div class="title">Note</div>
1414 </td>
1415 <td class="content">While an "easy case recovery" sometimes appears to be successful
1416 even in the hard case, it may have unintended consequences. For
1417 example, a commit that was removed via <tt>git rebase
1418 --interactive</tt> will be <strong>resurrected</strong>!</td>
1419 </tr></table>
1420 </div>
1421 <div class="paragraph"><p>The idea is to manually tell <em>git rebase</em> "where the old <em>subsystem</em>
1422 ended and your <em>topic</em> began", that is, what the old merge-base
1423 between them was. You will have to find a way to name the last commit
1424 of the old <em>subsystem</em>, for example:</p></div>
1425 <div class="ulist"><ul>
1426 <li>
1428 With the <em>subsystem</em> reflog: after <em>git fetch</em>, the old tip of
1429 <em>subsystem</em> is at <tt>subsystem@{1}</tt>. Subsequent fetches will
1430 increase the number. (See <a href="git-reflog.html">git-reflog(1)</a>.)
1431 </p>
1432 </li>
1433 <li>
1435 Relative to the tip of <em>topic</em>: knowing that your <em>topic</em> has three
1436 commits, the old tip of <em>subsystem</em> must be <tt>topic~3</tt>.
1437 </p>
1438 </li>
1439 </ul></div>
1440 <div class="paragraph"><p>You can then transplant the old <tt>subsystem..topic</tt> to the new tip by
1441 saying (for the reflog case, and assuming you are on <em>topic</em> already):</p></div>
1442 <div class="listingblock">
1443 <div class="content">
1444 <pre><tt> $ git rebase --onto subsystem subsystem@{1}</tt></pre>
1445 </div></div>
1446 <div class="paragraph"><p>The ripple effect of a "hard case" recovery is especially bad:
1447 <em>everyone</em> downstream from <em>topic</em> will now have to perform a "hard
1448 case" recovery too!</p></div>
1449 </div>
1450 <h2 id="_bugs">BUGS</h2>
1451 <div class="sectionbody">
1452 <div class="paragraph"><p>The todo list presented by <tt>--preserve-merges --interactive</tt> does not
1453 represent the topology of the revision graph. Editing commits and
1454 rewording their commit messages should work fine, but attempts to
1455 reorder commits tend to produce counterintuitive results.</p></div>
1456 <div class="paragraph"><p>For example, an attempt to rearrange</p></div>
1457 <div class="listingblock">
1458 <div class="content">
1459 <pre><tt>1 --- 2 --- 3 --- 4 --- 5</tt></pre>
1460 </div></div>
1461 <div class="paragraph"><p>to</p></div>
1462 <div class="listingblock">
1463 <div class="content">
1464 <pre><tt>1 --- 2 --- 4 --- 3 --- 5</tt></pre>
1465 </div></div>
1466 <div class="paragraph"><p>by moving the "pick 4" line will result in the following history:</p></div>
1467 <div class="listingblock">
1468 <div class="content">
1469 <pre><tt> 3
1471 1 --- 2 --- 4 --- 5</tt></pre>
1472 </div></div>
1473 </div>
1474 <h2 id="_authors">Authors</h2>
1475 <div class="sectionbody">
1476 <div class="paragraph"><p>Written by Junio C Hamano &lt;<a href="mailto:gitster@pobox.com">gitster@pobox.com</a>&gt; and
1477 Johannes E. Schindelin &lt;<a href="mailto:johannes.schindelin@gmx.de">johannes.schindelin@gmx.de</a>&gt;</p></div>
1478 </div>
1479 <h2 id="_documentation">Documentation</h2>
1480 <div class="sectionbody">
1481 <div class="paragraph"><p>Documentation by Junio C Hamano and the git-list &lt;<a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>&gt;.</p></div>
1482 </div>
1483 <h2 id="_git">GIT</h2>
1484 <div class="sectionbody">
1485 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1486 </div>
1487 <div id="footer">
1488 <div id="footer-text">
1489 Last updated 2010-12-13 08:31:26 UTC
1490 </div>
1491 </div>
1492 </body>
1493 </html>