@@ -16,6 +16,32 @@ SYNOPSIS
16
16
17
17
DESCRIPTION
18
18
-----------
19
+ Transplant a series of commits onto a different starting point.
20
+ You can also use `git rebase` to reorder or combine commits: see INTERACTIVE
21
+ MODE below for how to do that.
22
+
23
+ For example, imagine that you have been working on the `topic` branch in this
24
+ history, and you want to "catch up" to the work done on the `master` branch.
25
+
26
+ ------------
27
+ A---B---C topic
28
+ /
29
+ D---E---F---G master
30
+ ------------
31
+
32
+ You want to transplant the commits you made on `topic` since it diverged from
33
+ `master` (i.e. A, B, and C), on top of the current `master` . You can do this
34
+ by running `git rebase master` while the `topic` branch is checked out. If you
35
+ want to rebase `topic` while on another branch, `git rebase master topic` is a
36
+ shortcut for `git checkout topic && git rebase master` .
37
+
38
+ ------------
39
+ A'--B'--C' topic
40
+ /
41
+ D---E---F---G master
42
+ ------------
43
+
44
+
19
45
If `<branch>` is specified, `git rebase` will perform an automatic
20
46
`git switch <branch>` before doing anything else. Otherwise
21
47
it remains on the current branch.
@@ -58,32 +84,6 @@ that caused the merge failure with `git rebase --skip`. To check out the
58
84
original `<branch>` and remove the `.git/rebase-apply` working files, use
59
85
the command `git rebase --abort` instead.
60
86
61
- Assume the following history exists and the current branch is "topic":
62
-
63
- ------------
64
- A---B---C topic
65
- /
66
- D---E---F---G master
67
- ------------
68
-
69
- From this point, the result of either of the following commands:
70
-
71
-
72
- git rebase master
73
- git rebase master topic
74
-
75
- would be:
76
-
77
- ------------
78
- A'--B'--C' topic
79
- /
80
- D---E---F---G master
81
- ------------
82
-
83
- *NOTE:* The latter form is just a short-hand of `git checkout topic`
84
- followed by `git rebase master`. When rebase exits `topic` will
85
- remain the checked-out branch.
86
-
87
87
If the upstream branch already contains a change you have made (e.g.,
88
88
because you mailed a patch which was applied upstream), then that commit
89
89
will be skipped and warnings will be issued (if the 'merge' backend is
0 commit comments