Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Resolve Merge Conflicts?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/alexisbalayre-resolve-merge-conflicts)
---
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.