9 releases

0.0.12 Sep 5, 2025
0.0.11 Jul 2, 2025
0.0.10 Jun 29, 2025
0.0.7 Mar 7, 2025
0.0.3 Feb 28, 2025

#221 in Development tools

Download history 112/week @ 2025-09-01 20/week @ 2025-09-08 2/week @ 2025-09-15 8/week @ 2025-09-29 2/week @ 2025-10-06

754 downloads per month

MIT license

33KB
681 lines

gitru

Git Commit Message Validation Tool

Enforces commit message conventions through configurable rules .
(currently supports type、scope and subject validation, Additional features will be implemented gradually.)

Installation

Method 1: (Recommended)

With Rust toolchain installed:

cargo install gitru

Method 2:
Download pre-built binary:

  1. Get latest release for your OS
  2. Add to system PATH
  3. Set executable permissions:

Usage

Install hook and initialize configuration:

gitru commit-msg  ii

Command breakdown:

  • ii = install (sets up git hook) + init (creates config template)
  • Execute separately: gitru commit-msg install then gitru commit-msg init

Workflow

After installation:

  • Git hook installed to .git/hooks/commit-msg
  • Configuration template created at .commit-msg-rule.yaml

Customize validation rules by editing .commit-msg-rule.yaml.
You can optionally modify, delete, or comment out the options that do not require validation.

Commit validation example:

Validation success Example:

git commit -m "feat: add new API endpoint"
git commit -m "feat(core): add new API endpoint"

Validation Failure Example:
(default config)

git commit -m "add feature"
git commit -m "feat: add"  # subject 'add' is too short
git commit -m "feat:add feature" # need space default
git commit -m "feat(): add feature"
git commit -m "feat(: add feature"
git commit -m "feat): add feature"

Uninstall

remove commit-msg hook from .git/hooks directory:

gitru commit-msg uninstall

remove .commit-msg-rule.yaml file manually .

Dependencies

~12–27MB
~269K SLoC