merge-prep

Analyzes Git branches before merging to detect conflicts and generate suggested merge commands.

189|25|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/sd0xdev/sd0x-harness --skill merge-prep-sd0xdev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: merge-prep
Source: https://github.com/sd0xdev/sd0x-harness/tree/main/skills/merge-prep
Command: npx skills add https://github.com/sd0xdev/sd0x-harness --skill merge-prep-sd0xdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Merging branches blind can lead to unexpected conflicts and broken code. This Skill performs a pre-merge analysis of a source branch against a target branch, reporting commit stats, affected files, and predicted conflicts before you run any merge command. ## Core Features & Use Cases - Pre-merge Analysis: Computes merge base, commit counts on both sides, and changed-file statistics via a shell script that outputs structured JSON. - Conflict Detection & Resolution Suggestions: Uses git merge-tree to predict conflicts and classifies each conflict file by pattern (iterative, parallel, hotfix, add/add) with a suggested resolution strategy. - Analysis-Only Safety: Never executes merge, commit, push, or rebase — it only outputs suggested commands for manual execution, including multi-branch mode with a recommended merge order. - Use Case: Before merging a feature branch with 12 commits into main, run the analysis to learn that 9 files will conflict and receive per-file resolution suggestions plus ready-to-run merge commands. ## Quick Start Ask the assistant to run merge prep on your feature branch against main to see commit stats, predicted conflicts, and suggested merge commands.

Frequently Asked Questions about merge-prep

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check for merge conflicts before merging a Git branch?▼

Run the pre-merge analysis, which uses git merge-tree to perform a dry-run merge between your source and target branches. It reports whether conflicts exist and lists the exact conflicted files without modifying your working tree.

How to analyze commits and changed files between two Git branches?▼

The analysis script computes the merge base, counts commits unique to each branch, and produces diff statistics between the merge base and source branch. Results are returned as JSON including recent commit history.

Does merge-prep automatically merge or push my branches?▼

No. It is analysis-only by design and never executes git merge, commit, push, or rebase. It outputs suggested merge commands for both merge-commit and squash strategies that you run manually.

What Git version is needed for conflict detection with merge-tree?▼

Conflict detection relies on git merge-tree --write-tree, which requires Git 2.38 or newer. Older Git versions will cause the script to fail with an error rather than silently skipping conflict checks.

Can I analyze multiple branches before merging them into one target?▼

Yes, multi-branch mode accepts several source branches with a shared target. It analyzes each branch sequentially, outputs a combined summary, and suggests a merge order starting with the fewest conflicts.

When should I not use pre-merge analysis?▼

Skip it when you only need to view a diff, want to commit code, or plan to rebase — use git diff, a commit workflow, or manual rebase instead. Merges to production main branches should still go through a manual PR flow.