Welcome to the Git Helper Tool!
Do you find yourself struggling to come up with a clear commit message for your changes? Do you need a better way to review changes before committing? Have you made so many changes at once that you can't keep track of them all?
This tool will help you manage your commits better by providing a structured approach to reviewing changes and drafting commit messages. It currently has the following features:
- Helps you review changes before committing.
- Helps you create clear commit messages, optionally powered by AI.
- Validate your commit messages to ensure they follow the Conventional Commits specification.
We've included example rules for AI helpers. These show how to use this tool with AI to make better commit messages.
One of the most popular commit message conventions is Conventional Commits. Eventually, this tool will validate your commit messages to ensure they follow the Conventional Commits specification.
- Python 3.12 or higher
- UV package manager
- Git initialized in the project
-
Install the tool:
uv pip install git+https://github.com/rkaramc/tools-git-helper.git
-
Add the folder [.gw-state/] to your
.git/info/excludefile (or to the global git ignore file) to prevent it from being tracked by git. This folder is temporary and holds thepending-changes.mdfile during the commit workflow.- NOTE: Adding this folder to
.gitignoremay prevent your AI assistant from accessing it. (e.g. Windsurf)
- NOTE: Adding this folder to
-
If you will be using an AI assistant to generate the commit messages, the
ai-rules.mdfile contains sample rules for the assistant. Adapt the rules to your needs and add them to your AI assistant's global rules.
You can use the tool by running the following commands.
# Set a manual commit message
gw-commit message --message "fix: some changes" # Set a draft commit message provided by the user
# OR edit the file pending-changes.md in an editor
# OR request your AI assistant to generate a draft commit message
# and update the file pending-changes.md directly
# Review and edit pending-changes.md
gw-commit review # Shows the pending changes and draft commit message for review, in a rich terminal UI
# Commit changes
gw-commit commit # Commits the changes to the repository, with the commit message provided by the user- Core git workflow automation functionality
- Command-line interface with key commands:
gw-commitwith sub-commands:message: Set draft commit message manuallyreview: Review pending changes and commit messagecommit: Commit changes (optionally with--amendto amend previous commit; with--messagefor manual commit message)
- Using
clickfor CLI interface - Rich text formatting with
richlibrary - Git operations through
gitpythonand subprocess uvpackage manager for dependency management- Organized project structure with src layout
MIT