How to reset a branch to another branch with git?

前端 未结 5 1559
走了就别回头了
走了就别回头了 2020-12-12 12:14

let\'s say that we have an hotfixes branch which was created from master. we added commits to hotfixes, but those commits were not use

5条回答
  •  無奈伤痛
    2020-12-12 12:56

    You mean you want to push your local master to the remote hotfixes branch? Like this:

    git push origin +master:hotfixes
    

    However, this requires that you are allowed to re-write the history on the remote side.

提交回复
热议问题