Metadata-Version: 2.4
Name: git-wtf
Version: 0.1.1
Summary: AI-powered git assistant for when git is being git
Project-URL: Homepage, https://github.com/git-wtf/git-wtf
Project-URL: Repository, https://github.com/git-wtf/git-wtf
Project-URL: Issues, https://github.com/git-wtf/git-wtf/issues
Project-URL: Changelog, https://github.com/git-wtf/git-wtf/releases
Author-email: git-wtf <hi@git-wtf.sh>
License: MIT
Keywords: ai,cli,conflict,developer-tools,git,merge
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25.0
Requires-Dist: openai>=1.30.0
Requires-Dist: rich>=13.0.0
Description-Content-Type: text/markdown

# git-wtf

Both branches were doing something specific. `git wtf merge` reads what each was trying to do, keeps both, and explains every change — before writing a single file.

<p align="center">
  <img src="demo/demo.gif" alt="git wtf merge resolving a 2-file, 4-hunk conflict" width="900">
</p>

---

## install

**macOS**

```bash
brew install git-wtf/tap/git-wtf
```

**Any OS**

```bash
pipx install git-wtf
```

First time using pipx? Run `pipx ensurepath` and restart your terminal. Git picks up `git-wtf` automatically as a subcommand — no aliases required.

Then configure your LLM provider (30 seconds):

```bash
git wtf setup
```

> API keys, proxy config, env vars → [SETUP.md](SETUP.md)

Don't have a merge conflict handy? Run `git wtf --demo`.

---

## what it does

### `git wtf merge`

When two branches both modified the same code, git sees a text conflict. `git wtf merge` goes deeper — it reads the commit history on each side, extracts all three blob versions of every conflicted file, and asks the LLM: *what was each branch actually trying to accomplish?*

Then it writes a resolution that keeps both features intact.

Before touching disk it shows you:

- **Per-file panels** — what the file does now, a confidence rating (HIGH / MEDIUM / LOW), and a callout for anything it wasn't sure about
- **A plain-English summary** — what the app will do after this merge, what trade-offs were made
- **One prompt** — `apply this merge? [Y/n]`

Nothing is written until you say Y.

### `git wtf`

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

---

## how it works

- Parses conflict markers and extracts all three blob versions (ancestor, yours, theirs) with full file context
- Reads project context — `README.md`, `package.json`, `CLAUDE.md` / `.cursorrules` — so the LLM knows what you're building
- One LLM call per conflicted file, sent with both branches' full commit histories
- A second call synthesises a plain-English "what this merge will do" summary
- Shows everything, asks once, then writes and `git add`s

---

## 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
