When I run git rebase -i I get the absolutely horrible Rebase mode in emacs.

This only accepts some pre defined commads like

c -> Pick

r -> Reword


Even if I change to text mode emacs auto-magically makes the git-rebase-todo file read-only. How can I disable it?

The only solution I have found is to use vim as editor (something I don't want, I like emacs in general)

  • I know sometimes it's frustrating, but try to keep questions and answers here objective – Raystafarian Jul 18 '13 at 9:32
  • @Raystafarian Yes, you are right. Thanks for editing the question! – Erik Jul 18 '13 at 11:22

The rebase-mode automatic activation is triggered by the auto-mode-alist variable. You can try disabling it to edit git-rebase-todo files in fundamental mode (no special shortcut, no automatic read-only flag, ...) :

(setq auto-mode-alist (delete '("git-rebase-todo" . rebase-mode)

On another note, you might want to use magit to realize your git operation directly from within emacs.

  • When using magit, something of note / related. I was gettingBuffer is read-only: #<buffer git-rebase-todo>, and C-x C-q wasn't helping (was getting strange errors). Turns out the latest magit handles keyboard shortcuts within the rebase buffer (s for "squash", f for "fixup", etc). You don't type in the buffer, you interact with it. – lefnire Jun 16 '15 at 16:19
  • 1
    This solution appears to have no effect. I have those lines in my .emacs file, and I still get the rebase mode. This is with emacs 24.5.1. – Ian Hinder May 8 '16 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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