resolve-conflicts

Solid

Analyze and resolve Git merge/rebase conflicts intelligently, showing diffs and asking clarifying questions when needed. Invoke with /resolve-conflicts.

Code & Development 8 stars 2 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
32
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Resolve Git Conflicts You are tasked with helping resolve Git merge or rebase conflicts. This command handles both active conflict states and proactive conflict preview/resolution. ## Step 1: Detect Conflict State First, determine the current state: ```bash # Check if we're in the middle of a merge git rev-parse --verify MERGE_HEAD 2>/dev/null && echo "MERGE_IN_PROGRESS" || echo "NO_MERGE" # Check if we're in the middle of a rebase test -d "$(git rev-parse --git-dir)/rebase-merge" -o -d "$(git rev-parse --git-dir)/rebase-apply" && echo "REBASE_IN_PROGRESS" || echo "NO_REBASE" # Check for unmerged files (active conflicts) git diff --name-only --diff-filter=U ``` Based on results: - **Active merge conflict**: MERGE_HEAD exists + unmerged files present - **Active rebase conflict**: rebase-merge/rebase-apply dir exists + unmerged files present - **No active conflict**: Can preview differences for potential conflicts ## Step 2: Gather Context ### Get Branch Information ```bash # Current branch git branch --show-current # Target branch (default: main) git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main" # Fetch latest to ensure accurate comparison git fetch origin ``` ### If Active Conflict Exists ```bash # List all conflicted files AND capture the list now — once files are staged # in Step 5, `--diff-filter=U` returns nothing. Step 7's merge commit message # reads this file. git diff --name-only --diff-filter=U | te...

Details

Author
mthines
Repository
mthines/agent-skills
Created
3 months ago
Last Updated
2 days ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category