explaingit

f/git-rewrite-commits

Analysis updated 2026-05-18

1,411TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool that uses AI to rewrite messy git commit messages into clean, conventional-commit-style history, run once or automatically via a git hook.

Mindmap

mindmap
  root((git-rewrite-commits))
    What it does
      Rewrites commit messages
      Uses conventional commits
    Tech stack
      TypeScript
      OpenAI API
      Ollama
    Use cases
      Clean messy history
      Auto message hooks
      Local rewriting
    Cautions
      Requires force push
      Backup branch created

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Clean up a messy commit history into standardized conventional commit messages.

USE CASE 2

Auto-generate commit messages for every new commit via a git hook.

USE CASE 3

Rewrite commit history locally with Ollama to keep sensitive code private.

USE CASE 4

Preview rewritten commit messages in dry-run mode before applying changes.

What is it built with?

TypeScriptNode.jsOpenAI APIOllama

How does it compare?

f/git-rewrite-commitsopenkursar/hello-haloyorgai/org2
Stars1,4111,4231,428
LanguageTypeScriptTypeScriptTypeScript
Last pushed2026-07-03
MaintenanceActive
Setup difficultyeasyeasymoderate
Complexity2/53/53/5
Audiencedeveloperpm founderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Rewriting history requires a force-push and is unsafe on shared branches.

No license information was found in the material provided.

In plain English

This tool uses AI to rewrite the commit messages in a git repository's history. Commit messages are the short descriptions developers write each time they save a change to a codebase. When those messages are vague or inconsistent, this tool can go back through all of them and replace them with cleaner, more descriptive ones following a standard format called conventional commits, which uses prefixes like "feat" or "fix" to categorize each change. You can run it without installing anything, just by typing a single command in a terminal. It supports OpenAI's models for the rewriting, or a local tool called Ollama that processes everything on your own machine without sending your code anywhere. For repositories containing sensitive code or credentials, the local option is recommended. The tool can also install hooks into git so that every new commit you make gets an AI-generated message automatically, either shown as a preview for you to accept or written directly into the commit editor. An important caution: rewriting commit history changes the internal identifiers for every commit and requires a force-push to update the remote copy of the repository. This is disruptive for shared branches where other people have already pulled the old commits. The README strongly recommends using this only on personal projects, feature branches before they are merged, or repositories you are about to make public for the first time. A dry-run mode lets you preview what the new messages would look like before anything is changed, and the tool always creates a backup branch before making any modifications.

Copy-paste prompts

Prompt 1
Show me how to run this tool to rewrite my repo's commit history.
Prompt 2
Explain the risks of rewriting git history and when this is safe to use.
Prompt 3
Help me set up the git hook so new commits get AI-generated messages.
Prompt 4
How do I use the local Ollama option instead of sending code to OpenAI?

Frequently asked questions

What is git-rewrite-commits?

A command-line tool that uses AI to rewrite messy git commit messages into clean, conventional-commit-style history, run once or automatically via a git hook.

What language is git-rewrite-commits written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, OpenAI API.

What license does git-rewrite-commits use?

No license information was found in the material provided.

How hard is git-rewrite-commits to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is git-rewrite-commits for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.