How to do git commits in Emacs buffers
Asked Answered
R

3

8

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?

Rockwood answered 16/5, 2012 at 20:25 Comment(1)
I've always just used vc-git to do my commits. Maybe you should try that.Headphone
C
8

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.

Cockatrice answered 16/5, 2012 at 20:35 Comment(1)
Okay, that's giving me stuff to search. I'll play around a bit. Thanks.Rockwood
H
2

I like all my compilation and git/magit messages to appear in the same window in the same frame that triggered the message.

Check out the vars same-window-regexps and same-window-buffer-names as I think that's what you might be looking for.

Here is the setting I use:

(setq same-window-regexps (quote ("\*vc\-.+\*" "\*magit.+\*" "grep" "\*compilation\*\(\|<[0-9]+>\)" "\*Help\*\(\|<[0-9]+>\)" "\*Shell Command Output\*\(\|<[0-9]+>\)" "\*dictem.*")))

Hope that is helpful.

Damon

Habergeon answered 10/1, 2013 at 23:43 Comment(0)
F
0

You're bananas if you use Emacs, use git, but don't use magit. Bananas I say!

Foliage answered 17/5, 2012 at 7:44 Comment(1)
I like this answer a lot.Hazem

© 2022 - 2024 — McMap. All rights reserved.