Home > Back-end >  Why COMMIT_EDITMSG opens when i try to commit in vscode?
Why COMMIT_EDITMSG opens when i try to commit in vscode?

Time:07-09

Up to the present, i can commit all my changes without any complications in VSCode. Now, when i try to commit my changes by clicking the little 'tick' on the top right corner of 'Source Control' tab, a file named 'COMMIT_EDITMSG' show up on the editor and Source Control remains at the loading state and nothing happens.

I don't know why this is 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
#

CodePudding user response:

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.

CodePudding user response:

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

  • Related