tags:

views:

76

answers:

1

With git, can I do a 'use their's type command do just overrite my local version with the origin's version?

+2  A: 

To replace your master with origin's master:

$ git checkout master
$ git branch -M master old-master
$ git checkout --track -b master origin/master

The git-merge manpage defines the 'ours' strategy as (emphasis added)

MERGE STRATEGIES

ours
This resolves any number of heads, but the result of the merge is always the current branch head. It is meant to be used to supersede old development history of side branches.

If you want a remote branch to win, create a tracking branch, check it out, and git merge -s ours ... from there.

Greg Bacon