Merge Conflict Auto-Fix
Automatically resolve merge conflicts on pull requests caused by parallel development.
Overview
Conflict automation helps when one branch lands and leaves another branch no longer mergeable. Forkline focuses on getting the branch back into a reviewable state quickly.
Base Branch Moves
A new merge to the base branch leaves the PR or MR out of date.
Conflict Detected
Forkline sees that the branch is no longer mergeable.
Attempt Fix
The agent rebases context and resolves the conflicting files.
Branch Updated
Resolved changes are pushed back to the branch for review.
Enabling Merge Conflict Auto-Fix
- Navigate to Repositories
- Find your repository
- Click Settings on the repository card
- Select the Automation tab in the modal
- Find Merge Conflict Auto-Fix
- Set the mode to Enable for this repository
- Set Maximum resolution attempts per PR
- Click Save
How It Works
Conflict Detection
When a pull request’s base branch advances, the provider sends an update event. If the branch is no longer mergeable, Forkline creates a resolution task.
Some self-hosted forges report only whether a branch is mergeable, never why, and that answer can still mean “the check has not finished”. Where the report is ambiguous, Forkline confirms the conflict itself by merging the two commits the forge named before starting a task, so a branch with an unsettled check is not announced as conflicting. The task then starts as soon as a real conflict is confirmed, which can take a minute or two longer than the forge’s own answer.
Draft Pull Requests
Draft (work-in-progress) pull requests are never auto-fixed, matching how auto-review skips them. A forge reports a draft branch as not mergeable even when nothing conflicts, and a draft is not meant to be merged yet.
Marking a pull request ready for review does not by itself start a conflict check. The next push to the pull request’s branch, or to the branch it targets, is what picks it up.
Resolution Process
- Fetch base-branch changes
- Identify conflicting files
- Analyze conflict markers and surrounding code
- Generate a resolution
- Push changes back to the PR branch
Result Comments
Starting
🔀 Merge conflicts detected with `main`
Automatically resolving conflicts in:
- src/api/users.ts
- src/utils/validation.ts
Attempt 1/3
Success
✅ Merge conflicts resolved!
Pushed commit abc1234 to your branch.
Resolved conflicts in:
- src/api/users.ts (merged function signatures)
Limitations
Merge conflict automation may not resolve:
- Semantic conflicts where the code compiles but behaves incorrectly
- Complex multi-file refactors
- Conflicts that require architectural decisions
Warning: Always review the result. Automatic conflict resolution is a convenience, not a correctness guarantee.