name: resolving-merge-conflicts description: "Use when you need to resolve an in-progress git merge/rebase conflict."
Resolving Merge Conflicts
-
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, andgit ls-files -u.For an in-progress merge, resolve the merge base without the unsupported
git merge-base --shortform: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 sideDo 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 withgit ls-files -u -- "$conflict_path"and inspect the selected blob withgit cat-file -p "$blob_id". During a rebase, remember that Git'soursis the branch being rebased onto andtheirsis the commit being replayed. -
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.
-
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. -
Discover the project's automated checks and run them — typically typecheck, then tests, then format. Fix anything the merge broke.
-
Finish the merge/rebase. Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.