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

By Druss , 9 February, 2012

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.

Tags

Tags Old

All times are UTC. All content licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.