summaryrefslogtreecommitdiff
path: root/Documentation/git-rebase.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/git-rebase.txt')
-rw-r--r--Documentation/git-rebase.txt52
1 files changed, 36 insertions, 16 deletions
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 432baab..4dd5853 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -203,7 +203,7 @@ Alternatively, you can undo the 'git rebase' with
CONFIGURATION
-------------
-include::rebase-config.txt[]
+include::config/rebase.txt[]
OPTIONS
-------
@@ -441,7 +441,8 @@ See also INCOMPATIBLE OPTIONS below.
--exec <cmd>::
Append "exec <cmd>" after each line creating a commit in the
final history. <cmd> will be interpreted as one or more shell
- commands.
+ commands. Any command that fails will interrupt the rebase,
+ with exit code 1.
+
You may execute several commands by either using one instance of `--exec`
with several commands:
@@ -461,6 +462,12 @@ without an explicit `--interactive`.
+
See also INCOMPATIBLE OPTIONS below.
+-y <cmd>::
+ This is the same as passing `--reschedule-failed-exec` before
+ `-x <cmd>`, i.e. it appends the specified `exec` command and
+ turns on the mode where failed `exec` commands are automatically
+ rescheduled.
+
--root::
Rebase all commits reachable from <branch>, instead of
limiting them with an <upstream>. This allows you to rebase
@@ -500,6 +507,11 @@ See also INCOMPATIBLE OPTIONS below.
with care: the final stash application after a successful
rebase might result in non-trivial conflicts.
+--reschedule-failed-exec::
+--no-reschedule-failed-exec::
+ Automatically reschedule `exec` commands that failed. This only makes
+ sense in interactive mode (or when an `--exec` option was provided).
+
INCOMPATIBLE OPTIONS
--------------------
@@ -549,24 +561,29 @@ Other incompatible flag pairs:
BEHAVIORAL DIFFERENCES
-----------------------
- * empty commits:
+There are some subtle differences how the backends behave.
- am-based rebase will drop any "empty" commits, whether the
- commit started empty (had no changes relative to its parent to
- start with) or ended empty (all changes were already applied
- upstream in other commits).
+Empty commits
+~~~~~~~~~~~~~
- merge-based rebase does the same.
+The am backend drops any "empty" commits, regardless of whether the
+commit started empty (had no changes relative to its parent to
+start with) or ended empty (all changes were already applied
+upstream in other commits).
- interactive-based rebase will by default drop commits that
- started empty and halt if it hits a commit that ended up empty.
- The `--keep-empty` option exists for interactive rebases to allow
- it to keep commits that started empty.
+The merge backend does the same.
- * directory rename detection:
+The interactive backend drops commits by default that
+started empty and halts if it hits a commit that ended up empty.
+The `--keep-empty` option exists for the interactive backend to allow
+it to keep commits that started empty.
- merge-based and interactive-based rebases work fine with
- directory rename detection. am-based rebases sometimes do not.
+Directory rename detection
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Directory rename heuristics are enabled in the merge and interactive
+backends. Due to the lack of accurate tree information, directory
+rename detection is disabled in the am backend.
include::merge-strategies.txt[]
@@ -641,6 +658,9 @@ By replacing the command "pick" with the command "edit", you can tell
the files and/or the commit message, amend the commit, and continue
rebasing.
+To interrupt the rebase (just like an "edit" command would do, but without
+cherry-picking any commit first), use the "break" command.
+
If you just want to edit the commit message for a commit, replace the
command "pick" with the command "reword".
@@ -971,7 +991,7 @@ when the merge operation did not even start), it is rescheduled immediately.
At this time, the `merge` command will *always* use the `recursive`
merge strategy for regular merges, and `octopus` for octopus merges,
-strategy, with no way to choose a different one. To work around
+with no way to choose a different one. To work around
this, an `exec` command can be used to call `git merge` explicitly,
using the fact that the labels are worktree-local refs (the ref
`refs/rewritten/onto` would correspond to the label `onto`, for example).