Skip to main content

AI-powered git assistant for when git is being git

Project description

git-wtf

AI-powered git assistant. For when git is being git.

Two commands that cover 90% of the pain:

git wtf          # diagnose whatever broken state you're in
git wtf merge    # resolve merge conflicts — semantically, not just line-by-line

Built for vibe coders who are moving fast with AI tools. When you hit a merge conflict on code you didn't write and don't have time to read, git wtf merge reads both sides, understands what each branch was trying to do, merges them properly, explains what it did in plain English, and asks you to confirm before touching a single file.


install

macOS (Homebrew)

brew tap git-wtf/tap
brew install git-wtf

Any OS (pip)

pip install git-wtf

Any OS (pipx — recommended if you use pipx)

pipx install git-wtf

Git automatically picks up git-wtf as a subcommand. No PATH tricks, no aliases required.


setup

git wtf setup

Interactive. Takes ~30 seconds. Three options:

  1   Anthropic   api.anthropic.com  →  Claude
  2   OpenAI      api.openai.com  →  GPT-4o, o3, ...
  3   Proxy       corporate / LiteLLM / custom endpoint

Option 1 — Anthropic (direct)

Get your key at console.anthropic.com, paste it in, pick a model. Done.

Option 2 — OpenAI (direct)

Get your key at platform.openai.com, paste it in. Done.

Option 3 — Proxy / corporate

Paste your proxy base URL (e.g. https://llm-proxy.yourcompany.com/v1), paste the key if required. The tool fetches the available model list from the proxy and lets you pick. SSL verification is automatically disabled for corporate MITM setups.

Config is saved to ~/.config/git-wtf/config.json.

env vars (override config file)

GITWFT_API_KEY=...          # API key
GITWFT_BASE_URL=...         # custom base URL
GITWFT_MODEL=...            # model override
GITWFT_VERIFY_SSL=false     # disable SSL verification

Standard OPENAI_API_KEY and ANTHROPIC_API_KEY are also picked up automatically.

opencode users

If you use opencode, git-wtf reads your ~/.config/opencode/opencode.json automatically and routes through the same proxy. Zero extra config.


usage

git wtf

Diagnoses whatever state your repo is in. Detached HEAD, mid-merge, diverged from remote, unresolved conflicts — it reads the git state, figures out what happened, and tells you exactly what to run.

 __ _(_) |_  __ _____ __
/ _` | |  _| \ V V / '_ \
\__, |_|\__|  \_/\_/ | .__/
|___/               |_|

  feat/onboarding  →  origin/feat/onboarding

  ↓ 3 behind    MID-MERGE    2 CONFLICTS

──────────────────────────── diagnosis ────────────────────────────

## what happened
ok so basically you're in the middle of a merge that hit conflicts.
git is frozen waiting for you to resolve them...

## how to fix it
1. run `git wtf merge` to resolve conflicts automatically
2. run `git merge --continue` to finish the merge
...

git wtf merge

The main thing. Reads both sides of every conflict, understands the intent behind each, and produces a resolution that keeps both features intact — not just picking a winner.

The trust flow (this is the important part):

After resolving all conflicts, before writing a single file, it shows you:

  1. A per-file panel — what each file does now, confidence rating (HIGH / MEDIUM / LOW), and any warnings about things it wasn't sure about
  2. A plain-English summary of the entire merge — what the app will do after this, what trade-offs were made, anything that needs manual review
  3. A single apply this merge? [Y/n] prompt

Nothing is written to disk until you say Y.

  feat/chat-agent  +  feat/onboarding  →  3 conflicted files

  (1/3)  src/auth.ts        2 hunks    MEDIUM
  (2/3)  src/api/client.ts  1 hunk     HIGH
  (3/3)  src/user.ts        3 hunks    HIGH

────────────────────── what i'm about to change ───────────────────

╭──────  src/auth.ts    MEDIUM   2 hunks  ─────────────────────────╮
│                                                                   │
│  fetchUser now uses the shared httpClient AND sends the auth      │
│  token as a Bearer header. logout clears localStorage, the        │
│  httpClient cache, AND sessionStorage — all three steps kept.     │
│                                                                   │
│  ⚠  verify httpClient.get() accepts a headers config object       │
│     before shipping                                               │
╰───────────────────────────────────────────────────────────────────╯

───────────────────────── the big picture ─────────────────────────

╭──────────────  what this merge will do  ─────────────────────────╮
│                                                                   │
│  • fetchUser now uses the shared HTTP client AND sends auth       │
│  • logout does a full triple cleanup — nothing left behind        │
│  • onboarding auth + chat-agent HTTP refactor coexist cleanly     │
│                                                                   │
│  ⚠  NEEDS MANUAL REVIEW: httpClient.get() headers assumption      │
│                                                                   │
│  vibe check: clean merge, one loose wire — verify before ship     │
╰───────────────────────────────────────────────────────────────────╯

  3 files resolved  ·  nothing written to disk yet

  apply this merge? [Y/n]

how it works

  1. Reads git stategit status, git log, branch info, merge state
  2. Parses conflict markers — extracts the three blob versions (:1: ancestor, :2: yours, :3: theirs) for full file context
  3. Reads project contextREADME.md, package.json, CLAUDE.md / .cursorrules so the LLM knows what you're building
  4. One LLM call per conflicted file — sends both branch commit histories, both full file versions, and each conflict hunk with surrounding context
  5. Self-validates — if hunk count doesn't match, skips the file and tells you to resolve manually
  6. Summary call — a second LLM call synthesises all per-file resolutions into a plain-English "what this merge will do" summary
  7. You confirm — one Y/n. Then it writes and git adds everything.

confidence levels

Every resolved file gets a confidence rating:

Level Meaning
HIGH both changes are in clearly different parts of the code, no semantic overlap
MEDIUM changes interact — resolution is probably right but verify the integration
LOW genuinely ambiguous — the LLM resolved it but you should read this one manually

LOW confidence files always get a ⚠ heads up block in the panel explaining exactly what to check.


what it doesn't do (yet)

  • Rebase conflict resolution
  • Multi-file semantic understanding (e.g. a type changed in one file and needs updating in five others)
  • Auto-commit after merge

license

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_wtf-0.1.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_wtf-0.1.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file git_wtf-0.1.0.tar.gz.

File metadata

  • Download URL: git_wtf-0.1.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for git_wtf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e111ae21ea2e67e8676f14b577b2fae6ee0c2c5a2a6be1bb93d6ab044ec371d3
MD5 89073140a0c6deebf1157dbbb2f5f82f
BLAKE2b-256 244dfdfce9056f84f66240bfde6a5b3fcad88f7685f7668654c3e45eee486ec1

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_wtf-0.1.0.tar.gz:

Publisher: publish.yml on prod-ric/git_wtf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_wtf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: git_wtf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for git_wtf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5888453b4ff838c02130de98b9a02c3de023cde1376f8758e4ff07929125d115
MD5 ba2bb961f079dab18ff965a2a0b3762e
BLAKE2b-256 a7ea1d22db7e2ff08373c336b852806ea812bac1f36d510fc747f88cbeb74e7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_wtf-0.1.0-py3-none-any.whl:

Publisher: publish.yml on prod-ric/git_wtf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page