Mercurial/hg:将更改从分支获取到主干
显然我已经检查了过去几周对分支的提交。除了对一个文件的更改之外,我想将所有内容提交到主干。我该怎么办?
Apparently I've checked the last couple of week's commits into a branch. Apart from the changes to one file, I want to commit everything to the trunk. What do I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您使用 Mercurial 谈论命名分支时,您谈论的是变更集上的永久属性。变更集不能位于不同的分支上但仍然是相同的变更集。您可以(如@Matt Ball)建议将该分支的结果合并到默认值中:
或者您可以通过疯狂的、破坏历史的扭曲来假装这些更改没有在分支上完成(如@Rudi 详细信息(抱歉))。
现在只需合并,将来考虑使用书签、匿名分支或单独的克隆,用于您不想立即推送的工作 - 这些都不会在变更集上进行永久注释。
When you're talking named branches with Mercurial you're talking about a permanent attribute on a changeset. A changeset cannot be on a different branch and still be the same changeset. You can (as @Matt Ball) suggested merge that branch's result into default:
Or you can go through, crazy, history-destroying contortions to pretend those changes weren't done on a branch (as @Rudi details (sorry)).
Just merge for now, and in the future consider using bookmarks, anonymous branches, or separate clones, for work you don't wnat to push immediately -- none of those make permanent annotations on changesets.
如果您没有推送新分支的任何变更集,并且分支中没有合并,则可以使用 mq 扩展将主干中不需要的变更集移动到分支的尖端。
If you did not push out any of the changesets of the new branch, and have no merges in the branch, you can use the mq extension to move the in trunk unwanted changeset to the tip of the branch.