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.hooksPath such as husky's. If a prepare-commit-msg hook already exists, gitmit won't replace it unless you pass --force, and then it keeps a backup.
  • Removing it: gitmit hook uninstall removes the hook and restores any backup.