The error “Commit operation was cancelled due to empty commit message. ” is an error that is invoked whenever you are coding in VS Code and trying to commit changes using the git extension. Given below is the snippet of the error:
Commit operation was cancelled due to empty commit message.
I would like to share with you the steps I took to fix the “Commit operation was cancelled due to empty commit message. ” in your project file.
Why “Commit operation was cancelled due to empty commit message. ” error is seen?
The error, “Commit operation was cancelled due to empty commit message. ” is seen because; Whenever try to make a commit on githib, Git requires a commit message.
To get the required commit message, Git would call on your editor in a file which is called COMMIT_EDITMSG
, this is where you write the message, save the file and close it.
Once you are finished with that, Git will take the above saved message, remove all the comments, then use it as the commit message for your commit.
The detailed solution to fix the error “Commit operation was cancelled due to empty commit message.”, is given below:
How to fix the error, “Commit operation was cancelled due to empty commit message. “?
To fix the error, you have to turn off the setting Git: “Use Editor As Commit Input” which you can find in your VS Code settings as Code > Preferences > Settings.
Follow the below steps to untick the Use Editor As Commit Input option:
Open VS Code > Code > Preferences > Settings, Now search for “Git: Use Editor As Commit Input” and then uncheck it. You should be able to commit code without any error and Commit operation was cancelled due to empty commit message error will be fixed now.

To fix the error, “Commit operation was cancelled due to empty commit message. “, you have to follow the below mentioned steps:
First, you have to make sure not to enter your commit message on the command palette. This is one of the reasons you see this error.
To fix the error completely you have to turn off the setting Git: Use Editor As Commit Input which you can find in your vscode settings. Follow the below mentioned steps to know how to do so:
Open VS Code then follow the steps: Code > Preferences > Settings. Now search for “Git: Use Editor As Commit Input” and then uncheck it. You should be able to commit without any errors after this.
This should fix the error, “Commit operation was cancelled due to empty commit message. “.
Conclusion
To fix the error “Commit operation was cancelled due to empty commit message. “, you have to turn off the setting Git: Use Editor As Commit Input which you can find in your vscode settings.
Follow the below steps to untick the Use Editor As Commit Input option:
Open VS Code > Code > Preferences > Settings, Now search for “Git: Use Editor As Commit Input” and then uncheck it. You should be able to commit code without any error and Commit operation was cancelled due to empty commit message error will be fixed now.