Risk Management

Not all code carries the same risk. A conflict in a documentation file is trivial, while a conflict in a payment processing handler is critical. Policy profiles allow you to tune gitresolve's automation threshold based on the file's importance.

STRICT

Maximum escalation. Blocks 'Both' strategy for all source files. Forced manual review for sensitive paths.

BALANCED

Default posture. Auto-resolves trivial blocks but escalates on semantic structural changes.

AGGRESSIVE

Maximum automation. Suitable for generated code, logs, or documentation where safety gates can be relaxed.

AUTO

Dynamic resolution. Matches files against .gitresolve/policy.json for path-specific overrides.

Configuration: policy.json

Create a .gitresolve/policy.json at your repository root to define fine-grained rules.

.gitresolve/policy.json
{ "default": "balanced", "path_profiles": { "internal/auth/": "strict", "internal/payments/": "strict", "docs/": "aggressive", "scripts/": "aggressive" }, "team_profiles": { "security-ops": "strict", "dx-team": "aggressive" } }

Resolution Logic

Path Overrides

The engine uses a longest-path match. If a file is in internal/auth/utils.go, it receives the "strict" profile even if the rest of internal/ is balanced.

Previewing Policy

You can preview which profile is active for a file by running:

gitresolve resolve --policy-profile auto --dry-run path/to/file.go