git pull: Not possible to fast-forward,

Issue

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.

[email protected] 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.

Solution

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/

Answered By – Monish Khatri

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published