Resolve Merge Conflicts

by warpdotdev2a03b403b4f8No licenseListed Oct 8, 2026Updated Oct 8, 2026

Resolve Git merge conflicts by extracting only unresolved paths, conflict hunks, and compact diffs instead of loading whole files into context. Use when a merge, rebase, cherry-pick, or stash pop stops on conflicts, when `git status` shows unmerged paths, or when files contain conflict markers.

Includes scriptsSoftware Development
AI-generated overview

Resolves Git merge conflicts by extracting only unresolved paths, conflict hunks and compact diffs instead of whole files.

What it does
This skill guides an agent through resolving Git merge conflicts using a bundled Python script that extracts conflict context. The script prints a summary of unresolved paths, index stages and hunk counts, and can drill into one file or all files with nearby context, ours/base/theirs sections and a compact unified diff. It also supports JSON output and tunable context and line limits, and falls back to index-stage previews for conflicts without worktree markers. The workflow covers resolving files, re-checking unmerged paths and validating that no conflict markers remain.
When to use it
Use it when a merge, rebase, cherry-pick or stash pop stops on conflicts, when git status shows unmerged paths, or when files contain conflict markers. It is meant for keeping context small by inspecting one conflicted file at a time rather than opening full files.
Requirements
Requires Git and a Python 3 runtime to run the bundled script scripts/extract_conflict_context.py. The script is invoked with python3 and supports flags such as --file, --all, --json, --context and --max-lines.

Resolve Merge Conflicts

Overview

Resolve conflicts without opening full files unless the compact view is insufficient. Start with a summary, then inspect one conflicted file at a time.

Workflow

  1. Start with a summary.
bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py

Use the summary to identify which files are unresolved, which index stages exist, and how many text hunks each file contains.

  1. Drill into one file.
bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --file path/to/file

Prefer this over reading the whole file. The script prints only nearby context, the ours / base / theirs sections for each hunk, and a compact unified diff between ours and theirs.

  1. Resolve the file.
  • Take one side wholesale with git checkout --ours -- path/to/file or git checkout --theirs -- path/to/file when appropriate.
  • Otherwise edit the file directly and remove the conflict markers.
  • Read more of the file only if the compact output is not enough to decide the correct merge.
  1. Re-check unresolved files.
bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.pygit diff --name-only --diff-filter=U
  1. Validate the resolution.
  • Ensure no unmerged paths remain.
  • Ensure no <<<<<<<, =======, or >>>>>>> markers remain in the resolved files.
  • Run targeted tests, builds, or linters for the touched area.
  • Stage the resolved files.

Commands

Summary only

bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py

Detailed view for one file

bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --file path/to/file

Detailed view for all conflicted files

bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --all

JSON output

bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --file path/to/file --json

Tune output size

bash
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py \  --file path/to/file \  --context 3 \  --max-lines 60

Notes

  • Use the script before opening conflicted files directly.
  • Resolve one file at a time to keep context small.
  • Expect marker-based text conflicts and index-only conflicts such as add/add or modify/delete. The script summarizes both, and it falls back to index-stage previews when the worktree file has no conflict markers.

Source and attribution

Source:warpdotdev/common-skillsin.agents/skills/resolve-merge-conflictsat commit2a03b40

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal