Why does the COMMIT_EDITMSG open when I try to commit in vscode?

Viewed 4937

Up until now, I can commit all my changes without any complications in VS Code. Now, when I try to commit my changes by clicking the little 'tick' on the top right corner of the 'Source Control' tab, a file named 'COMMIT_EDITMSG' shows up on the editor, and the Source Control panel remains in the loading state and nothing happens.

I don't know why this suddenly happened but I didn't do anything.

Is there a solution for this issue?

This is the file content:

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
#   modified:   pages/support-topics.vue
#
4 Answers

I just started getting this as well. Something surely changed in the default settings with a recent update.

The solution seems to be to turn off this setting

git.useEditorAsCommitInput

When you make a commit, Git needs a commit message. In order to get that commit message, Git will invoke your editor with a file called COMMIT_EDITMSG, which is where you write the message, saving the file and closing it. Once you've done that, Git will take that message, strip out the comments, and use it as the commit message for your commit.

In that context, this is working as designed, and you just need to enter the commit message for your commit.

Try finding the Git settings within VS Code's settings:

-> Git: Use Editor As Commit Input

You just need to turn this off to avoid that pop up.

It only does that if you do not type in a comment for your commit.

Related