hermes

Resolve a merge conflict

Resolves merge, rebase or cherry-pick conflicts by reading both sides and their common base, keeps the intent of each, and asks when the intents contradict. Use when git stops on a conflict.

context

A conflict means two changes touched the same lines. Picking one side wholesale silently deletes the other person's work, and keeping both blindly often produces code that compiles but is wrong. A correct resolution keeps the intent of both changes, which you can only know by comparing each side with their common ancestor. Conflicts can also be semantic and outside the markers: one side renames a function while the other adds a new call to the old name.

task

Resolve the conflicts in the current repositoryOnly if [FILES] is given: , limited to: . Only if [CONTEXT] is given: What the user told you:

  1. Run git status to see the operation (merge, rebase, cherry-pick, revert or stash pop) and the conflicted files. Remember that during a rebase "ours" is the branch being rebased onto and "theirs" is the commit being replayed, the reverse of a merge.
  2. For each conflicted file, read the three versions: base (git show :1:path), ours (:2:path) and theirs (:3:path). Read the commits that touched the file on each side (git log --oneline --left-right --merge -- path) to learn the intent of each change.
  3. Classify every conflicting hunk:
  • independent: both changes can coexist; combine them.
  • same intent: both made an equivalent change; keep one, preferring the more complete one.
  • contradictory: the changes want different behaviour; do not guess. Leave the markers in that hunk and put it under "Needs your decision".
  1. Remove every conflict marker you resolved. Search the whole file for leftover <<<<<<<, ======= and >>>>>>>.
  2. Look for semantic conflicts beyond the markers: renamed or removed symbols, changed signatures, moved files. Search for usages of anything either side renamed or deleted.
  3. For lockfiles and generated files, do not hand-merge. Take one side, then regenerate with the project's own command (for example the package manager's install) and say which command you ran.
  4. Run the project's build and the tests nearest to the touched code. Stage the files you resolved with git add.
constraints
  • Do not run git commit, git merge --continue, git rebase --continue, git push, or any command that discards work (reset --hard, checkout -- ., merge --abort, rebase --abort, clean). Stop after staging and let the user continue.
  • Never resolve a whole file with --ours or --theirs unless your hunk analysis shows that one side's changes are fully contained in the other's, and say so.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
  • Before saying the work is done, run the check that proves it (tests, build, type check or the command the user gave) and report the real result.
  • If you could not run a check, say so plainly and say which one.
output format

Resolutions

A table with one row per hunk: path:line | ours intended | theirs intended | resolution | confidence (high, medium, low).

Verification

The build and test commands you ran and their real results, plus any semantic conflicts you found outside the markers.

Needs your decision

Each contradictory hunk: the two behaviours in one sentence each, and the question to answer. Write "None" if there are none. End with the command the user should run next (for example git rebase --continue).

Every required value is filled in. Copy gives the finished prompt.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Git and version control
level
Intermediate
made for
Software engineer
needs
repo-read, file-write, shell, git
risk
runs-commands
version
v1.0.0 · experimental
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install resolve-merge-conflict --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill resolve-merge-conflict -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

more in git and version control

All of Git and version control
PromptGit and version control

Recover lost Git work

Recovers commits, branches, stashes and staged files lost to a reset, rebase or dropped stash, using reflog and fsck after a backup, explaining each command. Use right after a git mistake.

recover-lost-git-work
PromptGit and version control

Write a commit message

Writes a commit message that states what changed and why, in the repo's own convention, and flags staged changes that should be split. Use before committing.

write-commit-message
PromptGit and version control

Write a pull request description

Writes a pull request description that tells reviewers why the change exists, what to look at first, how to test it and what could break. Use when opening a PR.

write-pr-description
PromptGit and version control

Choose a branching strategy

Recommends a branching and release strategy such as trunk-based, GitHub flow or release branches for a team's size, cadence and environments, with rules, protections and migration steps.

choose-branching-strategy
PromptGit and version control

Clean up a branch's commit history

Plans an interactive rebase that turns a messy branch into logical, reviewable commits, with a backup, the exact todo list and a check that the code is unchanged. Use before merging a WIP branch.

clean-up-commit-history
RuleGit and version control

Conventional Commits rules

Makes the assistant write every commit in Conventional Commits 1.0.0 format, one logical change per commit, with honest breaking-change footers. Use in repos that release from commits.

conventional-commits-rules