finds.dev← search

// the find

f/git-rewrite-commits

★ 1,422 · TypeScript · MIT · updated Jun 2026

AI-powered git commit message rewriter using Ollama or GPT

A CLI (and npm package, aliased as `grec`) that uses OpenAI or local Ollama models to rewrite git commit messages, either live via git hooks or retroactively across your whole history. Aimed at developers who want to clean up a messy commit log before open-sourcing a repo or merging a feature branch.

Takes the security side seriously for a tool that shells out to git and third-party APIs: it redacts secrets from diffs before sending them out, requires explicit consent for remote providers, and ships a local Ollama path so nothing has to leave the machine. Hooks are opt-in via git config rather than silently installed and active. It also creates a backup branch before any history rewrite, which is the right default for something this destructive.

It rewrites history with `git filter-branch`, which git's own docs tell you not to use anymore because of correctness and performance footguns — `git-filter-repo` has been the recommended tool for years and there's no sign this project uses or wraps it. The directory tree shows no test suite at all for a tool whose entire job is mutating commit history, which is the kind of thing you really want covered. The README's own quick-start example (`--skip-remote-consent` piped straight into `git commit -m`) bypasses the consent flow it advertises as a security feature, which is a mixed signal about how seriously to take the rest of the safety story. And the CI example runs the rewriter against PR commits, which is a strange fit since you can't force-push a PR's history on someone else's branch.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →