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

Now, if a developer tries to commit with a bad message, Git aborts. This doesn't just work for command-line commits; it works for GUI tools and IDEs because everything eventually writes to COMMIT-EDITMSG . Your project uses Jira (PROJ-123). You want every commit to include the ticket number, but you hate typing it. 30 seconds before you commit, you fetched the PROJ-123 branch. git config --global commit