How can I overwrite, not merge, one remote branch into another branch?

后端 未结 4 508
慢半拍i
慢半拍i 2021-02-02 08:33

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 t

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-02 08:50

    If the history of staging is not going to be an issue, you can simply do this.

    git checkout staging 
    git reset --hard beta
    

    Just remember the history of staging will be gone after the above command and staging will have the work of your beta branch.

提交回复
热议问题