Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab unable to automerge. Merge request contains merge conflicts that must be resolved

Tags:

git

merge

gitlab

GitLab is unable to automerge requests. All merge requests get the message "This merge request contains merge conflicts that must be resolved. You can try it manually on the command line"

The message seems incorrect, and I tested this by creating a new branch with "git branch -b new-branch-name" and change a file that is not going to cause merge conflicts.

When I push this new branch and create a new merge request, Gitlab still says it cannot auto merge.

Any recommendations to fix this and what the reason is GitLab gives the "This merge request contains merge conflicts" message?

like image 716
Mike Rynart Avatar asked Nov 17 '15 12:11

Mike Rynart


1 Answers

This happens when your current branch is not in sync with remote branch. In this case, sometimes Git gets confused what to retain and what to ignore.

To fix this do following

; Go to master branch
git checkout develop

; update master branch
git pull

; go to you local branch and merge it with changes from master
git checkout local-branch
git merge develop

Resolve the conflicts if you get any. - Reference

Your merge conflicts should be fixed by now.

like image 176
Imamudin Naseem Avatar answered Oct 04 '22 17:10

Imamudin Naseem