husky

Strange error when attempting to commit. [subject-empty]


I type this into the CLI

git commit -m "Hello World!"

This is the error message I get

husky > commit-msg (node v14.15.3)
⧗   input: Hello World!
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]

✖   found 2 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky > commit-msg hook failed (add --no-verify to bypass)

What does this mean?


Solution

  • To fix the error, change your commit message ("Hello world") to follow the Conventional Commits format, e.g. to "feat: hello world".

    As the "Get Help" message link (in your error message) explains, husky calls commitlint to verify that your commit message conforms to this format.

    We should always RTFEM !