git-rewrite-commits  by f

AI-powered Git commit message refactoring

Created 3 weeks ago

New!

975 stars

Top 37.8% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This AI-powered tool automatically rewrites Git commit messages into a clean, conventional format. It's ideal for developers aiming to enhance repository maintainability, prepare projects for open-sourcing, or tidy up commit histories before merging or publishing.

How It Works

The tool uses AI models (OpenAI or local Ollama) to analyze commit diffs and original messages, generating standardized conventional commit messages. It integrates via npx or global install, with optional Git hooks for automated post-commit improvements or pre-push reviews. Features include smart detection to skip well-formed commits and safety mechanisms like backup branches and dry-run previews.

Quick Start & Requirements

  • Installation: Run directly with npx git-rewrite-commits or install globally via npm install -g git-rewrite-commits.
  • Prerequisites: Node.js environment. For AI integration: an OpenAI API key (set as OPENAI_API_KEY environment variable) or Ollama installed and running with a downloaded model (e.g., ollama pull llama3.2).
  • Hook Setup: Execute npx git-rewrite-commits --install-hooks within a repository.
  • Documentation: A QUICK_START.md file is mentioned for detailed setup.

Highlighted Details

  • AI Flexibility: Supports OpenAI (GPT-3.5-turbo, GPT-4o) and local Ollama models for offline processing.
  • Automated Workflow: Integrates with Git hooks for automatic commit message generation on commit or pre-push validation.
  • Intelligent Filtering: Smartly skips commits already conforming to quality standards (configurable threshold).
  • Deep Customization: Allows users to define custom commit message templates and AI prompts for unique styles and formats.
  • Safety Features: Includes automatic backup branch creation, dry-run mode for previewing changes, and confirmation prompts.
  • Standardization: Enforces Conventional Commits standards (feat, fix, docs, etc.) and supports multi-language message generation.

Maintenance & Community

The project welcomes contributions via pull requests and uses GitHub issues for bug reporting and support. Specific community channels (like Discord/Slack) or details on maintainers/sponsors are not detailed in the provided README.

Licensing & Compatibility

Licensed under the permissive MIT License, permitting broad compatibility, including commercial use and integration into closed-source projects.

Limitations & Caveats

Rewriting Git history is a destructive operation, inherently risky on shared branches or repositories referencing commit hashes without team coordination. Users must exercise caution, use separate branches, create backups, and coordinate force-pushes to avoid workflow disruption. It is best suited for personal projects or feature branches before wide sharing.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
10
Issues (30d)
15
Star History
980 stars in the last 21 days

Explore Similar Projects

Starred by John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy) and Didier Lopes Didier Lopes(Founder of OpenBB).

CCPlugins by brennercruvinel

0.6%
3k
Claude Code CLI enhancement framework
Created 4 months ago
Updated 1 month ago
Feedback? Help us improve.