The git hook
Get a suggestion every time you run git commit.
Prefer plain git commit? Install the hook once per repository:
gitmit hook install
Now git commit (without -m) opens your editor with a suggestion already filled in, and the other suggestions listed as comments:
feat(auth): add password reset flow with email token
- add reset request endpoint and token expiry check
# gitmit alternatives:
# feat(auth): support resetting a forgotten password
# feat(auth): add password reset via emailed token
# Please enter the commit message for your changes. ...
- It stays out of the way.
git commit -m,-F, merges, squashes, amends and commit templates are left alone. - It never blocks a commit. If gitmit can't produce a suggestion (no API key, a secret found, a network problem), it leaves a comment explaining why and git carries on.
- It respects existing setups. It installs into your hooks directory, including a custom
core.hooksPathsuch as husky's. If aprepare-commit-msghook already exists, gitmit won't replace it unless you pass--force, and then it keeps a backup. - Removing it:
gitmit hook uninstallremoves the hook and restores any backup.