Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs shell: save commit message

Tags:

git

shell

vim

emacs

I've started using emacs a few days ago, and I'm facing a problem when using git in the emacs shell (M-x shell). When I 'git commit' or 'git commit --amend', it opens vim to edit and save the commit message. I'm ok with that, but I can't find a way to save and exit vim, since hitting ESC does not trigger vim Normal Mode, and ESC is my emacs metakey. I tryed changing my git editor to emacs, but it doesn't work either, it seems like emacs shell cannot run emacs, and it doesn't open a new buffer like I thought it would.

emacs: Terminal type "dumb" is not powerful enough to run Emacs.

Is there a way I can use git command-line (I'd rather not have to use a git front-end client like magit, ...) with the emacs shell ?

Thanks, Robin

like image 374
robin seichais Avatar asked May 03 '26 17:05

robin seichais


1 Answers

You can change your editor to something more simple, like nano, using

git config core.editor nano

Or you could just make it no open any editor by putting your message on the command line :

git commit --amend -m "My message"
like image 150
blue112 Avatar answered May 06 '26 08:05

blue112



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!