Sometimes a branch has diverged from origin so much, that it doesn't make sense to try to resolve all the conflicts. In this case, it's better to just reset your local branch to whatever is on origin. To do this, you need to fetch first and then run git reset --hard origin/<branch> .
A branch in git is a series of interrelated commits. If two branches follow a non-linear path then they diverge each other. The diagram shows two diverged branches master and feature.
git checkout phobos
git reset --hard origin/phobos
This tells Git to reset the head of phobos
to the same commit as origin/phobos
, and to update the working tree to match.
Delete the branch, then re-create it:
$ git branch -D phobos
$ git checkout --track -b phobos origin/phobos
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With