This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |