Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git commit error: invalid commit message

Tags:

git

I've been searching Google and cannot find anything on this error.

Here is the full error:

git commit -m "update ui"                                        
INVALID COMMIT MSG: does not match "type scope: subject" ! was: "update ui"
Note: scope must be only letters.
like image 315
thienedits Avatar asked Nov 27 '13 08:11

thienedits


People also ask

How do I fix a bad commit message?

On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter. In your text editor, edit the commit message, and save the commit.

How do I fix my commit?

You can modify the most recent commit in the same branch by running git commit --amend. This command is convenient for adding new or updated files to the previous commit. It is also a simple way to edit or add comments to the previous commit. Use git commit --amend to modify the most recent commit.

Can you commit with no message?

Git does not recommend to commit without any message. Git commit messages are necessary to look back and see the changes made during a particular commit. If everyone will just commit without any message, no one would ever know what changes a developer has done.

What is the git commit command?

The git commit command captures a snapshot of the project's currently staged changes. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it to.


1 Answers

You have a commit-msg hook on your system that is enforcing a format on your commit message. This is presumably company policy of some kind.

like image 139
Eric Avatar answered Sep 17 '22 12:09

Eric