A git commit-msg hook that automatically prefixes commits with the ticket ID from your branch name.
# .pre-commit-config.yaml
repos:
- repo: https://github.com/edvent-ai/format-commit-msg
rev: v1.0.0
hooks:
- id: format-commit-msg
stages: [commit-msg]Branches must follow the format: abc-123-description
The hook extracts the ticket ID (abc-123) and prepends it to your commit message as [ABC-123].
Based on bartoszmajsak's gist.