When I hit c c in the Magit buffer it opens the commit message buffer. Then I write my message and type C-c C-c to close it. For some reason it saves .git/COMMIT_EDITMSG and every next time when I hit c in the Magit buffer it opens .git/COMMIT_EDITMSG instead of commit popup.

Does it have anything to do with Magit itself or is this somewhere in my git setup?

1 Answer 1


For some reason it saves .git/COMMIT_EDITMSG

That's what is supposed to happen. Magit calls git commit, which uses the editor specified by $EDITOR (which Magit arranged to be an emacsclient instance which connects to the current Emacs instance), the user writes the message and finishes with C-c C-c. That causes emacsclient to exit with zero exit status (success) and git commit then takes the text it finds in .git/COMMIT_EDITMSG and uses it as the commit message.

every next time when I hit c in the Magit buffer it opens .git/COMMIT_EDITMSG instead of commit popup.

That most likely means that you did not finish writing the message by pressing C-c C-c. Instead you somehow moved away from the buffer. If a commit is in progress, then c does not show the commit popup. Instead it puts you in the existing buffer so that you can finish writing the message and then press C-c C-c (or C-c C-k to abort).

  • 2
    On odd occasions in the past I've ended up in similar situations where Magit seemed quite insistent about me finishing an older commit message, and C-c C-k did not convince it to drop the matter. On those occasions I ended up using C-c C-c and then fixing it afterwards. Is there any other command which would tell Magit to forget all about a commit-in-progress? (I feel that's basically what C-c C-k is expected to do, but it would be useful to know if there's a bigger hammer to hit it with if this ever occurs again.)
    – phils
    Jan 7, 2019 at 23:17
  • 1
    Thank you for the explanation. If I make a commit (finish it with C-c C-c), while it is still not pushed to the remote branch and I then type c it again brings me to the last commit message, even though it is not "unfinished" (the commit is created and incorporated in the local tree). If now, in the last commit's message buffer, I type C-c C-k it closes is and any subsequent cs from the Magit buffer bring up the commit dialog. Is this also expected?
    – yujaiyu
    Jan 8, 2019 at 1:32
  • Almost every time I type c to commit, Magit immediately shows me the last message buffer. I then have to C-c C-k to kill it and next time I type c it prompts me for commit options. This is despite having completed a commit with C-c C-c previously. Actually, when Magit shows the "faulty" message buffer, it already contains the previous commit message and pressing C-c C-c closes the buffer but does not perform the git commit. Sep 7, 2021 at 4:41

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.