如何删除Mercurial中应用于错误分支的某些提交,然后在正确的分支上重播它们? [英] How can I remove some commits in Mercurial that were applied to the wrong branch and then replay them on the correct one?

查看:32
本文介绍了如何删除Mercurial中应用于错误分支的某些提交,然后在正确的分支上重播它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的同事在错误的分支上的存储库中提交了两次.

My colleague has committed twice on his repository on the wrong branch.

进行这两次提交,摆脱它们然后在正确的分支下正确提交它们的最有效方法是什么? (更改尚未推送)

What is the most effective way to take those two commits, get rid of them and then commit them correctly under the right branch? (the changes have not been pushed)

理想情况下,我们希望从TortoiseHG中执行此操作,但是,当然,如果是最佳选择,我们将使用命令行.

We'd ideally like a way to do this from within TortoiseHG but of course, we'll use the command-line if it is the best option.

推荐答案

从我发现的结果来看,移植是使用的最佳扩展.它将changset应用于您想要的任何其他版本.

From what I have found out, transplant is the best extension to use. It applies a changset to any other revision you want it to.

http://mercurial.aragost.com/kick-start/task.html#transplanting-changes

我的问题的解决方案是更新到应该应用两个更改的分支,将两个更改集移植到其中,然后使用mq剥离更改.所有这些在tortoisehg内也是可行的.

The solution to my problem was to update to the branch where the two changes should have been applied, transplant the two changesets in and then use mq to strip the changes. All do-able within tortoisehg too.

这篇关于如何删除Mercurial中应用于错误分支的某些提交,然后在正确的分支上重播它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆