Skip to main content
This feature is in early access. Enable it by setting early_access: true in your .coderabbit.yaml, or by toggling Early Access on the web interface.
This feature is available exclusively as part of the Pro plan. Please refer to our pricing page for more information about our plans and features.
Merge conflicts interrupt review momentum and often require context-switching between branches to understand what each side was trying to accomplish. CodeRabbit detects conflicts during PR review and can resolve them automatically: it analyzes the intent behind both sets of changes and commits the result as a proper merge commit to your branch.

Platform support

Merge conflict resolution is available on the following platforms:

GitHub

GitLab

Bitbucket

Azure

Usage

When CodeRabbit detects conflicts, it adds a resolution option to the PR summary comment.

PR comment command

Comment @coderabbitai fix merge conflict in any PR to trigger resolution on all supported platforms

Finishing Touches checkbox

On GitHub, check the Resolve merge conflicts box in the CodeRabbit Walkthrough for one-click resolution
Both methods commit the resolved changes directly to your branch.

How it works

1

Detection

During PR review, CodeRabbit simulates the merge in a sandbox without modifying your working tree. If conflicts are found, they are listed in the summary comment alongside the resolution trigger.
2

Intent analysis

When resolution is triggered, CodeRabbit clones the repository and examines each conflicting file. For each file, it determines what problem the changes on each branch were solving (not just what changed, but why), so the resolution reflects the actual goals of both sides.
3

Resolution

Each conflict is resolved based on the intent of both branches:
  • Content conflicts: intelligently merged, preserving the intent of both sides
  • Add/add conflicts (two branches add the same symbol): both are kept with descriptive renames
  • Delete-modify conflicts: explicit keep-or-delete decision based on branch intent
  • Rename conflicts: final target paths are verified to be intentional
4

Validation

CodeRabbit verifies that no conflict markers remain, that the merge index is fully cleared, and runs the repository’s build and lint commands to surface any errors introduced by the resolution.
5

Commit

The resolved changes are committed to your branch as a proper merge commit with two parents (your branch and the base branch), so git history accurately reflects the merge.

When CodeRabbit won’t auto-resolve

CodeRabbit will decline to resolve a conflict if doing so incorrectly could cause serious harm:
  • Security-critical code: authentication logic, encryption, secrets handling, or access control
  • Fundamentally incompatible business logic: where both changes make mutually exclusive architectural decisions that a human needs to decide
When this happens, CodeRabbit posts a comment identifying which file it declined and the specific reason. Any other conflicting files that are safe to resolve are still committed normally — only the declined files require manual resolution.
The bar for declining is intentionally high. CodeRabbit will attempt to resolve the vast majority of conflicts automatically. If you believe a declined conflict is safe to auto-resolve, resolve it manually and push, or leave a comment describing the situation and we’ll take a look.

Command reference

@coderabbitai fix merge conflict

Troubleshooting

If your branch receives a new commit while resolution is running, CodeRabbit aborts to avoid overwriting the incoming changes. Wait for the branch to stabilize, then trigger resolution again.
Check the resolution comment for files CodeRabbit declined, each listed with a specific reason. Resolve those files manually and push — the merge commit from CodeRabbit already covers everything else.
This can occur if the agent could not produce a clean staged result. Try triggering resolution again. If it happens repeatedly, resolve the conflicts manually and use the feedback link in the comment to let us know.

What’s next

Autofix

Automatically implement fixes for unresolved CodeRabbit review findings

Generate unit tests

Generate comprehensive unit tests for your PR changes

Review commands

Full reference for all PR comment commands