Gitmit is a powerful Git repository manager that helps you maintain clean and consistent commit messages using AI-powered commit message generation. It follows GitFlow requirements and provides a standardized way to manage your Git repositories.
- π€ AI-powered commit message generation using Google's Gemini or Ollama;
- π Standardized commit message format with emojis and types;
- π Automatic branch management following GitFlow;
- π Token usage tracking for AI services;
- π (optional) Summarize changes in the current branch to not share the entire commit history with external AI models;
- π§ Easy configuration and setup.
The summarization feature is optional and can be enabled by setting the models.resume model in the configuration file.
The main goal for this feature is to not share the entire commit history with external AI models, but only the summarized changes in the current branch.
You should have ollama installed to use this feature.
When the
models.commitis set toollama/..., the summarization will be ignored.
The token usage is tracked in a MySQL database. It will be started automatically, so it's a must set configuration.
The main goal for this feature is keeping track the token usage across different devices. You choose a database, and anytime you use the tool, the token usage will be updated and synced accordingly.
-
Download the latest release file from the GitHub releases page;
-
Move the downloaded file to
/usr/local/bin/gitmitor any other directory you want; -
Make the file executable:
# You may need to use sudo to make the file executable chmod +x /usr/local/bin/gitmit
When you set another bin directory, you need to update the
PATHenvironment variable to include the new directory.
This project uses UV as the package manager.
-
Clone the repository:
git clone https://github.com/caiquearaujo/gitmit.git cd gitmit -
Install UV (if not already installed):
# On macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Install dependencies and set up the environment:
uv sync
-
Build the executable:
uv run python build.py
-
Move the file to
/usr/local/bin/gitmitor any other directory you want:# You may need to use sudo to move the file to the bin directory mv /tmp/gitmit/gitmit-x.x.x.pex /usr/local/bin/gitmit -
Make the file executable:
# You may need to use sudo to make the file executable chmod +x /usr/local/bin/gitmit
When you set another bin directory, you need to update the
PATHenvironment variable to include the new directory.
After setting up with UV, you can run the project in development mode:
# Run gitmit directly
uv run gitmit [command]
# Or activate the virtual environment
source .venv/bin/activate
gitmit [command]To add new dependencies:
# Add a runtime dependency
uv add <package>
# Add a development dependency
uv add --group dev <package>-
Run the config command to generate the configuration file:
gitmit config
-
The configuration file will be created at
~/.config/gitmit/config.ini. Edit it with your preferred text editor.
The configuration file will be written with
600permissions, so it will be readable only by the current user.
[models]
# Required: The model to use for commit message generation
# Format: service/model (e.g., google/gemini-2.0-flash or ollama/codellama)
commit = google/gemini-2.0-flash
# Optional: The model to use for change summarization
# Leave empty to disable
resume = ollama/codellamaThe available LLM services are:
ollama. You can use any model supported by services, make sure to use the correct model name.
[google]
# Required if using Google models: Your Google API key
api_key = your-api-key-here[ollama]
# Required if using Ollama models: The Ollama server URL
host = http://localhost:11434[mysql]
# Required: Database connection settings for token usage tracking
host = localhost
port = 3306
user = root
password = your-password
database = gitmitIt will be used to initialize a new repository.
gitmit init [options]Options:
--dev: Create a dev branch (GitFlow);--origin: Set the origin URL for the remote repository.
Example:
gitmit init --dev --origin https://github.com/username/repo.gitIt will be used to commit the changes to the current branch.
gitmit commit [options]Options:
--push: Automatically push changes to the remote repository;--force: Skip confirmation before committing;-m, --mode: Set the mode of the commit. Available options:manualorai;-b, --brief: Type a brief summary of the changes.
Example:
gitmit commit --pushWhen committing, you'll be presented with two options:
- π€ Generated: AI will analyze your changes and generate an appropriate commit message;
- π₯΅ Manual: You can manually create a commit message following the standardized format.
It will be used to update the tool to the latest version. Only supported to the official repository.
gitmit updateExample:
gitmit updateGitmit supports various commit types with corresponding emojis:
| Emoji | Type | Description |
|---|---|---|
| β¨ | feat | New features |
| π©Ή | fix | General fixes |
| π | bug | Bug fixes |
| π | docs | Documentation changes |
| π | style | Code style changes |
| π¦ | refactor | Code refactoring |
| π | perf | Performance improvements |
| β»οΈ | improvement | General improvements |
| β | test | Test changes |
| π¨ | lint | Linter fixes |
| π§ | build | Build changes |
| βοΈ | ci | CI changes |
| β»οΈ | chore | Maintenance tasks |
| βͺ | revert | Reverting changes |
| β« | dependencies | Dependency updates |
| π | metadata | Metadata changes |
| π | version | Version updates |
| π | security | Security fixes |
| π | critical | Critical changes |
| π | review | Code review changes |
| π§± | other | Other changes |
Follow the Release Notes to keep your project up-to-date.
The community and core team are available in GitHub Discussions, where you can ask for support, discuss roadmap, and share ideas.
Our Contribution Guide describes how to contribute to the codebase and docs.
MIT. See LICENSE.
