S
S
Sergey Burduzha2019-06-16 00:46:45
vim
Sergey Burduzha, 2019-06-16 00:46:45

How to use vim for git commits?

Good evening.
I decided to create an alias in .bashrc alias gc='git add --all && git commit'and chose vim as the default editor.
So, after inserting the alias, I get into vim, write my commit, but I can’t exit, not because I don’t know how, but because vim requires you to give the file a name.
The question is how to save the commit and exit without giving the file a name?
I mean there must be some options.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2019-06-16
@fzfx

<ESC>. :x!.<ENTER>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question