error: commit x is a merge but no -m option was given.
git revert or cherry-pick on a merge commit needs to know which parent is the mainline.
Seen on:
Git
Meaning
Merge commits have two parents; -m 1 usually means "keep the target branch side".
Common causes
- Reverting/cherry-picking a merge commit without -m
- Undoing a merged pull request from the command line
⚡ Quick fix
- git revert -m 1 <merge-commit>
- Cherry-pick individual commits instead of the merge
Detailed fix by platform
Git
git revert -m 1 a1b2c3d
How to diagnose
- Parents — git show --format=%P <commit>
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026