Commands Reference
Complete documentation for the gitresolve CLI tool.
gitresolve scanThe scan command is your early-warning system. By leveraging git merge-tree, it simulates a merge between your current HEAD and a target branch to find potential overlaps before you even run a merge command.
Scanning for potential conflicts against main...
Potential conflicts detected: 2 files/blocks.
Conflict hints:
- Conflict (modify/modify): internal/db/schema.go
- Conflict (add/add): config/default.yaml
--target <branch>The target branch to compare against (defaults to main).
gitresolve statusDisplays the current unmerged blocks, categorized by their Severity Score and auto-resolution eligibility. Unlike standard git status, this looks inside files to identify logical overlap patterns.
Conflict Status Check: SCORE TYPE AUTO FILE
5 whitespace yes internal/net/socket.go
10 imports yes main.go
99 logic-overlap no pkg/auth/handler.go
Total conflict blocks: 3
Trivial (0-10)
Safe for auto-merge. Whitespace or simple import deduplication.
Structural (11-50)
Requires syntax verification gates or policy-based strategy.
High Risk (99+)
Logical overlaps that default to manual review or strict policy escalation.
gitresolve mergeThe merge command performs non-interactive resolution. It only applies changes that the engine is confident in through deterministic rules or configured policy profiles.
Scanning index. Found 2 unmerged conflicts...
--- Processing internal/net/socket.go --- > Successfully auto-resolved 100% of conflicts and staged.
--- Processing pkg/auth/handler.go --- > Escalating conflict [Severity 99] LogicOverlap
Merge scan complete. 1 file resolved, 1 requires manual review.
--dry-runPreview auto-resolutions without modifying any files.
--policy-profile <profile>Apply a risk posture (auto/strict/balanced/aggressive).
--max-file-bytes <bytes>Skip files larger than this limit (default 10MB). Set to -1 for unlimited.
--no-auto-structuredDisable auto-resolution for JSON/YAML/TOML files.
--shadowSimulate resolution and record hash diffs to logs.
gitresolve resolveThe primary interactive interface. Use resolve to step through conflicted blocks. It combines auto-resolution for trivial blocks with an interactive prompt for logical conflicts.
[Scalar] main.go (L21-25)
[O]urs: // this comment is different
[T]heirs: // this is a comment
Options: [O]urs [T]heirs [B]oth [M]anual edit [S]kip
Select [O/T/B/M/S]: _
--non-interactiveExit with status 1 if any conflict requires human input. Perfect for CI gates.
--timeout <duration>Auto-select 'theirs' after a timeout (e.g., 30s) during interactive prompts.
--strategy <type>Force a fixed strategy (ours/theirs/both) for all automatable conflicts.
--enforce-gatesApply release gates based on manual escalation rates.
--manual-rate-gate <%>Maximum allowed percentage of manual escalations (default 60%).
--log-level <level>Set log level: error, warn, info, debug, trace (default: warn).
-v, --verboseShorthand for --log-level info. Enables detailed structured logging.
gitresolve blameQueries the session log to output the history of conflicts and resolutions. Essential for post-mortem audits and identifying repetitive conflict patterns.
--patternsDisplay an analysis of conflict pattern frequencies over time.
--file <path>Filter history for a specific file.
gitresolve statsReports decision metrics and top reason codes from local observability logs. Use this to monitor your team's automation efficiency.
--jsonEmit metrics as a machine-readable JSON object for CI pipes.
--top <N>Show the top N escalation reason codes (default 8).
--operation <all/resolve/merge>Filter stats by specific operation type.
gitresolve undoRestores the repository to a recorded snapshot SHA from a recent session. Every time a write occurs, a pre-resolution snapshot is captured.
--steps <N>Undo the last N operations (default 1).