@@ -16,6 +16,29 @@ SYNOPSIS
16
16
17
17
DESCRIPTION
18
18
-----------
19
+ Transplant a series of commits onto a different starting point.
20
+
21
+ For example, imagine that you have been working on the `topic` branch in this
22
+ history, and you want to "catch up" to the work done on the `master` branch.
23
+
24
+ ------------
25
+ A---B---C topic
26
+ /
27
+ D---E---F---G master
28
+ ------------
29
+
30
+ You want to transplant the commits you made on `topic` since it diverged from
31
+ `master` (i.e. A, B, and C), on top of the current `master` . You can do this
32
+ by running `git rebase master` while the `topic` branch is checked out. If you
33
+ want to rebase `topic` while on a different branch, `git rebase master topic` is a
34
+ short-cut for `git switch topic && git rebase master` .
35
+
36
+ ------------
37
+ A'--B'--C' topic
38
+ /
39
+ D---E---F---G master
40
+ ------------
41
+
19
42
If `<branch>` is specified, `git rebase` will perform an automatic
20
43
`git switch <branch>` before doing anything else. Otherwise
21
44
it remains on the current branch.
@@ -58,32 +81,6 @@ that caused the merge failure with `git rebase --skip`. To check out the
58
81
original `<branch>` and remove the `.git/rebase-apply` working files, use
59
82
the command `git rebase --abort` instead.
60
83
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
84
If the upstream branch already contains a change you have made (e.g.,
88
85
because you mailed a patch which was applied upstream), then that commit
89
86
will be skipped and warnings will be issued (if the 'merge' backend is
0 commit comments