You are here

Force a git merge "theirs" (even though it doesn't exist)

Submitted by Druss on Thu, 2012-02-09 23:12

A note to myself on how to force-sync my really outdated master branch with an active branch. This is taken from this excellent post:

git checkout -b tmp origin/upstream
git merge -s ours downstream
git checkout downstream
git merge tmp
git branch -D tmp

where upstream is the branch whose commits we want and downstream is the branch we want to merge into.