@@ -65,31 +65,31 @@ linkgit:git-config[1] for details) and the `--fork-point` option is
65
65
assumed. If you are currently not on any branch or if the current
66
66
branch does not have a configured upstream, the rebase will abort.
67
67
68
- All changes made by commits in the current branch but that are not
69
- in `<upstream>` are saved to a temporary area. This is the same set
70
- of commits that would be shown by `git log <upstream>..HEAD` ; or by
71
- `git log 'fork_point'..HEAD` , if `--fork-point` is active (see the
72
- description on `--fork-point` below); or by `git log HEAD` , if the
73
- `--root` option is specified.
74
-
75
- The current branch is reset to `<upstream>` or `<newbase>` if the
76
- `--onto` option was supplied. This has the exact same effect as
77
- `git reset --hard <upstream>` (or `<newbase>` ). `ORIG_HEAD` is set
78
- to point at the tip of the branch before the reset.
68
+ Here is a more detailed description of what `git rebase <upstream>` does:
69
+
70
+ First, it makes a list of all commits in the current branch that are not in
71
+ `<upstream>` . This is the same set of commits that would be shown by `git log
72
+ <upstream >..HEAD`. You can use ` -- fork-point` or ` -- root` to change how this
73
+ list of commits is constructed.
74
+
75
+ Then it checks out `<upstream>` (or `<newbase>` if the `--onto` option was
76
+ supplied) with the equivalent of `git switch --detach <upstream>` .
77
+
78
+ Then the commits are replayed, one by one, in order. This is similar to running
79
+ `git cherry-pick <commit>` for each commit. See REBASING MERGES for how merges
80
+ are handled.
81
+
82
+ Finally, the `<upstream>` branch is updated to point to the final commit with
83
+ the equivalent of `git switch -C <upstream>` .
79
84
80
85
[NOTE]
86
+ `ORIG_HEAD` is set to point at the tip of the branch before the rebase.
81
87
`ORIG_HEAD` is not guaranteed to still point to the previous branch tip
82
88
at the end of the rebase if other commands that write that pseudo-ref
83
89
(e.g. `git reset` ) are used during the rebase. The previous branch tip,
84
90
however, is accessible using the reflog of the current branch
85
91
(i.e. `@{1}` , see linkgit:gitrevisions[7]).
86
92
87
- The commits that were previously saved into the temporary area are
88
- then reapplied to the current branch, one by one, in order. Note that
89
- any commits in `HEAD` which introduce the same textual changes as a commit
90
- in `HEAD..<upstream>` are omitted (i.e., a patch already accepted upstream
91
- with a different commit message or timestamp will be skipped).
92
-
93
93
If the upstream branch already contains a change you have made (e.g.,
94
94
because you mailed a patch which was applied upstream), then that commit
95
95
will be skipped and warnings will be issued (if the 'merge' backend is
0 commit comments