So I’ve tried to make VS Code my Git editor by using this git config --global core.editor "code --wait"
, and so far it is working ok until the moment I want to make a commit. Once i do git commit
command, a blank new "file" opens up in VS code, waiting for me to name the commit, I just write a simple message, save it and close the tab (by pressing ctrl+w
or by clicking on the x) at which point I get this message Aborting commit due to empty commit message.
The funny thing is that everything works fine if I do git commit --amend
.
Just some information for all, I am using VS Code on Windows, I installed git and also use WSL(Ubuntu) terminal.
2
Answers
I had the same issue, I was picking not to save and that caused the issue.
I select to save and now commit worked.
I wanted to write the same question. I’m new here btw. But I thought about the process of adding editor to git settings. I got a flash. I just psted this problem on yt and I got it.
https://www.youtube.com/watch?v=B27pUBrWp5w
THIS —-
—-<<<
You must paste to your git user config setting. For global git settings is in C:Users(Your User Name).gitconfig
Just add the -nw tag like abowe. Make sure to not forget the apostrophe.
I’m a genius 😀