2

I'd rather use regular text editing functions when rebasing instead of learning magit's bindings.

Is there a way to use magit but disable git-rebase-mode?

2 Answers 2

5

You can remove git-rebase from auto-mode-alist:

(require 'cl-lib)
(setq auto-mode-alist
      (cl-remove-if (lambda (x) (eq (cdr x) 'git-rebase-mode))
                    auto-mode-alist))
1
  • (setq auto-mode-alist (rassq-delete-all 'git-rebase-mode auto-mode-alist)) works, without cl-lib.
    – ideasman42
    Commented Jun 19, 2020 at 4:42
1

Adding another answer for completeness, when using use-package, this needs to be done from :init, eg:

(use-package magit
  :init
  ;; Don't use magit for interactive rebase
  ;; (has own entire key-map, doesn't allow text-file editing).
  (setq auto-mode-alist (rassq-delete-all 'git-rebase-mode auto-mode-alist)))
1
  • Had to add the line inside :config rather than :init, because at least when used with git-commit mode, doing a git commit --amend adds the 'git-rebase-mode back to the alist.
    – Hi-Angel
    Commented Feb 27, 2023 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.