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