Commit-editmsg -

git config --global commit.template ~/.gitmessage.txt Create ~/.gitmessage.txt :

if ! grep -q -E "$pattern" "$message_file"; then echo "ERROR: Commit message does not follow Conventional Commits format." echo "Expected: <type>(<scope>): <subject>" echo "Example: feat(auth): add OAuth2 provider" exit 1 fi COMMIT-EDITMSG

When you run: