Search code examples
gitgitlabrebasemerge-conflict-resolutionfast-forward

GitLab says merge conflicts must be resolved but there are no conflicts


I have a feature/new-feature branch that I'm trying to fast-forward merge into qc branch. I've been doing this all this time without issues, when all of a sudden today, Gitlab does not allow me to merge due to "Merge blocked: merge conflicts must be resolved.".

I have tried multiple solutions:

1. Checked out local git checkout qc, and git pull origin qc (it was up to date). Then rebased my local branch git rebase -i qc and forced pushed to origin git push -f origin feature/new-feature.

2. Deleted local git branch -D qc, then checked out origin git checkout qc and did the rest from step 1.

3. Unprotected and deleted origin qc. Then pushed local qc to origin and did the rest from step 1.

4. Did what GitLab suggested, which is to "resolve locally". Once I merged locally, e.g. on qc git merge --no-ff 'feature/new-feature', and then opened another MR there was still the same merge issue.

5. Deleted my local repo, and re-cloned again.


Solution

  • So the issue was related to deleted files/folders as suggested by someone in the comments. I could not figure out what are these untracked files, so I ended up git cleaning the working tree like so:

    > git checkout qc
    > git clean -fd
    > git push origin qc