Get the FREE Ultimate OpenClaw Setup Guide →

git:conflicts

Scanned
npx machina-cli add skill bendrucker/claude/conflicts --openclaw
Files (1)
SKILL.md
1.5 KB

Git Conflicts

Status

!bun ${CLAUDE_PLUGIN_ROOT}/skills/conflicts/scripts/status.ts

Context

!bun ${CLAUDE_PLUGIN_ROOT}/skills/conflicts/scripts/context.ts

Upstream

!bun ${CLAUDE_PLUGIN_ROOT}/skills/conflicts/scripts/upstream.ts

Three-Way Access

Git stores three versions in staging slots during conflicts:

SlotVersionCommand
:1:pathBase (common ancestor)git show :1:path
:2:pathOurs (HEAD)git show :2:path
:3:pathTheirs (incoming)git show :3:path

References

  • rerere.md — Automatic resolution reuse for repeated rebases

Source

git clone https://github.com/bendrucker/claude/blob/main/plugins/git/skills/conflicts/SKILL.mdView on GitHub

Overview

This skill guides you through resolving Git merge conflicts that arise during rebases, merges, or cherry-picks. It explains how Git stores three versions (base, ours, theirs) and how to inspect and resolve each conflict before continuing. You'll learn practical steps and tools to minimize disruption and keep history clean.

How This Skill Works

Git uses a three-way model during conflicts with slots for base (:1:path), ours (:2:path), and theirs (:3:path). You identify conflicts with git status and inspect diffs with git diff or git show, then edit the files to resolve. After resolving, you stage changes with git add and continue with the appropriate command (git rebase --continue, git merge --continue, or git cherry-pick --continue); rerere can help reuse resolutions across repeats.

When to Use It

  • You're rebasing a feature branch and hit conflicts.
  • You're merging a long-lived branch and encounter conflicts.
  • You're cherry-picking a commit that conflicts with the current history.
  • You need to resolve conflicts while inspecting base/ours/theirs using :1/:2/:3.
  • You're repeating similar conflicts across rebases; consider enabling rerere.

Quick Start

  1. Step 1: Run git status to see which files are in conflict.
  2. Step 2: Open each conflicted file, resolve the conflicts, and run git add <file> for each one.
  3. Step 3: Run the appropriate continue command: git rebase --continue, git merge --continue, or git cherry-pick --continue.

Best Practices

  • Run git status to list all conflicted files.
  • Use git diff and git show to inspect conflicting hunks across :1/:2/:3.
  • Edit files to resolve, then stage with git add for each resolved file.
  • Always continue with the exact conflict-resolution command (rebase/merge/cherry-pick) to preserve history.
  • Enable git rerere for repeated conflicts to auto-apply previous resolutions.

Example Use Cases

  • Rebasing a feature branch onto main that contains conflicting changes.
  • Merging a release branch with different edits causing conflicts.
  • Cherry-picking a bug fix that touches the same lines as the target branch.
  • Viewing three-way versions with git show :1:path, :2:path, :3:path to understand the conflict.
  • Using git rerere to automatically reuse a previously resolved conflict during repeated rebases.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers