开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜