Skip to content
Back to skills

Resolve Merge Conflicts

ASecurity

Resolve git merge conflicts. Use when a merge, pull, rebase or cherry-pick stops on a conflict, or a PR reports conflicts with its base.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentsgit

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add AlexisBalayre/claude-code-config --skill resolve-merge-conflicts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Resolve Merge Conflicts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Resolve Merge Conflicts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alexisbalayre-resolve-merge-conflicts/badge)](https://www.skillsdirectory.com/skills/alexisbalayre-resolve-merge-conflicts)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: resolve-merge-conflicts
description: Resolve git merge conflicts. Use when a merge, pull, rebase or cherry-pick stops on a conflict, or a PR reports conflicts with its base.
---

# Resolve merge conflicts

Always resolve the conflict: finish with both sides' intent in the tree.

## 1. Bring the trunk in

Commit your work, `git fetch origin`, then `git merge origin/<trunk>` (`GIT_TRUNK` in `.claude/project.env`). Once a branch is pushed, merge: a rebase rewrites commits others have read and needs a force push.

`unable to unlink old '<path>': Operation not permitted` is a sandbox refusal, not a conflict. Git may still have changed the other files while `HEAD` stayed put. With your work committed beforehand, those changes are all leftovers: `git restore .`, delete the untracked files the merge added, and confirm `git status` lists nothing. `restore` can report a file the sandbox hides from reads and still restore the rest. Then ask whoever can write the path (a worker asks its lead) to run the merge.

A merge that completes with `warning: unable to unlink '<path>'` left a file the trunk deleted: never stage it, and ask the same person to delete it.

## 2. Resolve each file

`git status` lists the unmerged paths. For each, read what both sides meant (`git log --merge -p -- <path>`) before editing.

- **Both changes stand** unless they contradict. Taking one side whole drops the other's work.
- **Moved or deleted code:** carry the other side's change to where the code went.
- **Contradiction:** when the two intents cannot both hold and the issue does not settle it, ask the user (a worker asks through its lead) and leave the merge in progress.
- **Generated files** (`GENERATED_PATHS_REGEX` in `.claude/project.env`, lockfiles): resolve their sources first, then regenerate with the project's own command. When it cannot run here, ask for it to be run; the file stays unresolved until then.

During a rebase, "ours" is the branch you replay onto and "theirs" is your own commit.

Done when `git status` shows no unmerged path and `git grep -nE '^(<<<<<<<|>>>>>>>)'` finds no marker you introduced.

## 3. Verify

Format and lint the files you resolved, commit (`git commit --no-edit` for a merge, `git rebase --continue` for a rebase), then run `.claude/bin/claude-hooks verify`: a clean resolution can still break the build. A worker whose branch touches `tools/hooks-rs`, `setup.sh`, `.claude/settings.json`, `.claude/worker/` or `.github/workflows/hooks-rs.yml` asks its lead to run it.

Done when verify is green on the commit that holds the resolution. A red is part of the conflict: fix it and verify again.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.