✖ subject may not be empty [subject-empty] ✖ type may not be empty [type-empty]
A commit-msg hook (commitlint) rejected your message format.
Exact message you may see
commitlint subject may not be emptytype may not be empty [type-empty]commit-msg hook failed commitlint✖ subject may not be empty [subject-empty] ✖ type may not be empty [type-empty] ✖ found 2 problems, 0 warnings husky - commit-msg hook exited with code 1 (error)
Seen on:
Git
Meaning
Follow Conventional Commits: type(scope): subject such as feat(auth): add login. See the config for allowed types.
Common causes
- Message doesn't match convention
- Merge/revert messages not exempt
- Empty subject
⚡ Quick fix
- Use
feat:/fix:/chore:prefixes - Check
commitlint.config.js - Amend the message
Detailed fix by platform
Shell
git commit -m "fix(api): handle null response"
How to diagnose
- Format — type: subject?
- Types — allowed?
- Config — which?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- author identity unknown Author identity unknown *** Please tell me who you are.
- deploy hook Certbot renewed the certificate but the server still serves the old one (deploy hook / reload failed)
- error: failed to push some refs: pre-push hook failed error: failed to push some refs to 'github.com:org/repo.git' (pre-push hook returned non-zero)
Most viewed in Git
- Git SSL certificate problem fatal: unable to access 'https://…': SSL certificate problem: unable to get local issuer certificate
- gpg failed to sign error: gpg failed to sign the data — fatal: failed to write commit object
- workflow scope ! [remote rejected] … (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/x.yml` without `workflow` scope)
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 25 Nov 2026