@@ -218,12 +218,14 @@ leave out at most one of A and B, in which case it defaults to HEAD.
218
218
merge base of `<upstream>` and `<branch>`. Running
219
219
`git rebase --keep-base <upstream> <branch>` is equivalent to
220
220
running
221
- `git rebase --onto <upstream>...<branch> <upstream> <branch>`.
221
+ `git rebase --reapply-cherry-picks --no-fork-point -- onto <upstream>...<branch> <upstream> <branch>`.
222
222
+
223
223
This option is useful in the case where one is developing a feature on
224
224
top of an upstream branch. While the feature is being worked on, the
225
225
upstream branch may advance and it may not be the best idea to keep
226
- rebasing on top of the upstream but to keep the base commit as-is.
226
+ rebasing on top of the upstream but to keep the base commit as-is. As
227
+ the base commit is unchanged this option implies `--reapply-cherry-picks`
228
+ to avoid losing commits.
227
229
+
228
230
Although both this option and `--fork-point` find the merge base between
229
231
`<upstream>` and `<branch>`, this option uses the merge base as the _starting
@@ -278,7 +280,8 @@ See also INCOMPATIBLE OPTIONS below.
278
280
Note that commits which start empty are kept (unless `--no-keep-empty`
279
281
is specified), and commits which are clean cherry-picks (as determined
280
282
by `git log --cherry-mark ...`) are detected and dropped as a
281
- preliminary step (unless `--reapply-cherry-picks` is passed).
283
+ preliminary step (unless `--reapply-cherry-picks` or `--keep-base` is
284
+ passed).
282
285
+
283
286
See also INCOMPATIBLE OPTIONS below.
284
287
@@ -311,13 +314,16 @@ See also INCOMPATIBLE OPTIONS below.
311
314
upstream changes, the behavior towards them is controlled by
312
315
the `--empty` flag.)
313
316
+
314
- By default (or if `--no-reapply-cherry-picks` is given), these commits
315
- will be automatically dropped. Because this necessitates reading all
316
- upstream commits, this can be expensive in repos with a large number
317
- of upstream commits that need to be read. When using the 'merge'
318
- backend, warnings will be issued for each dropped commit (unless
319
- `--quiet` is given). Advice will also be issued unless
320
- `advice.skippedCherryPicks` is set to false (see linkgit:git-config[1]).
317
+
318
+ In the absence of `--keep-base` (or if `--no-reapply-cherry-picks` is
319
+ given), these commits will be automatically dropped. Because this
320
+ necessitates reading all upstream commits, this can be expensive in
321
+ repositories with a large number of upstream commits that need to be
322
+ read. When using the 'merge' backend, warnings will be issued for each
323
+ dropped commit (unless `--quiet` is given). Advice will also be issued
324
+ unless `advice.skippedCherryPicks` is set to false (see
325
+ linkgit:git-config[1]).
326
+
321
327
+
322
328
`--reapply-cherry-picks` allows rebase to forgo reading all upstream
323
329
commits, potentially improving performance.
@@ -446,9 +452,9 @@ When `--fork-point` is active, 'fork_point' will be used instead of
446
452
<branch>` command (see linkgit:git-merge-base[1]). If 'fork_point'
447
453
ends up being empty, the `<upstream>` will be used as a fallback.
448
454
+
449
- If `<upstream>` is given on the command line, then the default is
450
- `--no-fork-point`, otherwise the default is `--fork-point`. See also
451
- `rebase.forkpoint` in linkgit:git-config[1].
455
+ If `<upstream>` or `--keep-base` is given on the command line, then
456
+ the default is `--no-fork-point`, otherwise the default is
457
+ `--fork-point`. See also ` rebase.forkpoint` in linkgit:git-config[1].
452
458
+
453
459
If your branch was based on `<upstream>` but `<upstream>` was rewound and
454
460
your branch contains commits which were dropped, this option can be used
0 commit comments