As a newbie git user, when I try to commit my work with
git commit -a -v
and I enter a commit message in my editor, I close the file, and g
For Visual studio Code
git config --global core.editor "code -w"
For atom
git config --global core.editor "atom -w"
For sublime
git config --global core.editor "subl -w"
I'm also a newbie in Git. I encountered basically the same problem as yours. I solved this by typing:
git commit -a -m 'some message'
The reason is that git doesn't allow commit without messages. You have to associate some messages with your commit command.
I got this problem, and found out that if I dont put any comment after committing, it gives me that error. If I jump to get back to the main bash straight away, it doesnt commit.Just to be more clear, Im using GIT Bash, not other editor
When I used the complete atom filepath it didn't work, so instead of using:
git config --global core.editor "c:/programs/atom/atom.exe -w"
I used:
git config --global core.editor "atom -w"
and it worked just fine. Good luck!
IMPORTANT: First make sure that atom starts correctly calling it directly (atom) from the command line you are using.
I got this error, and even though i used git config --global core.editor "code -w"
, it still wouldn't wait for me to close the file. It would just abort instantly.
My problem was that I had run this command earlier git config core.editor "code"
.
It seems that core.editor
(which I presume is a local working directory specification), took precedence over --global core.editor
.
If git config --global core.editor "code -w"
(or whatever editor you are trying to use) does not work for you, try omitting the --global
.
If you want to commit with a proper (long, multi-line comment) documentation, but don't want the -m
option, what you can do (and that I do when preparing my commits) is to:
git commit -a -F /path/to/doc-commit
')In short, use a separate file (which can be at any path you want) as your commit message.