In a project managed by Git, there might be times that you need to completely trash the master branch and completely replace with another branch.
lets say you have a “v2” branch. you can replace the master branch with the following steps
Checkout to the v2 branch
merge it with the master branch with “ours” strategy.
Checkout to the master branch
merge the v2 branch to master
The old master branch is now gone and the contents of the master is the contents of v2 branch.
Did you find this useful?
I'm always happy to help! You can show your support and appreciation by Buying me a coffee (I love coffee!).