我想将变更集从一个分支移动到另一个分支。基本上,我目前有:
A -> B -> C -> D # default branch
我想要:
A # default branch
\-> B -> C -> D # some_new_branch
其中 some_new_branch 尚不存在。我习惯了 git,所以我想我缺少一种简单的“mercurial”方式。
最佳答案
一种方法是导出 B、C、D 的补丁;更新为A;分支;应用补丁:
hg export -o patch B C D
hg update A
hg branch branchname
hg import patch
要从默认分支中删除 B、C、D,请使用 mq 扩展的 strip
命令。
关于mercurial - 如何将一些变更集移动到 Mercurial 中的新分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2219756/