Notes
Replace and overwrite branches in Git
overwriting master with another branch using git merge -s ours, or a force push when the histories don’t matter
Git & Github
tl;dr
1# merge a branch on top of your existing master
2git checkout hotstuff
3git merge -s ours master
4git checkout master
5git merge hotstuff
NOTES:
-s oursor--strategy=ourswill get rid of all changes in the other (obsolete) branch and overwrite with our branch (the branch you’er currently in).- If you are using
ourwith amasterbranch, it’ll overwrite everything in master and prefer changes in the other branch - You can use
--no-commitwhen merging to avoid the need of a commit message
You can also try obliterating master all together:
1git push -f origin hotstuff:master
This is useful when the other branch is not based off of master and the branch histories are completely irrelevant