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.

❯ git agent
πŸ” Staged changes: 2 files changed, 41 insertions(+), 6 deletions(-)
πŸ€– google/gemma-4-e4b Β· prompt about 1,912 of 131,072 context tokens
── Proposed commit message ─────────────────────
feat(export): add an optional CSV header row
export_csv takes an optional header and writes it as
the first line of the output.
────────────────────────────────────────────────
[c]ommit [p]ush [e]dit [r]egenerate [f]eedback [q]uit β€Ί

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

── Proposed commit message ──────────
fix(parser): handle empty input
 
Return an empty list when the input has no lines,
instead of failing on the first read.
─────────────────────────────────────
[c]ommit[p]ush[e]dit[r]egenerate[f]eedback[q]uit

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.

Proposed pull request
gh pr create
feat(export): add CSV export
Adds CSV export for order lists, with an optional
header row.
## Changes
- export_csv writes rows as CSV
- an optional header becomes the first line
- the README documents the export

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.

❯ git agent branch fix login timeout
fix/login-timeout

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.md

2.Refine config parsing logic and documentation

src/config.rs 2/3

Split

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.

keepfeat: add csv export
rewordwipfeat(export): add a header row
fold↳ fix typo
keepdocs: document the export

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.
$ git agent explain --pull
πŸ” Pull into main, 2 hours ago: 4 commit(s), 9 files changed
── Pull into main, 2 hours ago ─────────────────
The pull adds CSV export with an optional header row,
and documents it in the README.
- export_csv writes rows as CSV (a6fbe58).
- A header argument adds a first line (63b8816).
- New: export_csv takes an optional header argument.
────────────────────────────────────────────────
$ git agent why src/git.rs:open "what does it check?"
πŸ” src/git.rs:open, last changed in 39c76cd
── Why src/git.rs:open ─────────────────────────
It creates the repository object for the given working
directory, and checks that the directory is inside a
git work tree.
────────────────────────────────────────────────
Follow-up question (Enter to finish) β€Ί

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.

New

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
git agent --all
$ git agent --all
warning: some untracked files look like they should be
ignored rather than committed:
.DS_Store operating system file
.env environment file; it may hold secrets
data.bin large file, 12 MB
target/ Rust build output, 29 files, 991 KB
tools/__pycache__/ Python bytecode
Add them to .gitignore? [Y]es [n]o, commit them too [q]uit β€Ί y
πŸ“ Added to .gitignore: .DS_Store, .env, /data.bin, /target/,
__pycache__/
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.

$ brew install dervism/tap/git-agent

Homebrew builds git-agent from source and installs Rust for the build if you don’t have it.

  1. 1

    Install

    The binary is called git-agent, so git also runs it as git agent.

  2. 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. 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.