Git Overwrite master with branch

前端 未结 2 1421
忘掉有多难
忘掉有多难 2021-01-30 13:40

I want to overrite master with a particular branch after making changes to it, what I done to do it is:

Step 1: Checkout brranch from Git, using command :



        
2条回答
  •  梦毁少年i
    2021-01-30 13:55

    git branch -f master dev_branch will rewrite local master branch.

    git push remote +dev_branch:master will rewrite remote branch.

    • NOTE: If the above doesn't work, the name remote could be origin for you (i.e. git push origin +dev_branch:master)

提交回复
热议问题