Skip to content

/errors/git/not-possible-to-fast-forward

fatal: Not possible to fast-forward, aborting.

verified onenvironmentlocal · linux 6.18.44-fc-v140 x64 · GNU bash 5.2.21 · git version 2.43.0updated
tool
Git
exit code
128
versions
Git 2.x
os
linux, macos, windows

fatal: Not possible to fast-forward, aborting. means your branch and its upstream both have commits the other lacks, so Git cannot move the branch pointer forward. The pull was restricted to fast-forward (--ff-only or pull.ff = only). Choose how to combine the histories: rebase or merge.

Reproduce it

A bare-bones setup: a remote with one commit, a clone, then one new commit on each side.

bash
git init -q -b main up
git -C up commit -q --allow-empty -m base
git clone -q up cl
git -C up commit -q --allow-empty -m remote-change
git -C cl commit -q --allow-empty -m local-change
cd cl
git pull --ff-only 2>&1 | grep '^fatal'
git pull --rebase -q
git log --oneline

Output

fatal: Not possible to fast-forward, aborting.
30c0a8b local-change
44e9f9c remote-change
5d8392b base

Choose a fix

CommandResult
git pull --rebaseLinear history; your commits get new hashes.
git pull --no-rebaseA merge commit joins both lines.
git reset --hard @{u}Discards local commits and changes. Not undoable easily.

Check what differs first with git log --oneline --left-right HEAD...@{u}. To make rebase the default, run git config --global pull.rebase true.

Sources