Next: , Up: Rebasing   [Contents][Index]


6.9.1 Editing Rebase Sequences

C-c C-c     (with-editor-finish)

Finish the current editing session by returning with exit code 0. Git then uses the rebase instructions it finds in the file.

C-c C-k     (with-editor-cancel)

Cancel the current editing session by returning with exit code 1. Git then forgoes starting the rebase sequence.

RET     (git-rebase-show-commit)

Show the commit on the current line in another buffer and select that buffer.

SPC     (git-rebase-show-or-scroll-up)

Show the commit on the current line in another buffer without selecting that buffer. If the revision buffer is already visible in another window of the current frame, then instead scroll that window up.

DEL     (git-rebase-show-or-scroll-down)

Show the commit on the current line in another buffer without selecting that buffer. If the revision buffer is already visible in another window of the current frame, then instead scroll that window down.

p     (git-rebase-backward-line)

Move to previous line.

n     (forward-line)

Move to next line.

M-p     (git-rebase-move-line-up)

Move the current commit (or command) up.

M-n     (git-rebase-move-line-down)

Move the current commit (or command) down.

r     (git-rebase-reword)

Edit message of commit on current line.

e     (git-rebase-edit)

Stop at the commit on the current line.

s     (git-rebase-squash)

Meld commit on current line into previous commit, and edit message.

f     (git-rebase-fixup)

Meld commit on current line into previous commit, discarding the current commit’s message.

k     (git-rebase-kill-line)

Kill the current action line.

c     (git-rebase-pick)

Use commit on current line.

x     (git-rebase-exec)

Insert a shell command to be run after the proceeding commit.

If there already is such a command on the current line, then edit that instead. With a prefix argument insert a new command even when there already is one on the current line. With empty input remove the command on the current line, if any.

b     (git-rebase-break)

Insert a break action before the current line, instructing Git to return control to the user.

y     (git-rebase-insert)

Read an arbitrary commit and insert it below current line.

C-x u     (git-rebase-undo)

Undo some previous changes. Like undo but works in read-only buffers.

User Option: git-rebase-auto-advance

Whether to move to next line after changing a line.

User Option: git-rebase-show-instructions

Whether to show usage instructions inside the rebase buffer.

User Option: git-rebase-confirm-cancel

Whether confirmation is required to cancel.

When a rebase is performed with the --rebase-merges option, the sequence will include a few other types of actions and the following commands become relevant.

l     (git-rebase-label)

This commands inserts a label action or edits the one at point.

t     (git-rebase-reset)

This command inserts a reset action or edits the one at point. The prompt will offer the labels that are currently present in the buffer.

MM     (git-rebase-merge)

The command inserts a merge action or edits the one at point. The prompt will offer the labels that are currently present in the buffer. Specifying a message to reuse via -c or -C is not supported; an editor will always be invoked for the merge.

Mt     (git-rebase-merge-toggle-editmsg)

This command toggles between the -C and -c options of the merge action at point. These options both specify a commit whose message should be reused. The lower-case variant instructs Git to invoke the editor when creating the merge, allowing the user to edit the message.


Next: , Up: Rebasing   [Contents][Index]