I have two branches. Staging and Beta. Staging has code in it ( including files ), that I do not want at all. How can I make Beta completely overwrite Staging, so that none of those files or code are merged from Staging into Beta.
I see some people recommend doing this :
git checkout staging
git merge -s ours beta
But I don't believe the pre-existing files would be a "code conflict" and therefore would not be removed. Am I wrong? If I'm right, how would I accomplish this?
If you don't care about the old history of
staging
, you can just recreate it:If you do care about the old history of
staging
, then things get more fun:You can simple delete
staging
and re-create it based onbeta
:I suggest you just rename it in case you change your mind.
If you really can't stand having that extra branch around:
If the history of staging is not going to be an issue, you can simply do this.
Just remember the history of staging will be gone after the above command and staging will have the work of your beta branch.