DEV Community

Cover image for Got a 'git' conflict and just want to blow away your local changes and take 'theirs'?
Nick Raphael
Nick Raphael

Posted on

Got a 'git' conflict and just want to blow away your local changes and take 'theirs'?

I just did a 'git merge' with another branch and I have a merge conflict. I'm happy to lose my changes in preference to the changes on the other branch.

Well, as with all things, there is a simple git command for this...

git checkout --theirs path/to/file
Enter fullscreen mode Exit fullscreen mode

Too easy.

Top comments (0)