Starting on your newBranch:

git checkout master to get back on the master branch

git pull origin master to get the most up-to-date version of the master branch

git checkout newBranch to get back on your newBranch

git rebase origin/master -i to perform an interactive rebase. The command will take you through and let you pick commits, rename them, squash them, etc. Assuming you will want to keep them all, it will pause when there are merge conflicts and then you'll have to resolve them in your text editor, it will tell you where (in your text editor) that the conflicts occur. You will have to add those files after fixing them then do git rebase --continue to proceed with the rebase.

When you're done with the rebase your newBranch will be synced up with master and have any commits in master that weren't there when you started your work, and all merge conflicts will be resolved so that you can easily merge your newBranch.

Answer from chevybow on Stack Overflow
Top answer
1 of 5
71

Starting on your newBranch:

git checkout master to get back on the master branch

git pull origin master to get the most up-to-date version of the master branch

git checkout newBranch to get back on your newBranch

git rebase origin/master -i to perform an interactive rebase. The command will take you through and let you pick commits, rename them, squash them, etc. Assuming you will want to keep them all, it will pause when there are merge conflicts and then you'll have to resolve them in your text editor, it will tell you where (in your text editor) that the conflicts occur. You will have to add those files after fixing them then do git rebase --continue to proceed with the rebase.

When you're done with the rebase your newBranch will be synced up with master and have any commits in master that weren't there when you started your work, and all merge conflicts will be resolved so that you can easily merge your newBranch.

2 of 5
22

It seems that your GitLab is configured to not allow feature branches with merge commits to be merged into the master branch. This is where you took a wrong turn:

After that I committed my local changes and pulled the changes in newbranch to local branch.

What you should have done is to commit your work, and then pull via rebase from the remote newbranch branch. To remedy the situation, I suggest nuking the merge commit which happened when you pulled from GitLab. A merge commit is likely what happened, because git pull by default uses the merge strategy, not the rebase strategy. Check git log, and see how many commits were introduced due to the incorrect pull. Assuming there were only a single merge commit, then the following should do (NOTE: all uncommitted modifications in the working directory will be irreversibly deleted, so save/commit before proceeding):

git reset --hard HEAD~1

Verify again that git log looks correct. You should now see only your latest commit on the top of the branch. Assuming you do see this, then you are good to pull via rebase:

git pull --rebase origin newbranch

This will bring in your colleague's commit, then replay your latest commit on top of the branch. Finally, you may push the branch out, and the problem should be resolved:

git push origin newbranch

Note that doing a hard reset as I have suggested above is generally not a good thing to do. But in your case, no one has seen that merge commit yet, because GitLab rejected your attempt to push. So you should be safe in removing it.

🌐
GitLab
docs.gitlab.com › user › project › merge_requests › methods
Merge methods | GitLab Docs
If the target branch has new commits ... is only allowed if the branch can be fast-forwarded. If a fast-forward merge is not possible, you are provided the option to rebase....
Discussions

Help needed: merge requests without rebasing?
github and gitlab are both just git. you just have changes that cant be fastforward merged More on reddit.com
🌐 r/gitlab
22
5
December 8, 2025
Merge request fast-forward if possible
Hello, if I understand the settings correctly I can force fast forward merges for my project but there is not an option to do fast-forward when it is possible. For me it would be eg. single commit merge request which can be fast forwarded. Am I right? What I want is to create a merge commit ... More on forum.gitlab.com
🌐 forum.gitlab.com
6
0
December 8, 2021
git - Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally - Stack Overflow
I'm working on two branches and they have an open pull request to the develop branch. My two branches are: test-increase-test-coverage feat-add-daily-mileage I got this error when I wanted to merge More on stackoverflow.com
🌐 stackoverflow.com
hi i need help setting up git for the first time
Fast-forward or merge is the default behavior as it will behave like fetch + merge When merging two branches, a fast-forward is the simplest form and it happens when the branch you're merging into was not modified since the other branch was created, and the merge consists of just updating the pointer to the new branch. If the upstream branch was updated since the topic branch was created, it'll need to create a merge commit with two parents (one for upstream and one for the topic branch) that joins them together and optionally resolves merge conflicts. The Rebase option is a bit more advanced and if you're just starting to learn git I would suggest to defer that until you're comfortable with merging and resolving conflicts. Rebasing is a mechanism that allows you to clean up your commit history and by default it will linearize your history by removing merge commits. Keep in mind if you have a lot of commits it will potentially cause you to deal with more merge conflicts than if you used a merge. Another key difference is that in a merge conflict the "ours" and "theirs" markers refer to your current branch and the branch you're merging (typically upstream and topic). During a rebase these are flipped because a rebase does a reset to the destination branch and then cherry-picks the commits that are incoming from the topic branch. Fast-forward only is my preferred option as I only use pull for upstream branches I keep track and want to make sure I catch cases like someone force-pushing or an accidental local edit. For feature (topic) branches I use fetch + merge explicitly. More on reddit.com
🌐 r/git
8
12
May 13, 2024
🌐
Medium
medium.com › devops-with-valentine › gitlab-merge-blocked-fast-forward-merge-is-not-possible-7f86bf79e58b
GitLab: Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally. | by Valentin Despa | DevOps with Valentine | Medium
December 27, 2021 - GitLab: Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally. If you are working with Merge Requests in GitLab, you may see this message quite often. So what …
🌐
Medium
medium.com › @zakarialahmam28 › merge-request-rebase-28ca1445bf23
Merge request & Rebase. rebasing a merge request | by Zakariae lahmam | Medium
February 9, 2024 - When main development branch that a merge request was made against is no longer current, the merge request’s branch will need to be rebased from the the original base branch to the new branch.
🌐
Reddit
reddit.com › r/gitlab › help needed: merge requests without rebasing?
Help needed: merge requests without rebasing? : r/gitlab
December 8, 2025 - Pretty sure that even without conflicts, if strategy is set to "fast forward only" in GitLab, you do have to rebase to be able to merge. The question is whether or not you must run the CI pipeline. As another comment says, depending configuration, you should have a button "rebase without pipeline".
🌐
GitHub
github.com › orgs › community › discussions › 4618
Feature Request: Only allow for --ff merges for PRs · community · Discussion #4618
GitHub is nearly 15 years old, and there is still no way for a pull request merge to be fast-forward-only (linear history) AND preserve the same commits as pull request source branch.
🌐
University of Toronto
microfluidics.utoronto.ca › help › help
Index · Methods · Merge requests · Project · User · Help · GitLab
Merging is only allowed if the branch can be fast-forwarded. When a fast-forward merge is not possible, the user is given the option to rebase, see Rebasing in (semi-)linear merge methods.
🌐
GitLab
transfer.hft-stuttgart.de › help
Index · Methods · Merge requests · Project · User · Help · GitLab
To rebase a merge request's branch without triggering a CI/CD pipeline, select Rebase without pipeline from the merge request reports section. This option is available when fast-forward merge is not possible but a conflict-free rebase is possible.
Find elsewhere
🌐
Codemia
codemia.io › home › knowledge hub › fast-forward merge is not possible. to merge this request, first rebase locally
Fast-forward merge is not possible. To merge this request, first rebase locally | Codemia
September 23, 2025 - That message means the target branch moved forward after your branch was created, so the hosting platform cannot merge your work as a simple fast-forward. The usual fix is to rebase your branch onto the latest target branch locally, resolve conflicts if needed, and then push the updated branch ...
🌐
GitHub
github.com › renovatebot › renovate › discussions › 26972
Automerge failed with fast forwading merge method in GitLab · renovatebot/renovate · Discussion #26972
At the merge request creation, ... message Branch cannot be merged.This is probably because the MR is not up to date with the target branch and a rebase is needed....
Author   renovatebot
🌐
Drupal
drupal.org › docs › develop › git › using-gitlab-to-contribute-to-drupal › rebase-a-merge-request
Rebase a merge request | Using GitLab to contribute to Drupal | Drupal Wiki guide on Drupal.org
January 13, 2026 - When main development branch that a merge request was made against is no longer current, the merge request's branch will need to be rebased from the the original base branch to the new branch. For example, when the merge request was created, it might be against Drupal core's 9.4.x branch.
🌐
GitLab
forum.gitlab.com › general
Merge request fast-forward if possible - General - GitLab Forum
December 8, 2021 - Hello, if I understand the settings correctly I can force fast forward merges for my project but there is not an option to do fast-forward when it is possible. For me it would be eg. single commit merge request which ca…
🌐
Stack Overflow
stackoverflow.com › questions › 72327954 › merge-blocked-fast-forward-merge-is-not-possible-to-merge-this-request-first
git - Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally - Stack Overflow
... Save this answer. ... Show activity on this post. 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.
🌐
GitLab
gitlab.lcqb.upmc.fr › help › user › project › merge_requests › fast_forward_merge.html
Fast forward merge · Merge requests · Project · User · Help
Now, when you visit the merge request ... merge is possible. If the target branch is ahead of the source branch, you need to rebase the source branch locally before you will be able to do a fast-forward merge....
🌐
GitLab
sels.tecnico.ulisboa.pt › help
Fast forward merge · Merge requests · Project · User · Help
If the target branch is ahead of the source branch and a conflict free rebase is not possible, you need to rebase the source branch locally before you can do a fast-forward merge.
🌐
GitLab
genboree.org › help
Index · Methods · Merge requests · Project · User · Help · GitLab
To rebase a merge request's branch without triggering a CI/CD pipeline, select Rebase without pipeline from the merge request reports section. This option is available when fast-forward merge is not possible but a conflict-free rebase is possible.
🌐
DEV Community
dev.to › saint_vandora › mastering-git-resolving-not-possible-to-fast-forward-aborting-error-1pac
Mastering Git: Resolving "Not Possible to Fast-Forward, Aborting" Error - DEV Community
January 11, 2024 - 1.Fetch the Changes: Start by fetching the changes from the remote repository without merging them into your branch: ... 2.Rebase Your Changes: After fetching the changes, rebase your local branch on top of the changes from the remote branch:
🌐
Medium
blog.esciencecenter.nl › fast-forward-merges-on-github-752f900f45e8
The year is 2025 A.C. and GitHub.com still can’t do “fast-forward” merges via its web-interface. But you can; I’ll show you how. | Netherlands eScience Center
February 21, 2025 - Check “Require a pull request before merging” and, while waving a magic wand, set “Allowed merge methods” to “Rebase”, contradicting the general repository settings. Check whichever other settings you would like and click on “Save ...
🌐
GitLab
gitlab.com › gitlab.org › #469522
Merge request with fast-forward require to click on merge button (#469522) · Issues · GitLab.org / GitLab · GitLab
For that we use merge-request in fast-forward mode. reproduction scenarion: * create the MR branch: ``` git pull origin/master git checkout -b test-branch git reset HEAD~1 git branch --set-upstream-to=origin/master git push ``` * Now create the MR on the gitlab UI. Issue is: We have the button `rebase` with the message `Merge request must be rebased, because a fast-forward merge is not possible.` And this require to re-run a full CI?