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.

Merge conflict flow
01 Branch drift

Base Branch Moves

A new merge to the base branch leaves the PR or MR out of date.

02 Detection

Conflict Detected

Forkline sees that the branch is no longer mergeable.

03 Resolution

Attempt Fix

The agent rebases context and resolves the conflicting files.

04 Reviewable again

Branch Updated

Resolved changes are pushed back to the branch for review.

Conflict automation focuses on getting the branch back into a reviewable state after base-branch drift.

Enabling Merge Conflict Auto-Fix

  1. Navigate to Repositories
  2. Find your repository
  3. Click Settings on the repository card
  4. Select the Automation tab in the modal
  5. Find Merge Conflict Auto-Fix
  6. Set the mode to Enable for this repository
  7. Set Maximum resolution attempts per PR
  8. 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.

Resolution Process

  1. Fetch base-branch changes
  2. Identify conflicting files
  3. Analyze conflict markers and surrounding code
  4. Generate a resolution
  5. 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.

Next Steps