推送无历史记录的 Mercurial 合并分支

发布于 2024-12-07 21:45:10 字数 456 浏览 0 评论 0原文

鉴于我已经在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

假装爱人 2024-12-14 21:45:10

您希望将 hg rebase--collapse 选项。

hg rebase --collapse --source [g] --dest [b]

rebase 扩展随 Mercurial 一起提供,您只需在您的文件中启用即可。设置文件。

ps 如果你已经提交了合并[k],你应该回滚(或剥离),然后再变基。

Instead of merging, you want to use hg rebase with the --collapse option.

hg rebase --collapse --source [g] --dest [b]

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.

不乱于心 2024-12-14 21:45:10

如何将该分支的合并结果推送到远程存储库,而无需了解如何获得该合并分支结果的历史记录

无法获取合并分支的剥离历史记录

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

No ways to get stripped history for merged branches

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文