[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QJ0HVJWGAR01D7ME51N60S":3,"skill-same:01M6QJ0HVJWGAR01D7ME51N60S":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":13,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M6QJ0HVJWGAR01D7ME51N60S","git-merge-resolution",null,"Master git merge conflict resolution: when to merge vs rebase, conflict handling strategies, and maintaining clean merge history. Use when user encounters merge conflicts, git merge issues, or when they need to combine branch histories. Triggers especially when user says \"merge conflict\", \"resolve conflicts\", \"git merge\", \"merge strategy\", or \"conflicts in git\".","ImaginerLabs\u002Fskill-manager","ImaginerLabs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F214277308?v=4","01M6QGGDPNF15RMMT1RCFDH9FN","01M6QGGDTH5BY64DQ123NR8M33",0,"MIT","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fcoding\u002Fgit-merge-resolution\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"git merge","git merge resolution","resolution","merge","git","master","combine","triggers","conflict","strategies","clean","conflicts","issues","conflict resolution","use","strategy","branch","history","coding","rebase","2026-11-10 10:12:30",false,"---\nname: git-merge-resolution\ndescription: >-\n  Master git merge conflict resolution: when to merge vs rebase, conflict handling strategies, and maintaining clean merge history. Use when user encounters merge conflicts, git merge issues, or when they need to combine branch histories. Triggers especially when user says \"merge conflict\", \"resolve conflicts\", \"git merge\", \"merge strategy\", or \"conflicts in git\".\ncategory: coding\npriority: P2\ntrigger_patterns:\n  - \"merge conflict\"\n  - \"resolve conflicts\"\n  - \"git merge\"\n  - \"merge strategy\"\n  - \"conflicts in git\"\n---\n\n# Git Merge Resolution — Conflict Handling Framework\n\n## Overview\n\nGit-merge-resolution is a **behavioral specification skill** that encapsulates the judgment of **when to merge, how to handle conflicts, and how to maintain clean merge history**.\n\nThis skill embodies the experience of developers who've merged hundreds of branches and know that most merge conflicts are preventable through strategy, not just resolution.\n\n## Core Philosophy\n\n### The Merge Truth\n\n> \"Merge conflicts aren't bugs — they're Git's way of saying 'I need a human to make a decision.' The conflict is easy. Deciding WHICH version to keep is the real work.\"\n\n### Merge vs Rebase Decision\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                   MERGE vs REBASE                              │\n│                                                               │\n│    USE MERGE WHEN:                                           │\n│    ✓ Merging shared\u002Fpublic branches                          │\n│    ✓ Preserving exact history is important                   │\n│    ✓ Complex conflicts (single merge commit easier)          │\n│    ✓ Team prefers merge commits                             │\n│                                                               │\n│    USE REBASE WHEN:                                          │\n│    ✓ Local-only feature branches                             │\n│    ✓ Clean linear history desired                           │\n│    ✓ Regular sync with main (avoid merge bubbles)            │\n│    ✓ Interactive cleanup before PR                          │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Decision Framework\n\n### When to Merge\n\n| Situation | Action | Rationale |\n|-----------|--------|-----------|\n| Merging main to feature | Rebase OR Merge | Either works |\n| Merging feature to main | MERGE | Main is shared |\n| Merging release branch | MERGE | Preserves release point |\n| Merging hotfix | MERGE | Quick, clear |\n| Team convention | Follow | Consistency matters |\n\n### Conflict Risk Assessment\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                   CONFLICT RISK MATRIX                       │\n│                                                               │\n│    Low Risk (Merge OK)         High Risk (Review First)      │\n│    ─────────────────           ────────────────────────       │\n│    • Same files, no overlap   • Same files, same lines      │\n│    • Well-structured commits   • Large features merged        │\n│    • Small changes            • Long-running branches        │\n│    • Good test coverage       • Multiple people contributed  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Behavioral Specification\n\n### Phase 1: Pre-Merge Preparation\n\n#### 1.1 Assess the Situation\n\n```bash\n# See what changed in target branch\ngit fetch origin\ngit log main..origin\u002Fmain --oneline\n\n# See what changed in your branch\ngit log origin\u002Fmain..HEAD --oneline\n\n# Find potential conflict areas\ngit diff --name-only origin\u002Fmain...HEAD\n```\n\n#### 1.2 Prepare for Merge\n\n```bash\n# Update all refs\ngit fetch --all\n\n# Create merge backup branch (safety!)\ngit branch backup\u002Ffeature-xyz\n\n# Verify target branch is clean\ngit checkout target-branch\ngit status\n```\n\n### Phase 2: Merge Execution\n\n#### 2.1 Standard Merge\n\n```bash\n# Start merge\ngit checkout feature-branch\ngit merge main\n\n# If successful (fast-forward or clean)\n# Git will create merge commit automatically\n\n# If conflicts occur → resolve then commit\n```\n\n#### 2.2 Merge Strategies\n\n```bash\n# Fast-forward only (no merge commit)\ngit merge --ff-only main\n\n# Force merge commit (even if fast-forward possible)\ngit merge --no-ff main\n\n# Squash merge (all commits into one)\ngit merge --squash feature-branch\n\n# Ours strategy (keep our version, ignore theirs)\ngit merge -s ours feature-branch\n\n# Patience strategy (slower but better for renames)\ngit merge -X patience feature-branch\n```\n\n### Phase 3: Conflict Resolution\n\n#### 3.1 Understanding Conflicts\n\n```markdown\n## What Git Tells You\n\nWhen conflicts occur, Git shows:\n\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD (your changes)\nconst x = 1;\n=======\nconst x = 2;\n>>>>>>> feature-branch (their changes)\n\nGit cannot automatically decide because:\n- Both versions modified the same lines\n- Git doesn't know which is \"correct\"\n\nYour job: Decide what the final code should be\n```\n\n#### 3.2 Conflict Resolution Protocol\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                 CONFLICT RESOLUTION STEPS                     │\n│                                                               │\n│  1. IDENTIFY: Find conflicting files                         │\n│     git status (shows \"both modified\")                        │\n│                                                               │\n│  2. UNDERSTAND: What did each side change?                   │\n│     git diff --base conflicted-file                           │\n│     git diff --ours conflicted-file                          │\n│     git diff --theirs conflicted-file                        │\n│                                                               │\n│  3. DECIDE: What should the final code be?                    │\n│     - Ours only?                                             │\n│     - Theirs only?                                           │\n│     - A combination?                                         │\n│     - Something entirely different?                           │\n│                                                               │\n│  4. EDIT: Resolve the conflict markers                       │\n│     \u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD                                             │\n│     [your version]                                           │\n│     =======                                                  │\n│     [their version]                                          │\n│     >>>>>>> feature-branch                                    │\n│     Replace with final version, remove markers               │\n│                                                               │\n│  5. TEST: Verify the resolution                              │\n│     npm test                                                 │\n│                                                               │\n│  6. STAGE & COMMIT                                           │\n│     git add resolved-file                                     │\n│     git commit (merge commit auto-created)                   │\n└─────────────────────────────────────────────────────────────┘\n```\n\n#### 3.3 Conflict Resolution Strategies\n\n```bash\n# Accept OUR changes completely\ngit checkout --ours conflicted-file\ngit add conflicted-file\n\n# Accept THEIR changes completely\ngit checkout --theirs conflicted-file\ngit add conflicted-file\n\n# Manual resolution (preferred)\n# Edit the file, keeping what makes sense\n# Remove conflict markers\n# Add when done\ngit add conflicted-file\n```\n\n#### 3.4 Useful Commands for Understanding\n\n```bash\n# See common ancestor version\ngit show :1:conflicted-file  # common ancestor\n\n# See our version (HEAD)\ngit show :2:conflicted-file  # ours\n\n# See their version\ngit show :3:conflicted-file  # theirs\n\n# Or use git mergetool\ngit mergetool\n```\n\n### Phase 4: Post-Merge Validation\n\n#### 4.1 Verification Checklist\n\n```bash\n# Run tests\nnpm test\n\n# Check the merge commit\ngit log -1 --stat\n\n# Verify no missing conflicts\ngit status\n\n# Build to catch any issues\nnpm run build\n```\n\n#### 4.2 Common Post-Merge Issues\n\n| Issue | Symptom | Fix |\n|-------|---------|-----|\n| Lost changes | Tests failing after merge | Check original branch commits |\n| Inconsistent state | Build errors | Clean rebuild |\n| Dependencies | Import errors | Reinstall deps |\n\n## Conflict Patterns\n\n### Pattern 1: Same Line, Different Changes\n\n```typescript\n\u002F\u002F CONFICT:\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nconst MAX_RETRIES = 3;\n=======\nconst MAX_RETRIES = 5;\n>>>>>>> feature-branch\n\n\u002F\u002F RESOLUTION:\n\u002F\u002F If both are valid, pick larger or add comment\nconst MAX_RETRIES = 5; \u002F\u002F Increased for flaky API\n```\n\n### Pattern 2: Same Function, Different Implementation\n\n```typescript\n\u002F\u002F CONFLICT:\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nfunction calculateTotal(items: Item[]): number {\n  return items.reduce((sum, item) => sum + item.price, 0);\n}\n=======\nfunction calculateTotal(items: Item[]): number {\n  return items\n    .filter(item => item.active)\n    .reduce((sum, item) => sum + item.price, 0);\n}\n>>>>>>> feature-branch\n\n\u002F\u002F RESOLUTION: Both changes needed!\n\u002F\u002F Take the feature's change\nfunction calculateTotal(items: Item[]): number {\n  return items\n    .filter(item => item.active)\n    .reduce((sum, item) => sum + item.price, 0);\n}\n```\n\n### Pattern 3: Deleted vs Modified\n\n```typescript\n\u002F\u002F CONFLICT:\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nconst API_URL = 'https:\u002F\u002Fapi.example.com';\n=======\n\u002F\u002F API_URL was removed\n>>>>>>> feature-branch\n\n\u002F\u002F RESOLUTION:\n\u002F\u002F Ask: Should the URL exist or not?\n\u002F\u002F If feature removed it intentionally → theirs\n\u002F\u002F If main changed away from it → needs discussion\n```\n\n## Merge Strategies Deep Dive\n\n### Strategy 1: Fast-Forward Merge\n\n```bash\n# Only possible when no divergent commits\ngit merge --ff-only feature-branch\n\n# Result: No merge commit, just moves pointer\n# Good: Clean history\n# Bad: No merge record if revert needed\n```\n\n### Strategy 2: No Fast-Forward (Create Merge Commit)\n\n```bash\n# Always creates merge commit\ngit merge --no-ff feature-branch\n\n# Result: Merge commit with two parents\n# Good: Clear merge record, easy to revert\n# Bad: Cluttered history if overused\n```\n\n### Strategy 3: Squash Merge\n\n```bash\n# Combines all commits into one\ngit merge --squash feature-branch\ngit commit -m \"feat: complete user authentication\"\n\n# Result: Single commit on main\n# Good: Very clean history\n# Bad: Loses individual commit history\n```\n\n### Strategy 4: Three-Way Merge\n\n```bash\n# Git finds common ancestor and combines\ngit merge feature-branch\n\n# Result: Merge commit if conflicts\n# Good: Preserves history\n# Bad: Can have complex conflicts\n```\n\n## Common Scenarios\n\n### Scenario 1: \"Large merge with many conflicts\"\n\n```markdown\n## Strategy: Incremental Merge\n\nInstead of merging feature\u002Fentire-overhaul into main at once:\n\n1. Merge small pieces first:\n   git merge feature\u002Fpart-1  # Auth\n   git merge feature\u002Fpart-2  # User profiles\n\n2. Each merge is smaller, easier to resolve\n\n3. If conflicts between parts, resolve incrementally\n\n4. Final merge to main has less risk\n```\n\n### Scenario 2: \"I made changes that conflict with main\"\n\n```bash\n# Option A: Rebase onto main first\ngit fetch origin\ngit rebase origin\u002Fmain\n# Resolve conflicts during rebase\n# Then merge (likely fast-forward)\n\n# Option B: Merge main into your branch\ngit fetch origin\ngit merge origin\u002Fmain\n# Resolve conflicts in your branch\n# Then merge to main\n```\n\n### Scenario 3: \"Merge failed, but I made things worse\"\n\n```bash\n# ABORT the merge\ngit merge --abort\n\n# Start fresh\ngit checkout feature-branch\ngit merge main\n\n# Or restore from backup\ngit checkout -b restored-feature backup\u002Ffeature-xyz\n```\n\n## The Merge Resolution Checklist\n\n```\nMERGE RESOLUTION CHECKLIST\n==========================\n\nPRE-MERGE:\n□ Fetched and updated branches\n□ Reviewed what changed in each branch\n□ Created backup branch\n□ Verified clean working directory\n□ Assessed conflict risk\n\nDURING:\n□ Identified all conflicting files\n□ Understood what each side changed\n□ Made conscious decision on each conflict\n□ Tested resolution compiles\u002Fruns\n□ No conflict markers left\n\nPOST-MERGE:\n□ Run full test suite\n□ Review merge commit message\n□ Verify no unintended changes\n□ Push if ready\n□ Notify team of significant changes\n```\n\n## Key Principles\n\n### 1. Understand Before Deciding\n\nDon't just pick \"ours\" or \"theirs\" blindly. Understand what each version does and why.\n\n### 2. Small Merges Are Safer\n\nMerging 5 small commits is safer than merging 1 large one.\n\n### 3. Test After Resolving\n\nJust because it compiles doesn't mean it's right. Run tests.\n\n### 4. Communication Matters\n\nIf merging branches from teammates, talk to them about conflicting changes.\n\n### 5. Commit the Resolution\n\nDon't leave conflicts staged. Commit the merge to complete it.\n\n## Anti-Patterns\n\n### 1. Blindly Taking One Side\n\n```bash\n# BAD: Just taking all ours or all theirs\ngit checkout --ours .\ngit add .\n\n# This loses work!\n\n# GOOD: Evaluate each conflict\n```\n\n### 2. Leaving Conflict Markers\n\n```typescript\n\u002F\u002F BAD: Still has markers\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nconst x = 1;\n=======\nconst x = 2;\n>>>>>>> feature-branch\n\n\u002F\u002F Must remove these before committing!\n```\n\n### 3. Not Testing After Merge\n\n```bash\n# BAD: \"Looks fine, pushing...\"\ngit commit -m \"Merge\"\ngit push\n\n# Tests fail in CI\n\n# GOOD: Always test before pushing\nnpm test\n```\n\n## Relationship to Other Skills\n\n- `git-branch-strategy` — Branch planning affects merge frequency\n- `git-rebase-safety` — Alternative to merge for local branches\n- `git-history-rewrite` — Cleaning up history before merge\n- `pre-commit-review` — Review after merge\n- `git-stash-management` — Stashing during merge interruptions\n","# Git Merge Resolution — Conflict Handling Framework\n\n## Overview\n\nGit-merge-resolution is a **behavioral specification skill** that encapsulates the judgment of **when to merge, how to handle conflicts, and how to maintain clean merge history**.\n\nThis skill embodies the experience of developers who've merged hundreds of branches and know that most merge conflicts are preventable through strategy, not just resolution.\n\n## Core Philosophy\n\n### The Merge Truth\n\n> \"Merge conflicts aren't bugs — they're Git's way of saying 'I need a human to make a decision.' The conflict is easy. Deciding WHICH version to keep is the real work.\"\n\n### Merge vs Rebase Decision\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                   MERGE vs REBASE                              │\n│                                                               │\n│    USE MERGE WHEN:                                           │\n│    ✓ Merging shared\u002Fpublic branches                          │\n│    ✓ Preserving exact history is important                   │\n│    ✓ Complex conflicts (single merge commit easier)          │\n│    ✓ Team prefers merge commits                             │\n│                                                               │\n│    USE REBASE WHEN:                                          │\n│    ✓ Local-only feature branches                             │\n│    ✓ Clean linear history desired                           │\n│    ✓ Regular sync with main (avoid merge bubbles)            │\n│    ✓ Interactive cleanup before PR                          │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Decision Framework\n\n### When to Merge\n\n| Situation | Action | Rationale |\n|-----------|--------|-----------|\n| Merging main to feature | Rebase OR Merge | Either works |\n| Merging feature to main | MERGE | Main is shared |\n| Merging release branch | MERGE | Preserves release point |\n| Merging hotfix | MERGE | Quick, clear |\n| Team convention | Follow | Consistency matters |\n\n### Conflict Risk Assessment\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                   CONFLICT RISK MATRIX                       │\n│                                                               │\n│    Low Risk (Merge OK)         High Risk (Review First)      │\n│    ─────────────────           ────────────────────────       │\n│    • Same files, no overlap   • Same files, same lines      │\n│    • Well-structured commits   • Large features merged        │\n│    • Small changes            • Long-running branches        │\n│    • Good test coverage       • Multiple people contributed  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Behavioral Specification\n\n### Phase 1: Pre-Merge Preparation\n\n#### 1.1 Assess the Situation\n\n```bash\n# See what changed in target branch\ngit fetch origin\ngit log main..origin\u002Fmain --oneline\n\n# See what changed in your branch\ngit log origin\u002Fmain..HEAD --oneline\n\n# Find potential conflict areas\ngit diff --name-only origin\u002Fmain...HEAD\n```\n\n#### 1.2 Prepare for Merge\n\n```bash\n# Update all refs\ngit fetch --all\n\n# Create merge backup branch (safety!)\ngit branch backup\u002Ffeature-xyz\n\n# Verify target branch is clean\ngit checkout target-branch\ngit status\n```\n\n### Phase 2: Merge Execution\n\n#### 2.1 Standard Merge\n\n```bash\n# Start merge\ngit checkout feature-branch\ngit merge main\n\n# If successful (fast-forward or clean)\n# Git will create merge commit automatically\n\n# If conflicts occur → resolve then commit\n```\n\n#### 2.2 Merge Strategies\n\n```bash\n# Fast-forward only (no merge commit)\ngit merge --ff-only main\n\n# Force merge commit (even if fast-forward possible)\ngit merge --no-ff main\n\n# Squash merge (all commits into one)\ngit merge --squash feature-branch\n\n# Ours strategy (keep our version, ignore theirs)\ngit merge -s ours feature-branch\n\n# Patience strategy (slower but better for renames)\ngit merge -X patience feature-branch\n```\n\n### Phase 3: Conflict Resolution\n\n#### 3.1 Understanding Conflicts\n\n```markdown\n## What Git Tells You\n\nWhen conflicts occur, Git shows:\n\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD (your changes)\nconst x = 1;\n=======\nconst x = 2;\n>>>>>>> feature-branch (their changes)\n\nGit cannot automatically decide because:\n- Both versions modified the same lines\n- Git doesn't know which is \"correct\"\n\nYour job: Decide what the final code should be\n```\n\n#### 3.2 Conflict Resolution Protocol\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                 CONFLICT RESOLUTION STEPS                     │\n│                                                               │\n│  1. IDENTIFY: Find conflicting files                         │\n│     git status (shows \"both modified\")                        │\n│                                                               │\n│  2. UNDERSTAND: What did each side change?                   │\n│     git diff --base conflicted-file                           │\n│     git diff --ours conflicted-file                          │\n│     git diff --theirs conflicted-file                        │\n│                                                               │\n│  3. DECIDE: What should the final code be?                    │\n│     - Ours only?                                             │\n│     - Theirs only?                                           │\n│     - A combination?                                         │\n│     - Something entirely different?                           │\n│                                                               │\n│  4. EDIT: Resolve the conflict markers                       │\n│     \u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD                                             │\n│     [your version]                                           │\n│     =======                                                  │\n│     [their version]                                          │\n│     >>>>>>> feature-branch                                    │\n│     Replace with final version, remove markers               │\n│                                                               │\n│  5. TEST: Verify the resolution                              │\n│     npm test                                                 │\n│                                                               │\n│  6. STAGE & COMMIT                                           │\n│     git add resolved-file                                     │\n│     git commit (merge commit auto-created)                   │\n└─────────────────────────────────────────────────────────────┘\n```\n\n#### 3.3 Conflict Resolution Strategies\n\n```bash\n# Accept OUR changes completely\ngit checkout --ours conflicted-file\ngit add conflicted-file\n\n# Accept THEIR changes completely\ngit checkout --theirs conflicted-file\ngit add conflicted-file\n\n# Manual resolution (preferred)\n# Edit the file, keeping what makes sense\n# Remove conflict markers\n# Add when done\ngit add conflicted-file\n```\n\n#### 3.4 Useful Commands for Understanding\n\n```bash\n# See common ancestor version\ngit show :1:conflicted-file  # common ancestor\n\n# See our version (HEAD)\ngit show :2:conflicted-file  # ours\n\n# See their version\ngit show :3:conflicted-file  # theirs\n\n# Or use git mergetool\ngit mergetool\n```\n\n### Phase 4: Post-Merge Validation\n\n#### 4.1 Verification Checklist\n\n```bash\n# Run tests\nnpm test\n\n# Check the merge commit\ngit log -1 --stat\n\n# Verify no missing conflicts\ngit status\n\n# Build to catch any issues\nnpm run build\n```\n\n#### 4.2 Common Post-Merge Issues\n\n| Issue | Symptom | Fix |\n|-------|---------|-----|\n| Lost changes | Tests failing after merge | Check original branch commits |\n| Inconsistent state | Build errors | Clean rebuild |\n| Dependencies | Import errors | Reinstall deps |\n\n## Conflict Patterns\n\n### Pattern 1: Same Line, Different Changes\n\n```typescript\n\u002F\u002F CONFICT:\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nconst MAX_RETRIES = 3;\n=======\nconst MAX_RETRIES = 5;\n>>>>>>> feature-branch\n\n\u002F\u002F RESOLUTION:\n\u002F\u002F If both are valid, pick larger or add comment\nconst MAX_RETRIES = 5; \u002F\u002F Increased for flaky API\n```\n\n### Pattern 2: Same Function, Different Implementation\n\n```typescript\n\u002F\u002F CONFLICT:\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nfunction calculateTotal(items: Item[]): number {\n  return items.reduce((sum, item) => sum + item.price, 0);\n}\n=======\nfunction calculateTotal(items: Item[]): number {\n  return items\n    .filter(item => item.active)\n    .reduce((sum, item) => sum + item.price, 0);\n}\n>>>>>>> feature-branch\n\n\u002F\u002F RESOLUTION: Both changes needed!\n\u002F\u002F Take the feature's change\nfunction calculateTotal(items: Item[]): number {\n  return items\n    .filter(item => item.active)\n    .reduce((sum, item) => sum + item.price, 0);\n}\n```\n\n### Pattern 3: Deleted vs Modified\n\n```typescript\n\u002F\u002F CONFLICT:\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nconst API_URL = 'https:\u002F\u002Fapi.example.com';\n=======\n\u002F\u002F API_URL was removed\n>>>>>>> feature-branch\n\n\u002F\u002F RESOLUTION:\n\u002F\u002F Ask: Should the URL exist or not?\n\u002F\u002F If feature removed it intentionally → theirs\n\u002F\u002F If main changed away from it → needs discussion\n```\n\n## Merge Strategies Deep Dive\n\n### Strategy 1: Fast-Forward Merge\n\n```bash\n# Only possible when no divergent commits\ngit merge --ff-only feature-branch\n\n# Result: No merge commit, just moves pointer\n# Good: Clean history\n# Bad: No merge record if revert needed\n```\n\n### Strategy 2: No Fast-Forward (Create Merge Commit)\n\n```bash\n# Always creates merge commit\ngit merge --no-ff feature-branch\n\n# Result: Merge commit with two parents\n# Good: Clear merge record, easy to revert\n# Bad: Cluttered history if overused\n```\n\n### Strategy 3: Squash Merge\n\n```bash\n# Combines all commits into one\ngit merge --squash feature-branch\ngit commit -m \"feat: complete user authentication\"\n\n# Result: Single commit on main\n# Good: Very clean history\n# Bad: Loses individual commit history\n```\n\n### Strategy 4: Three-Way Merge\n\n```bash\n# Git finds common ancestor and combines\ngit merge feature-branch\n\n# Result: Merge commit if conflicts\n# Good: Preserves history\n# Bad: Can have complex conflicts\n```\n\n## Common Scenarios\n\n### Scenario 1: \"Large merge with many conflicts\"\n\n```markdown\n## Strategy: Incremental Merge\n\nInstead of merging feature\u002Fentire-overhaul into main at once:\n\n1. Merge small pieces first:\n   git merge feature\u002Fpart-1  # Auth\n   git merge feature\u002Fpart-2  # User profiles\n\n2. Each merge is smaller, easier to resolve\n\n3. If conflicts between parts, resolve incrementally\n\n4. Final merge to main has less risk\n```\n\n### Scenario 2: \"I made changes that conflict with main\"\n\n```bash\n# Option A: Rebase onto main first\ngit fetch origin\ngit rebase origin\u002Fmain\n# Resolve conflicts during rebase\n# Then merge (likely fast-forward)\n\n# Option B: Merge main into your branch\ngit fetch origin\ngit merge origin\u002Fmain\n# Resolve conflicts in your branch\n# Then merge to main\n```\n\n### Scenario 3: \"Merge failed, but I made things worse\"\n\n```bash\n# ABORT the merge\ngit merge --abort\n\n# Start fresh\ngit checkout feature-branch\ngit merge main\n\n# Or restore from backup\ngit checkout -b restored-feature backup\u002Ffeature-xyz\n```\n\n## The Merge Resolution Checklist\n\n```\nMERGE RESOLUTION CHECKLIST\n==========================\n\nPRE-MERGE:\n□ Fetched and updated branches\n□ Reviewed what changed in each branch\n□ Created backup branch\n□ Verified clean working directory\n□ Assessed conflict risk\n\nDURING:\n□ Identified all conflicting files\n□ Understood what each side changed\n□ Made conscious decision on each conflict\n□ Tested resolution compiles\u002Fruns\n□ No conflict markers left\n\nPOST-MERGE:\n□ Run full test suite\n□ Review merge commit message\n□ Verify no unintended changes\n□ Push if ready\n□ Notify team of significant changes\n```\n\n## Key Principles\n\n### 1. Understand Before Deciding\n\nDon't just pick \"ours\" or \"theirs\" blindly. Understand what each version does and why.\n\n### 2. Small Merges Are Safer\n\nMerging 5 small commits is safer than merging 1 large one.\n\n### 3. Test After Resolving\n\nJust because it compiles doesn't mean it's right. Run tests.\n\n### 4. Communication Matters\n\nIf merging branches from teammates, talk to them about conflicting changes.\n\n### 5. Commit the Resolution\n\nDon't leave conflicts staged. Commit the merge to complete it.\n\n## Anti-Patterns\n\n### 1. Blindly Taking One Side\n\n```bash\n# BAD: Just taking all ours or all theirs\ngit checkout --ours .\ngit add .\n\n# This loses work!\n\n# GOOD: Evaluate each conflict\n```\n\n### 2. Leaving Conflict Markers\n\n```typescript\n\u002F\u002F BAD: Still has markers\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\nconst x = 1;\n=======\nconst x = 2;\n>>>>>>> feature-branch\n\n\u002F\u002F Must remove these before committing!\n```\n\n### 3. Not Testing After Merge\n\n```bash\n# BAD: \"Looks fine, pushing...\"\ngit commit -m \"Merge\"\ngit push\n\n# Tests fail in CI\n\n# GOOD: Always test before pushing\nnpm test\n```\n\n## Relationship to Other Skills\n\n- `git-branch-strategy` — Branch planning affects merge frequency\n- `git-rebase-safety` — Alternative to merge for local branches\n- `git-history-rewrite` — Cleaning up history before merge\n- `pre-commit-review` — Review after merge\n- `git-stash-management` — Stashing during merge interruptions\n",{"name":5,"category":36,"priority":43,"description":7,"trigger_patterns":44},"P2",[45,46,18,47,48],"merge conflict","resolve conflicts","merge strategy","conflicts in git","main","b9a52d8e27455bdad953d64928696d028223ea1b","skills\u002Fcoding\u002Fgit-merge-resolution","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager","https:\u002F\u002Fgithub.com\u002FImaginerLabs","2026-04-18 16:27:13",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add ImaginerLabs\u002Fskill-manager --skill git-merge-resolution",{"tool":61,"command":62},"bunx","bunx skills add ImaginerLabs\u002Fskill-manager --skill git-merge-resolution",{"tool":64,"command":65},"pnpm","pnpm dlx skills add ImaginerLabs\u002Fskill-manager --skill git-merge-resolution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fcoding\u002Fgit-merge-resolution\u002FSKILL.md",true,[],[70,105,126,154,190,216],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":86,"publishedAt":38},"01M6QJCB2SD5KHC41ZDQC0GA1T","meeting-minutes","Generate concise, actionable meeting minutes for internal meetings. Includes metadata, attendees, agenda, decisions, action items (owner + due date), and follow-up steps.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fwriting\u002Fmeeting-minutes\u002FSKILL.md",[76,81],{"categoryNo":77,"categoryName":78,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[87,88,89,90,91,92,93,94,95,96,72,49,97,98,99,100,101,102,103,104],"meeting minutes","meeting","minutes","writing","github","copilot","generate","decisions","meetings","up","agenda","actionable","concise","follow-up","tree","true","action","for",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":38},"01M6QJC71RRGTGNNFEHJG6S20G","documentation-writer","Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by the principles and structure of the Diátaxis technical documentation authoring framework.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fwriting\u002Fdocumentation-writer\u002FSKILL.md",[],[112,113,114,90,91,92,115,116,117,118,119,120,49,121,122,123,124,101,102,125],"documentation","documentation writer","writer","https","quality","technical","technical writer","expert","documentation expert","structure","authoring","software","principles","high",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":139,"publishedAt":38},"01M6QJC0V3C7C4R9768J1AJYWY","doc-coauthoring","Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fwriting\u002Fdoc-coauthoring\u002FSKILL.md",[132,135,136],{"categoryNo":133,"categoryName":134,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":77,"categoryName":78,"taxonomyType":79,"taxonomyTypeDesc":80},{"categoryNo":137,"categoryName":138,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000036","内容创作者",[140,141,90,142,143,112,144,145,146,147,148,149,49,150,151,122,152,153,101,104],"doc coauthoring","doc","workflow","official","tasks","decision","write","context","proposals","guide","refine","iteration","trigger","co",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":170,"publishedAt":38},"01M6QJBJ0YPVEWGEXZH3PJRRTT","code-review-workflow","Executes comprehensive 4-phase code review: basic review, quality check, bundle analysis, and test coverage. Should be used when the user mentions comprehensive code review, checking code quality, or reviewing staged changes with multi-phase analysis. This is the comprehensive review workflow, distinct from focused skills like frontend-code-review, staged-code-review, or code-change-test-designer.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002Fcode-review-workflow\u002FSKILL.md",[160,163,166,167],{"categoryNo":161,"categoryName":162,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":164,"categoryName":165,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":77,"categoryName":78,"taxonomyType":79,"taxonomyTypeDesc":80},{"categoryNo":168,"categoryName":169,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000030","开发工程师",[171,172,142,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189],"code review","review","code","code review workflow","testing","frontend","test","change","code quality","code-review","analysis","check","coverage","quality check","basic","multi","comprehensive code review","with","phase",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":194,"categories":195,"keywords":205,"publishedAt":38},"01M6QJB7XNHV3VEEQF4W7FMWF6","code-change-test-designer","Analyzes code changes and designs comprehensive test cases. Reads diffs, summarizes capability changes, and designs test cases covering main flows and edge cases. Should be used when the user mentions test coverage, designing tests for code changes, or analyzing diff\u002Fcommit for testing purposes. Distinguished from code-review-workflow which provides comprehensive review, this skill focuses on test case design for code changes.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002Fcode-change-test-designer\u002FSKILL.md",[196,197,200,201,202],{"categoryNo":164,"categoryName":165,"taxonomyType":79,"taxonomyTypeDesc":80},{"categoryNo":198,"categoryName":199,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":77,"categoryName":78,"taxonomyType":79,"taxonomyTypeDesc":80},{"categoryNo":168,"categoryName":169,"taxonomyType":84,"taxonomyTypeDesc":85},{"categoryNo":203,"categoryName":204,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000032","设计师",[177,178,173,206,207,175,208,209,142,210,180,211,183,212,49,213,214,215,104,189],"designer","code change test designer","design","diffs","commit","edge","diff","tests","flows","which",{"skillNo":217,"name":218,"nameZh":6,"description":219,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":220,"categories":221,"keywords":223,"publishedAt":38},"01M6QJB195WD7DCJWDMKWKB29S","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fmeta-skills\u002Fskill-creator\u002FSKILL.md",[222],{"categoryNo":77,"categoryName":78,"taxonomyType":79,"taxonomyTypeDesc":80},[224,225,226,227,143,228,229,230,231,232,181,233,234,235,49,236,237,101,104,218],"skill creator","creator","performance","run evals","variance analysis","create","run","benchmark","Meta","improve","edit","evals","optimize","existing skill"]