开发者

How can I wipe out my local branch in GIT?

I dont' want to deal with any conflicts on my local master branch as the origin (remote) master 开发者_如何学Chas changed and I just want 100% of the remote's version.

Is there a way to wipe out the local master? (other than just manually deleting and cloning again).


When on branch 'master', you can simply do

git reset --hard origin/master

Note that you would lose your local changes that way.


Here's how I would do it (while on master):

git fetch origin
git reset --hard origin/master

As evidenced by the other answers, there's more than one way to get this done. Somehow, to me this just seems the most straightforward.

EDIT: Where'd all the other answers go??

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜