Merge and rebase conflicts — Automatic merge failed; fix conflicts
Log signatures
Automatic merge failed; fix conflicts and then commit the result CONFLICT (content): Merge conflict in src/app.ts error: Merging is not possible because you have unmerged files error: could not apply a1b2c3d You have unmerged paths
What’s happening
CI tests the merge result of your branch with the base branch (refs/pull/N/merge on GitHub), not your branch tip. When base moved and now conflicts with your branch, that synthetic merge fails before any build step. Your branch may be green in isolation; the merge is what's red. The conflict type in the signature matters: content is a normal overlapping edit; modify/delete means someone deleted a file you modified (the resolution is a decision, not an edit); submodule means two branches pinned different submodule commits.
Fix playbook
- 1Update and merge locally: git fetch origin && git merge origin/<base> (or rebase, per your team's convention).
- 2Resolve each conflicted file: git status lists them under Unmerged paths. For modify/delete, decide explicitly whether the file lives or dies — don't just keep "your" side reflexively.
- 3Re-run the affected tests locally before pushing — semantic conflicts (both sides valid alone, broken together) survive textual resolution.
- 4Commit the resolution and push; CI re-runs against a fresh merge.
- 5If the same files conflict repeatedly across PRs, that's an architecture smell — a hotspot file shared by everyone (a giant routes file, a central constants module). Split it.
Prevention
- Merge or rebase onto base early and often on long-lived branches. Conflict pain grows superlinearly with divergence time.
Triage every red build, not just this one.
This page is one of 31 failure classes the open-source patchrail CLI matches from a raw log — locally, with secrets redacted first. If a log stumps it, open an issue; if it saves you a debugging morning, a star helps other maintainers find it.
pipx install patchrail