Skip to content
Back to skills

Git.Merge Conflicts

ASecurity

Resolve git merge, rebase, or cherry-pick conflicts and finalize the operation

  • 158 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 7, 2026
testinggobashdockergit

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add gpsaggese/helpers --skill git.merge_conflicts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git.Merge Conflicts?

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

Security grade badge for Git.Merge Conflicts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gpsaggese-git-merge-conflicts/badge)](https://www.skillsdirectory.com/skills/gpsaggese-git-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
---
description: Resolve git merge, rebase, or cherry-pick conflicts and finalize the operation
model: haiku
---

# Goal
- Given a repo with unresolved Git conflicts, find why each conflict happened,
  resolve it, verify the result, and finalize the operation

# Workflow

## Identify the Operation In Progress
- Check whether the repo is in a `merge`, `rebase`, or `cherry-pick`. Finalizing
  differs by operation
  ```bash
  > ls -a .git | grep -E "MERGE_HEAD|rebase-merge|rebase-apply|CHERRY_PICK_HEAD"
  ```
- Note `<SOURCE>`, the branch or commit being merged, rebased, or cherry-picked,
  and `<TARGET>`, the branch with existing history (e.g., `main` for a merge, or
  the branch rebased onto)

## Find the Files with Conflicts
- List the files with conflicts:
  ```bash
  > git diff --name-only --diff-filter=U
  ```

## Understand the Context
- Read the PR description, if any:
  ```bash
  > gh pr view
  ```
  - If no PR is open, `gh pr view` fails: skip it and use commit history
- Read the commits on `<SOURCE>` and `<TARGET>` that lead to the conflict, to learn
  the intent of each side:
  ```bash
  > git log <TARGET>..<SOURCE>
  > git log <SOURCE>..<TARGET>
  ```

## Propose Fixes
- For each file with conflicts:
  - List every conflict hunk (a file can have several `<<<<<<<` / `=======` /
    `>>>>>>>` blocks)
  - For each hunk, or group of similar hunks, explain the cause and propose a fix

- Example
  ```verbatim
  1. tutorials/GitHub_Stats/Master_GitHub_analysis.py
     - **Issue**: Jupytext version conflict.
     - **Resolution**: Use <TARGET>, it's the newer version.

  2. tutorials/GitHub_Stats/docker_jupyter.sh
     - **Issue**: <SOURCE> adds -e GITHUB_ACCESS_TOKEN to Docker env; <TARGET>
       removes it.
     - **Resolution**: Use <TARGET> (remove the line)
  ```

- If unsure, prefer the changes from `<SOURCE>` over `<TARGET>`
  - `<TARGET>`'s history is already saved, but discarding `<SOURCE>`'s changes
    could lose them permanently

## Ask User and Apply the Changes
- Ask the user which resolution to apply for each ambiguous case
- Edit each conflicted file to remove the markers and apply the chosen resolution
- Confirm no conflict markers remain:
  ```bash
  > grep -rn '^<<<<<<<\|^=======\|^>>>>>>>' <RESOLVED_FILES>
  ```
- Stage each resolved file:
  ```bash
  > git add <FILE>
  ```

## Finalize the Operation
- You MUST ask for user permission before finalizing, per the repo rule of never
  committing without permission
- Once approved, finalize per the operation identified above:
  - `merge`: `git commit`
  - `rebase`: `git rebase --continue`
  - `cherry-pick`: `git cherry-pick --continue`
- Do not skip hooks (e.g., `--no-verify`) or force anything unless the user
  explicitly asks for it

# Verification
- [ ] Run the related unit tests
- [ ] Confirm no conflict markers `<<<<<<<` / `=======` / `>>>>>>>` remain
- [ ] Confirm the operation finished cleanly:
  ```bash
  > git status
  ```
- [ ] The file `plan.md` says that it was generated by
      `.claude/skills/git.merge_conflicts/SKILL.md`

# Ask for Help If Unsure How to Do
- If the task is not perfectly clear, you MUST not perform it, but ask for
  clarifications
  - For a complex task, create plan.md with 5 bullet points explaining the plan
  - Say in `plan.md` how it was generated, with this line as the first bullet:
    ```markdown
    - Generated by `.claude/skills/git.merge_conflicts/SKILL.md`
    ```

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 testing →

Comments

Loading comments…

Newsletter

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