1GIT-REBASE(1)                     Git Manual                     GIT-REBASE(1)
2
3
4

NAME

6       git-rebase - Forward-port local commits to the updated upstream head
7

SYNOPSIS

9       git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
10               [<upstream>] [<branch>]
11       git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
12               --root [<branch>]
13       git rebase --continue | --skip | --abort | --edit-todo
14
15

DESCRIPTION

17       If <branch> is specified, git rebase will perform an automatic git
18       checkout <branch> before doing anything else. Otherwise it remains on
19       the current branch.
20
21       If <upstream> is not specified, the upstream configured in
22       branch.<name>.remote and branch.<name>.merge options will be used; see
23       git-config(1) for details. If you are currently not on any branch or if
24       the current branch does not have a configured upstream, the rebase will
25       abort.
26
27       All changes made by commits in the current branch but that are not in
28       <upstream> are saved to a temporary area. This is the same set of
29       commits that would be shown by git log <upstream>..HEAD (or git log
30       HEAD, if --root is specified).
31
32       The current branch is reset to <upstream>, or <newbase> if the --onto
33       option was supplied. This has the exact same effect as git reset --hard
34       <upstream> (or <newbase>). ORIG_HEAD is set to point at the tip of the
35       branch before the reset.
36
37       The commits that were previously saved into the temporary area are then
38       reapplied to the current branch, one by one, in order. Note that any
39       commits in HEAD which introduce the same textual changes as a commit in
40       HEAD..<upstream> are omitted (i.e., a patch already accepted upstream
41       with a different commit message or timestamp will be skipped).
42
43       It is possible that a merge failure will prevent this process from
44       being completely automatic. You will have to resolve any such merge
45       failure and run git rebase --continue. Another option is to bypass the
46       commit that caused the merge failure with git rebase --skip. To check
47       out the original <branch> and remove the .git/rebase-apply working
48       files, use the command git rebase --abort instead.
49
50       Assume the following history exists and the current branch is "topic":
51
52                     A---B---C topic
53                    /
54               D---E---F---G master
55
56
57       From this point, the result of either of the following commands:
58
59           git rebase master
60           git rebase master topic
61
62       would be:
63
64                             A'--B'--C' topic
65                            /
66               D---E---F---G master
67
68
69       NOTE: The latter form is just a short-hand of git checkout topic
70       followed by git rebase master. When rebase exits topic will remain the
71       checked-out branch.
72
73       If the upstream branch already contains a change you have made (e.g.,
74       because you mailed a patch which was applied upstream), then that
75       commit will be skipped. For example, running ‘git rebase master` on the
76       following history (in which A’ and A introduce the same set of changes,
77       but have different committer information):
78
79                     A---B---C topic
80                    /
81               D---E---A'---F master
82
83
84       will result in:
85
86                              B'---C' topic
87                             /
88               D---E---A'---F master
89
90
91       Here is how you would transplant a topic branch based on one branch to
92       another, to pretend that you forked the topic branch from the latter
93       branch, using rebase --onto.
94
95       First let’s assume your topic is based on branch next. For example, a
96       feature developed in topic depends on some functionality which is found
97       in next.
98
99               o---o---o---o---o  master
100                    \
101                     o---o---o---o---o  next
102                                      \
103                                       o---o---o  topic
104
105
106       We want to make topic forked from branch master; for example, because
107       the functionality on which topic depends was merged into the more
108       stable master branch. We want our tree to look like this:
109
110               o---o---o---o---o  master
111                   |            \
112                   |             o'--o'--o'  topic
113                    \
114                     o---o---o---o---o  next
115
116
117       We can get this using the following command:
118
119           git rebase --onto master next topic
120
121       Another example of --onto option is to rebase part of a branch. If we
122       have the following situation:
123
124                                       H---I---J topicB
125                                      /
126                             E---F---G  topicA
127                            /
128               A---B---C---D  master
129
130
131       then the command
132
133           git rebase --onto master topicA topicB
134
135       would result in:
136
137                            H'--I'--J'  topicB
138                           /
139                           | E---F---G  topicA
140                           |/
141               A---B---C---D  master
142
143
144       This is useful when topicB does not depend on topicA.
145
146       A range of commits could also be removed with rebase. If we have the
147       following situation:
148
149               E---F---G---H---I---J  topicA
150
151
152       then the command
153
154           git rebase --onto topicA~5 topicA~3 topicA
155
156       would result in the removal of commits F and G:
157
158               E---H'---I'---J'  topicA
159
160
161       This is useful if F and G were flawed in some way, or should not be
162       part of topicA. Note that the argument to --onto and the <upstream>
163       parameter can be any valid commit-ish.
164
165       In case of conflict, git rebase will stop at the first problematic
166       commit and leave conflict markers in the tree. You can use git diff to
167       locate the markers (<<<<<<) and make edits to resolve the conflict. For
168       each file you edit, you need to tell Git that the conflict has been
169       resolved, typically this would be done with
170
171           git add <filename>
172
173       After resolving the conflict manually and updating the index with the
174       desired resolution, you can continue the rebasing process with
175
176           git rebase --continue
177
178       Alternatively, you can undo the git rebase with
179
180           git rebase --abort
181

CONFIGURATION

183       rebase.stat
184           Whether to show a diffstat of what changed upstream since the last
185           rebase. False by default.
186
187       rebase.autosquash
188           If set to true enable --autosquash option by default.
189

OPTIONS

191       --onto <newbase>
192           Starting point at which to create the new commits. If the --onto
193           option is not specified, the starting point is <upstream>. May be
194           any valid commit, and not just an existing branch name.
195
196           As a special case, you may use "A...B" as a shortcut for the merge
197           base of A and B if there is exactly one merge base. You can leave
198           out at most one of A and B, in which case it defaults to HEAD.
199
200       <upstream>
201           Upstream branch to compare against. May be any valid commit, not
202           just an existing branch name. Defaults to the configured upstream
203           for the current branch.
204
205       <branch>
206           Working branch; defaults to HEAD.
207
208       --continue
209           Restart the rebasing process after having resolved a merge
210           conflict.
211
212       --abort
213           Abort the rebase operation and reset HEAD to the original branch.
214           If <branch> was provided when the rebase operation was started,
215           then HEAD will be reset to <branch>. Otherwise HEAD will be reset
216           to where it was when the rebase operation was started.
217
218       --keep-empty
219           Keep the commits that do not change anything from its parents in
220           the result.
221
222       --skip
223           Restart the rebasing process by skipping the current patch.
224
225       --edit-todo
226           Edit the todo list during an interactive rebase.
227
228       -m, --merge
229           Use merging strategies to rebase. When the recursive (default)
230           merge strategy is used, this allows rebase to be aware of renames
231           on the upstream side.
232
233           Note that a rebase merge works by replaying each commit from the
234           working branch on top of the <upstream> branch. Because of this,
235           when a merge conflict happens, the side reported as ours is the
236           so-far rebased series, starting with <upstream>, and theirs is the
237           working branch. In other words, the sides are swapped.
238
239       -s <strategy>, --strategy=<strategy>
240           Use the given merge strategy. If there is no -s option git
241           merge-recursive is used instead. This implies --merge.
242
243           Because git rebase replays each commit from the working branch on
244           top of the <upstream> branch using the given strategy, using the
245           ours strategy simply discards all patches from the <branch>, which
246           makes little sense.
247
248       -X <strategy-option>, --strategy-option=<strategy-option>
249           Pass the <strategy-option> through to the merge strategy. This
250           implies --merge and, if no strategy has been specified, -s
251           recursive. Note the reversal of ours and theirs as noted above for
252           the -m option.
253
254       -q, --quiet
255           Be quiet. Implies --no-stat.
256
257       -v, --verbose
258           Be verbose. Implies --stat.
259
260       --stat
261           Show a diffstat of what changed upstream since the last rebase. The
262           diffstat is also controlled by the configuration option
263           rebase.stat.
264
265       -n, --no-stat
266           Do not show a diffstat as part of the rebase process.
267
268       --no-verify
269           This option bypasses the pre-rebase hook. See also githooks(5).
270
271       --verify
272           Allows the pre-rebase hook to run, which is the default. This
273           option can be used to override --no-verify. See also githooks(5).
274
275       -C<n>
276           Ensure at least <n> lines of surrounding context match before and
277           after each change. When fewer lines of surrounding context exist
278           they all must match. By default no context is ever ignored.
279
280       -f, --force-rebase
281           Force the rebase even if the current branch is a descendant of the
282           commit you are rebasing onto. Normally non-interactive rebase will
283           exit with the message "Current branch is up to date" in such a
284           situation. Incompatible with the --interactive option.
285
286           You may find this (or --no-ff with an interactive rebase) helpful
287           after reverting a topic branch merge, as this option recreates the
288           topic branch with fresh commits so it can be remerged successfully
289           without needing to "revert the reversion" (see the
290           revert-a-faulty-merge How-To[1] for details).
291
292       --ignore-whitespace, --whitespace=<option>
293           These flag are passed to the git apply program (see git-apply(1))
294           that applies the patch. Incompatible with the --interactive option.
295
296       --committer-date-is-author-date, --ignore-date
297           These flags are passed to git am to easily change the dates of the
298           rebased commits (see git-am(1)). Incompatible with the
299           --interactive option.
300
301       -i, --interactive
302           Make a list of the commits which are about to be rebased. Let the
303           user edit that list before rebasing. This mode can also be used to
304           split commits (see SPLITTING COMMITS below).
305
306       -p, --preserve-merges
307           Instead of ignoring merges, try to recreate them.
308
309           This uses the --interactive machinery internally, but combining it
310           with the --interactive option explicitly is generally not a good
311           idea unless you know what you are doing (see BUGS below).
312
313       -x <cmd>, --exec <cmd>
314           Append "exec <cmd>" after each line creating a commit in the final
315           history. <cmd> will be interpreted as one or more shell commands.
316
317           This option can only be used with the --interactive option (see
318           INTERACTIVE MODE below).
319
320           You may execute several commands by either using one instance of
321           --exec with several commands:
322
323               git rebase -i --exec "cmd1 && cmd2 && ..."
324
325           or by giving more than one --exec:
326
327               git rebase -i --exec "cmd1" --exec "cmd2" --exec ...
328
329           If --autosquash is used, "exec" lines will not be appended for the
330           intermediate commits, and will only appear at the end of each
331           squash/fixup series.
332
333       --root
334           Rebase all commits reachable from <branch>, instead of limiting
335           them with an <upstream>. This allows you to rebase the root
336           commit(s) on a branch. When used with --onto, it will skip changes
337           already contained in <newbase> (instead of <upstream>) whereas
338           without --onto it will operate on every change. When used together
339           with both --onto and --preserve-merges, all root commits will be
340           rewritten to have <newbase> as parent instead.
341
342       --autosquash, --no-autosquash
343           When the commit log message begins with "squash! ..." (or "fixup!
344           ..."), and there is a commit whose title begins with the same ...,
345           automatically modify the todo list of rebase -i so that the commit
346           marked for squashing comes right after the commit to be modified,
347           and change the action of the moved commit from pick to squash (or
348           fixup).
349
350           This option is only valid when the --interactive option is used.
351
352           If the --autosquash option is enabled by default using the
353           configuration variable rebase.autosquash, this option can be used
354           to override and disable this setting.
355
356       --no-ff
357           With --interactive, cherry-pick all rebased commits instead of
358           fast-forwarding over the unchanged ones. This ensures that the
359           entire history of the rebased branch is composed of new commits.
360
361           Without --interactive, this is a synonym for --force-rebase.
362
363           You may find this helpful after reverting a topic branch merge, as
364           this option recreates the topic branch with fresh commits so it can
365           be remerged successfully without needing to "revert the reversion"
366           (see the revert-a-faulty-merge How-To[1] for details).
367

MERGE STRATEGIES

369       The merge mechanism (git-merge and git-pull commands) allows the
370       backend merge strategies to be chosen with -s option. Some strategies
371       can also take their own options, which can be passed by giving
372       -X<option> arguments to git-merge and/or git-pull.
373
374       resolve
375           This can only resolve two heads (i.e. the current branch and
376           another branch you pulled from) using a 3-way merge algorithm. It
377           tries to carefully detect criss-cross merge ambiguities and is
378           considered generally safe and fast.
379
380       recursive
381           This can only resolve two heads using a 3-way merge algorithm. When
382           there is more than one common ancestor that can be used for 3-way
383           merge, it creates a merged tree of the common ancestors and uses
384           that as the reference tree for the 3-way merge. This has been
385           reported to result in fewer merge conflicts without causing
386           mis-merges by tests done on actual merge commits taken from Linux
387           2.6 kernel development history. Additionally this can detect and
388           handle merges involving renames. This is the default merge strategy
389           when pulling or merging one branch.
390
391           The recursive strategy can take the following options:
392
393           ours
394               This option forces conflicting hunks to be auto-resolved
395               cleanly by favoring our version. Changes from the other tree
396               that do not conflict with our side are reflected to the merge
397               result. For a binary file, the entire contents are taken from
398               our side.
399
400               This should not be confused with the ours merge strategy, which
401               does not even look at what the other tree contains at all. It
402               discards everything the other tree did, declaring our history
403               contains all that happened in it.
404
405           theirs
406               This is the opposite of ours.
407
408           patience
409               With this option, merge-recursive spends a little extra time to
410               avoid mismerges that sometimes occur due to unimportant
411               matching lines (e.g., braces from distinct functions). Use this
412               when the branches to be merged have diverged wildly. See also
413               git-diff(1)--patience.
414
415           diff-algorithm=[patience|minimal|histogram|myers]
416               Tells merge-recursive to use a different diff algorithm, which
417               can help avoid mismerges that occur due to unimportant matching
418               lines (such as braces from distinct functions). See also git-
419               diff(1)--diff-algorithm.
420
421           ignore-space-change, ignore-all-space, ignore-space-at-eol
422               Treats lines with the indicated type of whitespace change as
423               unchanged for the sake of a three-way merge. Whitespace changes
424               mixed with other changes to a line are not ignored. See also
425               git-diff(1)-b, -w, and --ignore-space-at-eol.
426
427               ·   If their version only introduces whitespace changes to a
428                   line, our version is used;
429
430               ·   If our version introduces whitespace changes but their
431                   version includes a substantial change, their version is
432                   used;
433
434               ·   Otherwise, the merge proceeds in the usual way.
435
436           renormalize
437               This runs a virtual check-out and check-in of all three stages
438               of a file when resolving a three-way merge. This option is
439               meant to be used when merging branches with different clean
440               filters or end-of-line normalization rules. See "Merging
441               branches with differing checkin/checkout attributes" in
442               gitattributes(5) for details.
443
444           no-renormalize
445               Disables the renormalize option. This overrides the
446               merge.renormalize configuration variable.
447
448           rename-threshold=<n>
449               Controls the similarity threshold used for rename detection.
450               See also git-diff(1)-M.
451
452           subtree[=<path>]
453               This option is a more advanced form of subtree strategy, where
454               the strategy makes a guess on how two trees must be shifted to
455               match with each other when merging. Instead, the specified path
456               is prefixed (or stripped from the beginning) to make the shape
457               of two trees to match.
458
459       octopus
460           This resolves cases with more than two heads, but refuses to do a
461           complex merge that needs manual resolution. It is primarily meant
462           to be used for bundling topic branch heads together. This is the
463           default merge strategy when pulling or merging more than one
464           branch.
465
466       ours
467           This resolves any number of heads, but the resulting tree of the
468           merge is always that of the current branch head, effectively
469           ignoring all changes from all other branches. It is meant to be
470           used to supersede old development history of side branches. Note
471           that this is different from the -Xours option to the recursive
472           merge strategy.
473
474       subtree
475           This is a modified recursive strategy. When merging trees A and B,
476           if B corresponds to a subtree of A, B is first adjusted to match
477           the tree structure of A, instead of reading the trees at the same
478           level. This adjustment is also done to the common ancestor tree.
479

NOTES

481       You should understand the implications of using git rebase on a
482       repository that you share. See also RECOVERING FROM UPSTREAM REBASE
483       below.
484
485       When the git-rebase command is run, it will first execute a
486       "pre-rebase" hook if one exists. You can use this hook to do sanity
487       checks and reject the rebase if it isn’t appropriate. Please see the
488       template pre-rebase hook script for an example.
489
490       Upon completion, <branch> will be the current branch.
491

INTERACTIVE MODE

493       Rebasing interactively means that you have a chance to edit the commits
494       which are rebased. You can reorder the commits, and you can remove them
495       (weeding out bad or otherwise unwanted patches).
496
497       The interactive mode is meant for this type of workflow:
498
499        1. have a wonderful idea
500
501        2. hack on the code
502
503        3. prepare a series for submission
504
505        4. submit
506
507       where point 2. consists of several instances of
508
509       a) regular use
510
511        1. finish something worthy of a commit
512
513        2. commit
514
515       b) independent fixup
516
517        1. realize that something does not work
518
519        2. fix that
520
521        3. commit it
522
523       Sometimes the thing fixed in b.2. cannot be amended to the not-quite
524       perfect commit it fixes, because that commit is buried deeply in a
525       patch series. That is exactly what interactive rebase is for: use it
526       after plenty of "a"s and "b"s, by rearranging and editing commits, and
527       squashing multiple commits into one.
528
529       Start it with the last commit you want to retain as-is:
530
531           git rebase -i <after-this-commit>
532
533       An editor will be fired up with all the commits in your current branch
534       (ignoring merge commits), which come after the given commit. You can
535       reorder the commits in this list to your heart’s content, and you can
536       remove them. The list looks more or less like this:
537
538           pick deadbee The oneline of this commit
539           pick fa1afe1 The oneline of the next commit
540           ...
541
542
543       The oneline descriptions are purely for your pleasure; git rebase will
544       not look at them but at the commit names ("deadbee" and "fa1afe1" in
545       this example), so do not delete or edit the names.
546
547       By replacing the command "pick" with the command "edit", you can tell
548       git rebase to stop after applying that commit, so that you can edit the
549       files and/or the commit message, amend the commit, and continue
550       rebasing.
551
552       If you just want to edit the commit message for a commit, replace the
553       command "pick" with the command "reword".
554
555       If you want to fold two or more commits into one, replace the command
556       "pick" for the second and subsequent commits with "squash" or "fixup".
557       If the commits had different authors, the folded commit will be
558       attributed to the author of the first commit. The suggested commit
559       message for the folded commit is the concatenation of the commit
560       messages of the first commit and of those with the "squash" command,
561       but omits the commit messages of commits with the "fixup" command.
562
563       git rebase will stop when "pick" has been replaced with "edit" or when
564       a command fails due to merge errors. When you are done editing and/or
565       resolving conflicts you can continue with git rebase --continue.
566
567       For example, if you want to reorder the last 5 commits, such that what
568       was HEAD~4 becomes the new HEAD. To achieve that, you would call git
569       rebase like this:
570
571           $ git rebase -i HEAD~5
572
573
574       And move the first patch to the end of the list.
575
576       You might want to preserve merges, if you have a history like this:
577
578                      X
579                       \
580                    A---M---B
581                   /
582           ---o---O---P---Q
583
584
585       Suppose you want to rebase the side branch starting at "A" to "Q". Make
586       sure that the current HEAD is "B", and call
587
588           $ git rebase -i -p --onto Q O
589
590
591       Reordering and editing commits usually creates untested intermediate
592       steps. You may want to check that your history editing did not break
593       anything by running a test, or at least recompiling at intermediate
594       points in history by using the "exec" command (shortcut "x"). You may
595       do so by creating a todo list like this one:
596
597           pick deadbee Implement feature XXX
598           fixup f1a5c00 Fix to feature XXX
599           exec make
600           pick c0ffeee The oneline of the next commit
601           edit deadbab The oneline of the commit after
602           exec cd subdir; make test
603           ...
604
605
606       The interactive rebase will stop when a command fails (i.e. exits with
607       non-0 status) to give you an opportunity to fix the problem. You can
608       continue with git rebase --continue.
609
610       The "exec" command launches the command in a shell (the one specified
611       in $SHELL, or the default shell if $SHELL is not set), so you can use
612       shell features (like "cd", ">", ";" ...). The command is run from the
613       root of the working tree.
614
615           $ git rebase -i --exec "make test"
616
617
618       This command lets you check that intermediate commits are compilable.
619       The todo list becomes like that:
620
621           pick 5928aea one
622           exec make test
623           pick 04d0fda two
624           exec make test
625           pick ba46169 three
626           exec make test
627           pick f4593f9 four
628           exec make test
629
630

SPLITTING COMMITS

632       In interactive mode, you can mark commits with the action "edit".
633       However, this does not necessarily mean that git rebase expects the
634       result of this edit to be exactly one commit. Indeed, you can undo the
635       commit, or you can add other commits. This can be used to split a
636       commit into two:
637
638       ·   Start an interactive rebase with git rebase -i <commit>^, where
639           <commit> is the commit you want to split. In fact, any commit range
640           will do, as long as it contains that commit.
641
642       ·   Mark the commit you want to split with the action "edit".
643
644       ·   When it comes to editing that commit, execute git reset HEAD^. The
645           effect is that the HEAD is rewound by one, and the index follows
646           suit. However, the working tree stays the same.
647
648       ·   Now add the changes to the index that you want to have in the first
649           commit. You can use git add (possibly interactively) or git gui (or
650           both) to do that.
651
652       ·   Commit the now-current index with whatever commit message is
653           appropriate now.
654
655       ·   Repeat the last two steps until your working tree is clean.
656
657       ·   Continue the rebase with git rebase --continue.
658
659       If you are not absolutely sure that the intermediate revisions are
660       consistent (they compile, pass the testsuite, etc.) you should use git
661       stash to stash away the not-yet-committed changes after each commit,
662       test, and amend the commit if fixes are necessary.
663

RECOVERING FROM UPSTREAM REBASE

665       Rebasing (or any other form of rewriting) a branch that others have
666       based work on is a bad idea: anyone downstream of it is forced to
667       manually fix their history. This section explains how to do the fix
668       from the downstream’s point of view. The real fix, however, would be to
669       avoid rebasing the upstream in the first place.
670
671       To illustrate, suppose you are in a situation where someone develops a
672       subsystem branch, and you are working on a topic that is dependent on
673       this subsystem. You might end up with a history like the following:
674
675               o---o---o---o---o---o---o---o---o  master
676                    \
677                     o---o---o---o---o  subsystem
678                                      \
679                                       *---*---*  topic
680
681
682       If subsystem is rebased against master, the following happens:
683
684               o---o---o---o---o---o---o---o  master
685                    \                       \
686                     o---o---o---o---o       o'--o'--o'--o'--o'  subsystem
687                                      \
688                                       *---*---*  topic
689
690
691       If you now continue development as usual, and eventually merge topic to
692       subsystem, the commits from subsystem will remain duplicated forever:
693
694               o---o---o---o---o---o---o---o  master
695                    \                       \
696                     o---o---o---o---o       o'--o'--o'--o'--o'--M  subsystem
697                                      \                         /
698                                       *---*---*-..........-*--*  topic
699
700
701       Such duplicates are generally frowned upon because they clutter up
702       history, making it harder to follow. To clean things up, you need to
703       transplant the commits on topic to the new subsystem tip, i.e., rebase
704       topic. This becomes a ripple effect: anyone downstream from topic is
705       forced to rebase too, and so on!
706
707       There are two kinds of fixes, discussed in the following subsections:
708
709       Easy case: The changes are literally the same.
710           This happens if the subsystem rebase was a simple rebase and had no
711           conflicts.
712
713       Hard case: The changes are not the same.
714           This happens if the subsystem rebase had conflicts, or used
715           --interactive to omit, edit, squash, or fixup commits; or if the
716           upstream used one of commit --amend, reset, or filter-branch.
717
718   The easy case
719       Only works if the changes (patch IDs based on the diff contents) on
720       subsystem are literally the same before and after the rebase subsystem
721       did.
722
723       In that case, the fix is easy because git rebase knows to skip changes
724       that are already present in the new upstream. So if you say (assuming
725       you’re on topic)
726
727               $ git rebase subsystem
728
729
730       you will end up with the fixed history
731
732               o---o---o---o---o---o---o---o  master
733                                            \
734                                             o'--o'--o'--o'--o'  subsystem
735                                                              \
736                                                               *---*---*  topic
737
738
739   The hard case
740       Things get more complicated if the subsystem changes do not exactly
741       correspond to the ones before the rebase.
742
743           Note
744           While an "easy case recovery" sometimes appears to be successful
745           even in the hard case, it may have unintended consequences. For
746           example, a commit that was removed via git rebase --interactive
747           will be resurrected!
748
749       The idea is to manually tell git rebase "where the old subsystem ended
750       and your topic began", that is, what the old merge-base between them
751       was. You will have to find a way to name the last commit of the old
752       subsystem, for example:
753
754       ·   With the subsystem reflog: after git fetch, the old tip of
755           subsystem is at subsystem@{1}. Subsequent fetches will increase the
756           number. (See git-reflog(1).)
757
758       ·   Relative to the tip of topic: knowing that your topic has three
759           commits, the old tip of subsystem must be topic~3.
760
761       You can then transplant the old subsystem..topic to the new tip by
762       saying (for the reflog case, and assuming you are on topic already):
763
764               $ git rebase --onto subsystem subsystem@{1}
765
766
767       The ripple effect of a "hard case" recovery is especially bad: everyone
768       downstream from topic will now have to perform a "hard case" recovery
769       too!
770

BUGS

772       The todo list presented by --preserve-merges --interactive does not
773       represent the topology of the revision graph. Editing commits and
774       rewording their commit messages should work fine, but attempts to
775       reorder commits tend to produce counterintuitive results.
776
777       For example, an attempt to rearrange
778
779           1 --- 2 --- 3 --- 4 --- 5
780
781
782       to
783
784           1 --- 2 --- 4 --- 3 --- 5
785
786
787       by moving the "pick 4" line will result in the following history:
788
789                   3
790                  /
791           1 --- 2 --- 4 --- 5
792
793

GIT

795       Part of the git(1) suite
796

NOTES

798        1. revert-a-faulty-merge How-To
799           file:///usr/share/doc/git-1.8.3.1/howto/revert-a-faulty-merge.txt
800
801
802
803Git 1.8.3.1                       11/19/2018                     GIT-REBASE(1)
Impressum