Fatal: Not possible to fast-forward, aborting

Disclaimer: these commands will bring changes from the remote branch into yours.

git pull --rebase. Unlike the other solution, you don't need to know the name of your destination branch.

If your upstream branch is not set, try git pull origin <branch> --rebase (credit to @Rick in the comments)

To set this option globally, use git config --global pull.rebase true (credit to @Artur Mustafin below)


git pull --no-ff -> make fast-forwarding to be off by --no-ff


  • If
git pull

does not do the trick and if you want to merge both the current changes and the changes that'd come from the pull of the branch from origin then do this:-

git merge origin/BRANCH_NAME
  • After that, resolve the merge conflicts if any and done for the day.

Your branch is no longer directly based off of the branch you're trying to merge it into - e.g. another commit was added to the destination branch that isn't in your branch. Thus, you can't fast-forward into it (because fast-forward requires your branch to completely contain the destination branch).

You can rebase your branch on top of the destination branch (git rebase <destination branch>) to rework the commits such that they will fast forward into it, or you can do a regular merge.

Tags:

Git