Resolving Merge Conflicts in GitLab
Introduction
Section titled βIntroductionβMerge conflicts occur when changes clash between branches. GitLab offers multiple ways to resolve these conflicts.
Resolve via the UI
Section titled βResolve via the UIβ- Open the Merge Request with conflicts.
- Click Resolve conflicts.
- Use the Edit inline tool or the Web IDE to choose the correct changes.
- Mark the file as resolved and commit the resolution.
- Re-run the pipeline if required and merge.
Resolve via Command Line
Section titled βResolve via Command Lineβgit fetch origingit checkout feature/new-featuregit merge origin/main# Edit files to resolve conflictsgit add <file>git commit -m "Resolve merge conflict"git push