CLI Commands
gitwand resolve
Auto-resolve trivial merge conflicts.
gitwand resolve [files...] [options]Arguments
| Argument | Description |
|---|---|
files... | File paths to resolve. If omitted, auto-discovers via git diff --name-only --diff-filter=U |
Options
| Option | Description |
|---|---|
--dry-run | Analyze conflicts without writing files |
--verbose | Show per-hunk details (line number, type, explanation) |
--no-whitespace | Skip whitespace-only conflicts |
--ci | CI mode: JSON output, exit code 1 if unresolved |
--json | Alias for --ci |
--resolve-generated | Auto-resolve generated files (lockfiles, dist/) — declined by default: regenerate them instead |
--regenerate | Re-run the ecosystem's generator (npm/pnpm/yarn-berry/composer/cargo) for declined lockfiles once their source of truth is clean/resolved (sandboxed git worktree, opt-in — see .gitwandrc "regenerate": true) |
--concurrency=N | Parallel file workers (default 8, min 1) |
--llm-fallback | Enable LLM fallback for unresolved conflicts (opt-in, experimental) |
--llm-provider=X | LLM provider: claude (default) | openai | ollama |
--llm-model=X | Model name (e.g. claude-sonnet-4-6, gpt-4o-mini, llama3) |
Examples
# Resolve all conflicts in the repo
gitwand resolve
# Dry run with details
gitwand resolve --dry-run --verbose
# Resolve specific files
gitwand resolve src/config.ts package-lock.json
# CI pipeline usage
gitwand resolve --ci || echo "Unresolved conflicts remain"Exit Codes
| Code | Meaning |
|---|---|
0 | All conflicts resolved or no conflicts found |
1 | Unresolved conflicts remain (CI mode only) |
Human Output
✨ GitWand — Git's magic wand
✓ src/config.ts 2/2 resolved
◐ src/utils.ts 1/3 resolved
✗ src/complex.ts 0/1 resolved
Summary: 3/6 conflict(s) auto-resolved across 3 file(s)
1 conflict(s) remainingWith --verbose, each hunk shows:
✓ src/config.ts 2/2 resolved
Line 15: one_side_change → resolved (Only one side modified this block)
Line 42: same_change → resolved (Both sides made identical changes)CI/JSON Output
{
"version": "0.1.0",
"timestamp": "2026-04-14T12:00:00.000Z",
"summary": {
"files": 2,
"totalConflicts": 5,
"autoResolved": 4,
"remaining": 1,
"allResolved": false
},
"files": [
{
"path": "src/config.ts",
"totalConflicts": 2,
"autoResolved": 2,
"remaining": 0,
"validation": {
"isValid": true,
"hasResidualMarkers": false,
"syntaxError": null
},
"resolutions": [
{
"line": 15,
"type": "one_side_change",
"resolved": true,
"explanation": "Only one side modified this block",
"confidence": {
"score": 95,
"label": "certain",
"typeClassification": 100,
"dataRisk": 5,
"scopeImpact": 10
},
"trace": {
"selected": "theirs",
"hasBase": true,
"summary": "One-side change detected — incoming accepted.",
"steps": ["..."]
}
}
],
"pendingHunks": []
},
{
"path": "src/complex.ts",
"totalConflicts": 3,
"autoResolved": 2,
"remaining": 1,
"validation": {
"isValid": false,
"hasResidualMarkers": true,
"syntaxError": null
},
"resolutions": ["..."],
"pendingHunks": [
{
"line": 42,
"type": "complex",
"explanation": "Overlapping edits on both sides.",
"ours": "const timeout = 5000;",
"theirs": "const timeout = 10000;\nconst retries = 3;",
"base": "const timeout = 3000;",
"trace": {
"selected": null,
"summary": "Both sides modified — manual resolution required.",
"steps": ["..."]
}
}
]
}
]
}New fields in v1.1:
| Field | Description |
|---|---|
validation | Post-resolution check: residual markers, syntax errors |
confidence | Composite score (0–100) with dimensional breakdown |
trace | Full DecisionTrace: selected side, base availability, step-by-step reasoning |
pendingHunks | Unresolved conflicts with ours/theirs/base content for LLM-assisted resolution |
gitwand status
Show the conflict status for the current repository.
gitwand statusReports the number of conflicted files, total conflicts, and how many are auto-resolvable.
gitwand conventions
Measures this repo's own merge conventions from its historical merges (which side wins version scalars, whether the team regenerates or merges lockfiles, how the changelog is maintained) and writes the verdicts to .git/gitwand/conventions.json — per clone, never committed, always beaten by an explicit .gitwandrc.
Options
| Option | Description |
|---|---|
--show | Print the currently persisted conventions without re-measuring |
--clear | Delete the persisted conventions file |
--max-merges=N | Cap on historical merges replayed (default 200) |
--json | Machine-readable output |
Example
$ gitwand conventions
measured on 187 merges / 412 conflicted files (engine 3.8.0, 2026-08-27)
generated files regenerate (11 samples, 91 %)
changelog tool-rebuilt (8 samples, 100 %)
✓ written to .git/gitwand/conventions.json (per-clone, never committed; an explicit .gitwandrc always wins)gitwand advent
Opens a door of the Git Advent Calendar (December 1–24): one Git tip a day, with a snippet you can run.
gitwand advent # today's door
gitwand advent 5 # door 5Doors that are not open yet are reported as locked. Once the calendar is over (December 25 onwards) every door stays open.
Arguments
| Argument | Description |
|---|---|
[day] | Door number, an integer from 1 to 24. Defaults to today's door |
Options
| Option | Description |
|---|---|
--json | Machine-readable output |
JSON output
Each call prints one JSON document; its status says which shape it is.
door — an unlocked door:
{
"status": "door",
"door": {
"day": 8,
"command": "git log -L",
"problem": "Who broke this function, and when?",
"snippet": "git log -L :parseHunk:src/parse.ts\ngit log -L 40,60:src/parse.ts",
"explanation": "Shows every commit that touched that function (or that line range), with the diff trimmed to just those lines. It's the history of a piece of code, not of a whole file.",
"tip": "In GitWand's blame view, each block has **Show history for these lines**, which is `git log -L` on that range in one click."
}
}locked — a door that opens later in December:
{
"status": "locked",
"day": 18,
"opensOn": "2026-12-18"
}not-started — before December 1:
{
"status": "not-started",
"startsOn": "2026-12-01"
}over — gitwand advent with no day, from December 25 on:
{
"status": "over"
}error — an unknown door (exit code 2):
{
"status": "error",
"error": "Unknown door \"31\" — pick a day from 1 to 24."
}tip and readMore (a full https://gitwand.app/… URL) appear only on doors that have one; the sample door has no readMore.
Exit Codes
| Code | Meaning |
|---|---|
0 | A door, a locked door, or a calendar status message |
2 | Unknown door |
gitwand --help
Show usage information.
gitwand --help