Let a language model do your git chores
git-agent writes commit messages, names branches, splits and tidies commits, and opens pull requests. It runs with a model on your own machine or in the cloud, and you review every proposal before it lands.
Works with the model you already run
- LM Studio
- Ollama
- llama.cpp
- vLLM
- OpenAI
- Anthropic
- OpenRouter
- Google Gemini
- Mistral
- Groq
- DeepSeek
- xAI
- Together AI
- Fireworks AI
- Cerebras
Features
From the first commit to the pull request
Commit
Messages you review first
git-agent describes the staged changes and waits. Commit, push, edit the message in your editor, regenerate it, or tell the model what to change.
Pull requests
Written from the branch, opened with gh
A title and description from the branchβs commits and diff. git-agent pushes the branch if GitHub lacks its commits, then creates the pull request, as a draft if you like.
Or feature/PROJ-12-avatars style, if thatβs yours
Branch
Named after the work
Describe the work, name a GitHub issue, or let your uncommitted changes speak for it. The name follows your repositoryβs pattern.
1.Introduce LRU caching for configuration loading
Cargo.tomlsrc/cache.rssrc/config.rs 1/3README.md2.Refine config parsing logic and documentation
src/config.rs 2/3Split
One change, several commits
The model groups hunks and files by what they are for. You review the plan, and each commit gets a message of its own.
6 commits become 4, with the same files
Tidy
A clean history before you push
A commit named wip gets a real message, and fixes fold into the commits they fix. Only commits that arenβt pushed yet are touched.
Understand the history
Ask your repository why
Two commands read the code and the history git already has, and answer in plain words. Neither changes anything in the repository.
- Why a line is the way it is.
- git agent why reads blame and every commit that changed the lines, follows them through renames, and finds functions inside classes and impl blocks.
- Explain commits, branches and pulls.
- git agent explain summarizes a commit, a range, a branch, or what your last pull brought in, and points out what you may need to act on.
- Ask a follow-up.
- Both commands wait for a follow-up question and answer it with the same code and history at hand.
Safe by default
Careful with your code, keys and history
git-agent works through plain git commands and asks before anything leaves your machine or rewrites what you have.
Build output stays out of your commits
Before git agent --all stages anything, it checks the untracked files. What a .gitignore usually keeps out is listed, and one answer adds it there. When git-agent canβt ask, it leaves those files out of the commit.
- Build output and dependencies, such as target/ next to a Cargo.toml, or node_modules/
- Compiled files, and the .DS_Store files an operating system leaves behind
- .env files and private keys, which may hold secrets
- Files of 10 MB or more
- Secrets stay out of prompts.
- API keys, tokens, private keys and passwords become [REDACTED] before anything reaches the model. By default, git-agent also refuses to commit or push them.
- No force-push, ever.
- Before a push it rebases onto new remote commits, and cancels cleanly on a conflict. tidy only rewrites commits the remote doesnβt have.
- Fits any context window.
- Large diffs are shortened in steps: unchanged lines first, then a share of the room per file, so every file still shows its first changes.
- Local by default.
- Out of the box it talks to LM Studio on your machine and uses the model that is loaded. Ollama, llama.cpp and vLLM work too.
- Keys in your keychain.
- API keys never go into the config file. On macOS each providerβs key is saved in the keychain, so you can switch between them.
- Plain git underneath.
- Commits go through git commit, so your hooks run, and every proposal opens in your own git editor when you want to change it.
Install
Running in a minute
git-agent is a single binary. Install it with Homebrew or Cargo, and git runs it as
git agent.
Homebrew builds git-agent from source and installs Rust for the build if you donβt have it.
Needs Rust 1.88 or newer. --locked uses the exact dependency versions the release was tested with.
For changes that arenβt released yet. Make sure ~/.cargo/bin is on your PATH.
- 1
Install
The binary is called git-agent, so git also runs it as git agent.
- 2
Choose a model
Start LM Studio and load a model, or pick Ollama or a cloud provider in the settings menu.
git agent config - 3
Commit
Stage your changes and let the model describe them. You review before anything is committed.
git agent
Your next commit, described for you
Free and open source under the MIT license. Bring the model you already run, or connect a cloud provider in the settings menu.