Home > database >  Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally
Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally

Time:05-22

I'm working on two branches and they have an open pull request to the develop branch.

My two branches are:

  1. test-increase-test-coverage
  2. feat-add-daily-mileage

I got this error when I wanted to merge them with develop branch:
Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally.

These two branches had conflicts so I rebased test-increase-test-coverage branch with feat-add-daily-mileage branch with these commands:

git checkout test-increase-test-coverage
git fetch feat-add-daily-mileage
git rebase origin/feat-add-daily-mileage

# Then I fixed conflicts and commited

git rebase --continue
git push -f origin test-increase-test-coverage

These branches no longer have any conflicts and when I run this command git rebase origin/feat-add-daily-mileage again I get this message:
Current branch test-increase-test-coverage is up to date.

But I still see this error message Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally. in Gitlab.

How can I fix this?

CodePudding user response:

got this error when I wanted to merge them with develop branch

You might need to rebase them locally on top of origin/develop first.
Then your merge would be a fast-forward one.

You need to do so for one branch, test-increase-test-coverage for instance. And merge it to develop.

Then you do the same for the other branch feat-add-daily-mileage (after a fetch, to get the newly updated origin/develop)

  • Related