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

后端 未结 4 563
慢半拍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 09:00

    I suggest you just rename it in case you change your mind.

    git branch -m staging staging_oops
    git checkout beta
    git branch staging
    

    If you really can't stand having that extra branch around:

    git branch -D staging_oops
    

提交回复
热议问题