DevOps / Gitlab Interview questions
How do you troubleshoot merge conflicts flagged in a GitLab merge request?
GitLab flags an MR as having conflicts when the source and target branches have both changed the same lines (or GitLab can't auto-merge them cleanly) since the branch diverged. The MR page shows a "merge conflicts" warning and, for simple text conflicts, offers a "Resolve conflicts" button right in the browser.
- Try the in-browser resolver - for straightforward conflicts, GitLab shows both versions side by side and lets you pick a side or edit the merged result directly, then commits the resolution to the source branch.
- Fall back to the command line for complex conflicts - pull the latest target branch locally, merge or rebase it into the feature branch (
git merge origin/mainorgit rebase origin/main), resolve conflict markers in your editor, and push the resolved branch back. - Re-run the pipeline - resolving conflicts doesn't guarantee the code still works together, so the MR's pipeline should re-run and pass before merging.
- Re-request review if the resolution was non-trivial - if resolving the conflict meant making a real code decision (not just picking one side), it's worth a reviewer looking again rather than treating conflict resolution as purely mechanical.
The in-browser resolver only handles conflicts GitLab considers simple text conflicts; anything involving renamed files, binary files, or overlapping logic changes generally has to be resolved locally where you have full editor tooling and can actually run the code.
More Related questions...