Git pull needs to discard local files
I have a git setup with a shared repository. As I'm working on 2 PC's I push my personal branches.
I'm rebasing frequently with the develop branch so I need to force a push (git push -f orig开发者_如何转开发in feature). But when I want to pull a feature branch whith the forced changes I always get merge conflicts.
Is it possible to force a pull and overwrite the local files?
If you're wanting to just get to the state that you were at on the other machine when you force pushed, just reset --hard
to the head that you want:
$ git fetch
$ git reset --hard origin/<yourbranch>
精彩评论