Function: git-rebase-mode

git-rebase-mode is an autoloaded and byte-compiled function defined in git-rebase.el.

Signature

(git-rebase-mode)

Documentation

Major mode for editing of a Git rebase file.

Rebase files are generated when you run "git rebase -i" or run magit-interactive-rebase. They describe how Git should perform the rebase. See the documentation for git-rebase (e.g., by running "man git-rebase" at the command line) for details.

In addition to any hooks its parent mode special-mode might have run, this mode runs the hook git-rebase-mode-hook, as the final or penultimate step during initialization.

- negative-argument
0 digit-argument
1 digit-argument
2 digit-argument
3 digit-argument
4 digit-argument
5 digit-argument
6 digit-argument
7 digit-argument
8 digit-argument
9 digit-argument
< beginning-of-buffer
> end-of-buffer
? describe-mode
A git-rebase-alter
C-k git-rebase-kill-line
C-x C-t git-rebase-move-line-up
C-x u git-rebase-undo
DEL git-rebase-show-or-scroll-down
DEL scroll-down-command
F git-rebase-alter
M M git-rebase-merge
M t git-rebase-merge-toggle-editmsg
M-<down> git-rebase-move-line-down
M-<up> git-rebase-move-line-up
M-n git-rebase-move-line-down
M-p git-rebase-move-line-up
RET git-rebase-show-commit
S git-rebase-squish
S-SPC scroll-down-command
SPC git-rebase-show-or-scroll-up
SPC scroll-up-command
SPC..~ undefined
b git-rebase-break
c git-rebase-pick
d git-rebase-drop
e git-rebase-edit
f git-rebase-fixup
g revert-buffer
h describe-mode
k git-rebase-kill-line
l git-rebase-label
m git-rebase-edit
n forward-line
p git-rebase-backward-line
q quit-window
q undefined
r git-rebase-reword
s git-rebase-squash
t git-rebase-reset
u git-rebase-update-ref
w git-rebase-reword
x git-rebase-exec
y git-rebase-insert
z git-rebase-noop

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/git-rebase.el
;;; Mode

;;;###autoload
(define-derived-mode git-rebase-mode special-mode "Git Rebase"
  "Major mode for editing of a Git rebase file.

Rebase files are generated when you run \"git rebase -i\" or run
`magit-interactive-rebase'.  They describe how Git should perform
the rebase.  See the documentation for git-rebase (e.g., by
running \"man git-rebase\" at the command line) for details."
  :interactive nil
  :group 'git-rebase
  (setq comment-start (or (magit-get "core.commentChar") "#"))
  (setq git-rebase-comment-re (concat "^" (regexp-quote comment-start)))
  (setq font-lock-defaults (list (git-rebase-mode-font-lock-keywords) t t))
  (unless git-rebase-show-instructions
    (let ((inhibit-read-only t))
      (flush-lines git-rebase-comment-re)))
  (unless with-editor-mode
    ;; Maybe already enabled when using `shell-command' or an Emacs shell.
    (with-editor-mode 1))
  (when git-rebase-confirm-cancel
    (add-hook 'with-editor-cancel-query-functions
              #'git-rebase-cancel-confirm nil t))
  (setq-local redisplay-highlight-region-function
              #'git-rebase-highlight-region)
  (setq-local redisplay-unhighlight-region-function
              #'git-rebase-unhighlight-region)
  (add-hook 'with-editor-pre-cancel-hook  #'git-rebase-autostash-save  nil t)
  (add-hook 'with-editor-post-cancel-hook #'git-rebase-autostash-apply nil t)
  (setq imenu-prev-index-position-function
        #'magit-imenu--rebase-prev-index-position-function)
  (setq imenu-extract-index-name-function
        #'magit-imenu--rebase-extract-index-name-function)
  (when (boundp 'save-place)
    (setq save-place nil)))