Skip to content

Instantly share code, notes, and snippets.

View axonde's full-sized avatar
💭
Learning

Axonde ✦ axonde

💭
Learning
View GitHub Profile
@axonde
axonde / git-conventional-standard-commit-hook
Last active September 19, 2025 19:31
Git hook script that enforces the Conventional Commits standard
I wanted to share my commit-msg Git hook script that enforces the Conventional Commits standard. This script ensures that all commit messages follow a consistent format, improving readability and maintainability of the project's commit history.
What it does:
Validates commit messages against the Conventional Commits format: <type>(<scope>): <subject>.
Provides detailed error messages if the commit message doesn't match the expected format.
Includes descriptions for each valid commit type to help users understand when to use them.
How to use it:
Copy the script below into your repository's .git/hooks/commit-msg file.
Make the script executable by running:
chmod +x .git/hooks/commit-msg