Skip to content

Updating Production to match Master

Roy Johnson edited this page Jan 30, 2017 · 1 revision

If Production is just some number of commits behind Master, you can check it out, git rebase origin/master and push it, and it will be exactly the same (the latest commit SHA will be the same).

If a rebase has conflicts that you want to override and make Production match Master, you can git reset --hard origin/master. You will not be allowed a simple push after doing this. You will have to go into the settings of GitHub and un-protect the Production branch so that you can force-push (git push --force-with-lease). After force-pushing, go back into settings and re-protect the Production branch.

If Production has some commits (hotfixes) that are not in Master, they will not be exactly the same after rebasing, and a simple push will not succeed. As above, you will have to go into settings and un-protect the branch so that you can force push (git push --force-with-lease). After force-pushing, go back into settings and re-protect the Production branch.

Clone this wiki locally