Resolving Git Merge Conflicts

VerifiedSafe

Systematically resolve in-progress git merge/rebase conflicts by preserving intents, analyzing sources, and running automated checks.

Sby Skills Guide Bot
DevelopmentIntermediate
8/20/2026
Claude CodeCursorCodex
#git#merge-conflicts#rebase#conflict-resolution#version-control

Recommended for

Automated summary

Guides an agent through resolving an in-progress Git merge or rebase conflict, from inspecting index stages to running checks and completing the operation.

Strengths

  • Gives shell-safe commands for inspecting the stage 1/2/3 blobs, with quoting that prevents zsh from mangling the revision spec.
  • Requires tracing the original intent through commit messages, PRs and tickets before resolving each hunk.
  • Flags the rebase inversion, where Git's « ours » is the branch being rebased onto and « theirs » is the replayed commit.
  • Mandates discovering and running the project's automated checks (typecheck, tests, format) and then finishing the merge or continuing the rebase.

Limitations

  • Does not cover visual merge tools, git rerere, or -Xours/-Xtheirs strategies.
  • Assumes shell access and gives no guidance for binary files or very large conflict sets.
  • Explicitly forbids aborting the merge, which is unhelpful when backing out is the right call.
When to use it

Use it when a merge or rebase is stopped mid-flight with unmerged paths that need resolving and completing.

When not to use it

Avoid it when you want to abort the operation or decide on a merge strategy upstream instead of resolving existing conflicts.

Security analysis

Safe
Quality score88/100

The skill only provides read-only Git inspection commands and guidance for resolving merge conflicts. It does not instruct destructive actions, data exfiltration, disabling safety, or running arbitrary remote code. All commands are standard Git operations for viewing status, diffs, index stages, and blob contents.

No concerns found

How this analysis is made

Examples

Mid-rebase conflict
I'm in the middle of a rebase onto main and `git status` shows unmerged paths in src/api/client.ts. Resolve the conflicts, keep both intents where possible, run the typecheck and tests, and continue the rebase until it finishes.
Feature branch merge conflict
I merged feature/payments into main and got conflicts in three files. Look at the commit messages and the original PRs to understand why each side changed this code, resolve every hunk, then stage and commit the merge.
Understand each side before resolving
Show me the merge base, current side and incoming side for the conflicted file, explain what each change was trying to do, then resolve the conflict without inventing new behaviour and run the formatter and tests.

name: resolving-merge-conflicts description: "Use when you need to resolve an in-progress git merge/rebase conflict."

Resolving Merge Conflicts

  1. See the current state of the merge/rebase. Check git history and the conflicting files with git status --short, git diff --name-only --diff-filter=U, and git ls-files -u.

    For an in-progress merge, resolve the merge base without the unsupported git merge-base --short form:

    merge_base=$(git merge-base HEAD MERGE_HEAD)
    git rev-parse --short "$merge_base"
    

    Inspect index stages with the entire revision spec quoted so zsh does not reinterpret the colons or variable name:

    conflict_path="path/to/file"
    git show ":1:${conflict_path}"  # merge base
    git show ":2:${conflict_path}"  # current side
    git show ":3:${conflict_path}"  # incoming side
    

    Do not write git show :$stage:$path; shell parsing can turn that into the wrong variable expansion. If the stage spec still fails, get the blob ids with git ls-files -u -- "$conflict_path" and inspect the selected blob with git cat-file -p "$blob_id". During a rebase, remember that Git's ours is the branch being rebased onto and theirs is the commit being replayed.

  2. Find the primary sources for each conflict. Understand deeply why each change was made, and what the original intent was. Read the commit messages, check the PRs, check original issues/tickets.

  3. Resolve each hunk. Preserve both intents where possible. Where incompatible, pick the one matching the merge's stated goal and note the trade-off. Do not invent new behaviour. Always resolve; never --abort.

  4. Discover the project's automated checks and run them — typically typecheck, then tests, then format. Fix anything the merge broke.

  5. Finish the merge/rebase. Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/resolving-git-merge-conflicts-mt11k99w' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/resolving-git-merge-conflicts-mt11k99w/download' --output '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md.part' && mv '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md.part' '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md' && test -s '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/resolving-merge-conflicts' && cp -R '.skill-downloads/resolving-git-merge-conflicts-mt11k99w' '.claude/skills/resolving-merge-conflicts'

Cursor
test -f '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md' && test -s '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/resolving-merge-conflicts' && cp -R '.skill-downloads/resolving-git-merge-conflicts-mt11k99w' '.cursor/skills/resolving-merge-conflicts'

Codex
test -f '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md' && test -s '.skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/resolving-merge-conflicts' && cp -R '.skill-downloads/resolving-git-merge-conflicts-mt11k99w' '.agents/skills/resolving-merge-conflicts'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/resolving-git-merge-conflicts-mt11k99w'

openskills read 'resolving-git-merge-conflicts-mt11k99w'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/resolving-git-merge-conflicts-mt11k99w/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills