Search code examples
gitemacseshell

How to do git commits in Emacs buffers


The normal way that I work is to have a small eshell buffer and a larger buffer for the code I'm working on. I use the eshell buffer to do compilation and simple tests.

If I want to do git commits, when I run it this way, I always get a new Emacs window opening up.

How could I get the commit to simply open a new buffer in the current Emacs session?


Solution

  • My guess is that your environment variable $EDITOR is declared as emacs. Since you're not running Emacs as a daemon, it starts a new instance of it. To remedy this you have two options:

    1. configure your $EDITOR to use Emacsclient

    2. use egg or magit, Git frontends for Emacs.
      Egg has a bit of hand holding, since you can see the shortcuts, but Magit is more actively developed.