Fix: Fatal: Not Possible to Fast-forward, Aborting

The easiest way is to use the fast-forward merge method

Reading time icon 4 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Key notes

  • To get rid of the fatal not possible to fast-forward aborting error message, run the git pull rebase command, which can update a local branch.
  • Also, you can try to merge method to fix it. Keep reading to learn the detailed steps.
not possible to fast-forward, aborting

Many users have complained about getting fatal: Not possible to fast-forward, aborting error message while trying to make a pull request.

If you have seen this message, that means, you made local commits on your branch that are not on the remote one, the changes are force-pushed to the remote branch, or the commit history of your local branch and the remote branch has diverged due to changes on both ends.

How can I fix the fatal: Not possible to fast forward, aborting issue?

1. Use the Fast-forward merge method

The simplest way to fix the fatal: Not possible to fast-forward, aborting error message is to merge. However, it is possible only if your local branch is contained within the remote branch.

Fast-forward merge -fatal: Not possible to fast forward, aborting

To do the fast-forward merge, type the following command and hit Enter: git pull --ff-only

2. Use the git pull rebase command

To update a local branch with the changes from a remote branch, you can use a git command and hit Enter: git pull origin --rebase

git pull rebase

The command integrates changes from the remote branch into the local one by applying each commit from the remote branch on top of the existing commits in the local one.

3. Use the Merge method

If your local branch is not contained within the remote branch, you can use the general method to merge. Although, it might cause merge conflicts, which need to be resolved manually. Follow these steps:

  1. Type the following command to do a merge and hit Enter: git pullgit pull - not possible to fast-forward, aborting
  2. In case you get merge conflicts, you need to edit the conflicting files to fix the problem. Once the conflicts are resolved, you can stage the changes and commit them.
  3. Next, to create a branch & check the origin/master head to a local branch, copy & paste the following commands and hit Enter: git checkout -b new_branch origin/masterbranch origin/master -not possible to fast-forward, aborting
  4. Once the new branch is created, you can merge the changes from the master branch into it.

To fix these issues, you can also seek help from GitHub Copilot, the AI assistant introduced by GitHub; read this guide to learn more about it.

4. Resolve differences between your local diverged branch and the remote branch

  1. To create a local branch to resolve the differences, type the following command and hit Enter: git checkout -b new_branchgit checkout -b new_branch -Fatal: Not Possible to Fast-forward, Aborting
  2. Now, to bring the remote changes into your newly created local branch, you need to pull from the remote branch, copy & paste the following command, and press Enter: git pull origin mastergit pull origin master
  3. Next, if you see any conflicts, make the changes to resolve them, then save the changes and commit.
  4. Type the following commands one by one and hit Enter after each command:
    • git add
      git commit -m "Conflict resolution"
  5. Once you have resolved the conflicts, copy & paste the following command to push the changes to the remote branch and press Enter: git push origin new_branchgit push origin new_branch

In case you want to merge the changes with the main branch on the remote repository, follow these steps to use a pull request on GitHub to do so:

  1. Go to your GitHub repository, where you created your new_branch.
  2. Click the branch dropdown from the left side of the page and choose the new branch option from the list.
  3. Once you are on the new_branch, click Pull Requests.
  4. Next, click the New Pull Request button.new-pr-button
  5. On the Comparing changes page, ensure the base branch is set to master and the compare branch selected is new_branch. GitHub will show you the changes between the two branches and review them.
  6. Fill in the pull request details, including Title and Description, and click the Create button.create-new-pull-request
  7. Click the Create pull request again to finish.create-pr-from-push-new- Fatal: Not Possible to Fast-forward, Aborting

Speaking of repositories, if you need help with creating a repository, uploading and hosting files; read this guide to learn more.

So to get rid of the fatal: Not possible to fast-forward, aborting error message; you need to understand the reasons behind it.

You can use fast-forward merges, rebasing, or standard merges to ensure your local and remote branches are aligned properly.

Also, find out how to fix the unable to update local ref error on Git Pull or Git Push.

In case you need help with other GitHub issues, such as the GitHub desktop app not opening; read this guide to learn the solutions.

If you have any questions or suggestions about the subject, don’t hesitate to mention them in the comments section below. We would be happy to help!

User forum

0 messages