Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git pull: Not possible to fast-forward,

could you please help me to solve my issue? Error occurs when I try to pull from "dev" branch. I browsed the solution and it says that I need to "rebase" but it didnt work out foe me.

CT+aohc@MP1GYWQA MINGW64 /c/TCO/source/RAPMD.Web.Frontend (web_feature/TCORAPD-122389-1)
$ git pull origin dev
From https://dev.azure.com/xxxx/xxxx/_git/TCO-FGP-Rapmd
 * branch                  dev        -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
like image 329
GGotchaA Avatar asked Jan 30 '26 21:01

GGotchaA


2 Answers

You can follow the following steps:

  • Run git pull --rebase origin dev
  • if you face conflicts then you need to solve those conflicts and run
    • git add <file_name>/ git add .
    • git rebase --continue
  • continue second step until you solve conflicts(remeber rebase compare changes commit wise)
    • Then run git rebase --skip if needed
  • After you successfullly aplied rebase you need to force push the changes
    • Run git push --force-with-lease origin dev (safer way of force push) OR git push -f origin dev

FOR REFERENCE: https://gitexplorer.com/

like image 114
Monish Khatri Avatar answered Feb 03 '26 07:02

Monish Khatri


Easiest way, This worked for me:

git fetch origin dev
git merge origin dev

Replace dev with branch_name you want to pull.

like image 25
Harish Kulkarni Avatar answered Feb 03 '26 07:02

Harish Kulkarni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!