CMDgitresolve scan
Predictive Conflict Detection

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

$ gitresolve scan --target main
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).

CMDgitresolve status
Real-time Conflict Indexing

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

$ gitresolve status
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.

CMDgitresolve merge
Autonomous Smart Triage

The merge command performs non-interactive resolution. It only applies changes that the engine is confident in through deterministic rules or configured policy profiles.

$ gitresolve merge
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-run

Preview 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-structured

Disable auto-resolution for JSON/YAML/TOML files.

--shadow

Simulate resolution and record hash diffs to logs.

CMDgitresolve resolve
Interactive Conflict Orchestration

The primary interactive interface. Use resolve to step through conflicted blocks. It combines auto-resolution for trivial blocks with an interactive prompt for logical conflicts.

$ gitresolve resolve
[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-interactive

Exit 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-gates

Apply 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, --verbose

Shorthand for --log-level info. Enables detailed structured logging.

CMDgitresolve blame
Conflict Auditability

Queries the session log to output the history of conflicts and resolutions. Essential for post-mortem audits and identifying repetitive conflict patterns.

--patterns

Display an analysis of conflict pattern frequencies over time.

--file <path>

Filter history for a specific file.

CMDgitresolve stats
Observability & Metrics

Reports decision metrics and top reason codes from local observability logs. Use this to monitor your team's automation efficiency.

--json

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

CMDgitresolve undo
Fail-safe Rollback

Restores 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).