推送无历史记录的 Mercurial 合并分支
鉴于我已经在 Mercurial 中创建了一个分支,如何将该分支的合并结果推送到远程存储库,而无需了解如何获得该合并分支结果的历史记录。例如。
[a] - [b] -----------------[k]
\ /
[g] - [h] - [i] - [j]
[a]、[b] 和 [k] 是“默认”分支,[g] 到 [j] 是功能分支。将功能分支合并到默认分支后,当我推送时,如何在远程存储库中只有 [a] - [b] - [k] 更改集?我不想根本看不到分支,我根本不想将这些更改集推送到远程存储库。我不在乎我是如何得到[k]的,但我确实关心[k]的最终结果是什么。
我目前倾向于通过克隆方法来分支,但是如何通过克隆来实现这一目标?还有一种方法可以使其与命名分支一起工作吗?
我一直在寻找这个问题的答案,但有太多的文档,很难大海捞针。
Given that I have created a branch in Mercurial how can I push the resulting merge of that branch to a remote repository without the history of how I got to that merged branch result. For example.
[a] - [b] -----------------[k]
\ /
[g] - [h] - [i] - [j]
[a], [b] and [k] being the 'default' branch, [g] through [j] being the feature branch. Once I merge the feature branch into the default branch how can I have just [a] - [b] - [k] change sets in the remote repository when I push? I don't want to simply not see the branch, I do not want those change sets pushed to the remote repository at all. I don't care how I got to [k], I do care what the [k] end result is though.
I am currently leaning toward the branch by cloning method but how can I accomplish this with cloning? Would there also be a way to make this work with named branches?
I have been looking for an answer to this but there is so much documentation out there it's difficult to find this needle in a haystack.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您希望将 hg rebase 与 --collapse 选项。
rebase 扩展随 Mercurial 一起提供,您只需在您的文件中启用即可。设置文件。
ps 如果你已经提交了合并[k],你应该回滚(或剥离),然后再变基。
Instead of merging, you want to use hg rebase with the --collapse option.
The rebase extension is shipped with Mercurial, you just need to enable it in your settings file.
p.s. If you have already committed the merge [k], you should rollback (or strip) it first before rebasing.
无法获取合并分支的剥离历史记录
No ways to get stripped history for merged branches