@@ -30,7 +30,7 @@ history, and you want to "catch up" to the work done on the `master` branch.
30
30
You want to transplant the commits you made on `topic` since it diverged from
31
31
`master` (i.e. A, B, and C), on top of the current `master` . You can do this
32
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
33
+ want to rebase `topic` while on another branch, `git rebase master topic` is a
34
34
short-cut for `git switch topic && git rebase master` .
35
35
36
36
------------
@@ -68,31 +68,30 @@ linkgit:git-config[1] for details) and the `--fork-point` option is
68
68
assumed. If you are currently not on any branch or if the current
69
69
branch does not have a configured upstream, the rebase will abort.
70
70
71
- All changes made by commits in the current branch but that are not
71
+ Here is a more detailed description of what `git rebase <upstream>` does:
72
+
73
+ First, all changes made by commits in the current branch but that are not
72
74
in `<upstream>` are saved to a temporary area. This is the same set
73
75
of commits that would be shown by `git log <upstream>..HEAD` ; or by
74
76
`git log 'fork_point'..HEAD` , if `--fork-point` is active (see the
75
77
description on `--fork-point` below); or by `git log HEAD` , if the
76
78
`--root` option is specified.
77
79
78
- The current branch is reset to `<upstream>` or `<newbase>` if the
80
+ Then the current branch is reset to `<upstream>` or `<newbase>` if the
79
81
`--onto` option was supplied. This has the exact same effect as
80
82
`git reset --hard <upstream>` (or `<newbase>` ). `ORIG_HEAD` is set
81
83
to point at the tip of the branch before the reset.
82
84
85
+ Then the commits that were previously saved into the temporary area are
86
+ reapplied to the current branch, one by one, in order.
87
+
83
88
[NOTE]
84
89
`ORIG_HEAD` is not guaranteed to still point to the previous branch tip
85
90
at the end of the rebase if other commands that write that pseudo-ref
86
91
(e.g. `git reset` ) are used during the rebase. The previous branch tip,
87
92
however, is accessible using the reflog of the current branch
88
93
(i.e. `@{1}` , see linkgit:gitrevisions[7]).
89
94
90
- The commits that were previously saved into the temporary area are
91
- then reapplied to the current branch, one by one, in order. Note that
92
- any commits in `HEAD` which introduce the same textual changes as a commit
93
- in `HEAD..<upstream>` are omitted (i.e., a patch already accepted upstream
94
- with a different commit message or timestamp will be skipped).
95
-
96
95
If the upstream branch already contains a change you have made (e.g.,
97
96
because you mailed a patch which was applied upstream), then that commit
98
97
will be skipped and warnings will be issued (if the 'merge' backend is
0 commit comments