alistairphillips.com

I’m : a web and mobile developer based in the Australia.


Replacing a master branch in git

A good few months ago, with the best intentions I might add, I created an "iOS8_Changes" branch for a project I was working on and coded up the re-write I was doing there. Unfortunately, after releasing that change, I neglected to merge the changes back into master and continued to code many new releases in that branch. By this stage master was way out of date and I didn't feel comfortable trying to merge changes from the branch into master.

Stackoverflow to the rescue again with How to replace master branch in git, entirely, from another branch which solved my problem. So I've always got a local copy handy the relevant steps were:

git checkout ios8_changes
git merge -s ours master
git checkout master
git merge ios8_changes