I have a very out of date master
branch in a git repository.
All of my work has been done in another branch.
What is the best way to merge the
If you are fine with losing the history of your master branch you just let master
point to the head of your current branch (your don't "overwrite" master
- the branch - per se):
git checkout yourotherbranch
git branch -D master
git checkout -b master
Of course if you have a remote clone, you'll then have to
git push -f origin master
Nota bene: this specifically applies to replacing the whole of your master
branch and throwing the old master
away as the title suggests.
Otherwise, you should be fine with git merge master --strategy=ours
.