Suppose I pull changes from a git repo. Then the author of the repo force pushes to the central repo. Now I can\'t pull since the history is rewritten.
How can I pull th
If you have not made any changes to the local branch, you could try the following sequence of commands. Please remember this is a crude way to achieve what you are asking for.
git checkout master
git pull
git remote update origin -p
git branch -D myBranch
git checkout myBranch
git remote update origin -p
is optional.
If you made a changes and you do not care about the contents of the local branch, you could try this:
git stash
git stash drop
git checkout master
git pull
git remote update origin -p
git branch -D myBranch
git checkout myBranch
Both the techniques are really long and cumbersome. But get the job done.