Caveat: I don't have experience using github. That having been said...
I don't think you really want a merge here. If I understand correctly, you have a branch that reflects what's deployed (production
), and you have a branch that includes the deployed content as well as newer changes (master
), but now you're ready to promote the changes in master
to be the new production
content.
In this case, I think your last suggestion is close to what you want to do, though you shouldn't need to play with deleting the content inside the existing production branch. I would
- Tag the current
production
branch so that you don't lose track of it.
- Move the
production
branch to point to the head of master
.
I believe you can do step #2 by running git branch -f production master
, which should create a new production
branch using master
as a starting point. Because production
already exists, you need the -f
flag to force its creation. This should also be equivalent to running git checkout production
, then git reset --hard master
to force the head of the branch to match master
.
Again, I would be sure to tag the head of your original production
branch before doing anything, both for posterity as well as a safety net in case this doesn't work right the first time.