Resolve Merge Conflicts
This skill resolves git merge conflicts in the current repository.
When to use
Use this skill when:
- •The user asks to "resolve merge conflicts"
- •The user mentions "merge conflict" or "conflict markers"
- •There are unmerged files in the git repository
Instructions
There are git merge conflicts in this repository. Find the conflicted files, analyze the conflicts, and resolve them by editing the files to remove the conflict markers and merge the changes appropriately.
Steps:
- •Run
git diff --name-only --diff-filter=Uto find files with conflicts - •Read each conflicted file to understand the conflict markers (
<<<<<<< HEAD,=======,>>>>>>> branch) - •Analyze both versions of the conflicted code
- •Edit each file to resolve the conflict by:
- •Intelligently merging both changes where possible
- •Choosing the most appropriate version when changes are incompatible
- •Preserving all necessary code from both sides
- •Removing all conflict markers
- •Stage the resolved files with
git add