开发者

Move a fix from a branch to the default branch

I have a mercurial repository with two branches (default and 开发者_C百科branch1) I have a fix that I wanted to do on default but I made it in branch1. I don't want to merge from branch1 to default. Is there a way to move that fix to the default branch without moving anything else?


If you commit a changeset on the wrong branch, then you have two options:

  1. copy the changeset to the right branch with transplant. The change will now appear twice in your history, but standard three-way merge will deal with that just fine. I've described that scenario in my guide to named branches.

  2. move the changeset to the right branch with something like mq. This should only be done for changesets that haven't been pushed anywhere since you're editing history.


You can use transplant, https://www.mercurial-scm.org/wiki/GitConcepts but it requires the transplant extension.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜