将一个命名分支合并到另一个分支(追赶),但保留两个分支

发布于 2025-01-08 09:30:46 字数 384 浏览 0 评论 0原文

我们在 Mercurial 中有两个命名分支:

  • “default” - 一个“bugfixing”分支,我们在其中修复 bug
  • “redesign”命名分支,我们在其中为应用程序进行全新的 UI 设计

现在,我想合并我的“bugfixing”分支到“重新设计”分支。但保持“错误修复”分支不变

换句话说,我想更新默认的命名分支,但不实际合并分支。想不出办法……

我应该

hg merge default

在我指定的分支中这样做吗?但这会保留这两个分支吗?

附言。我对 hg 很陌生,抱歉,如果这是一个愚蠢的问题......

We have two named branches in Mercurial:

  • "default" - a "bugfixing" branch where we fix bugs
  • "redesign" named branch where we do a whole new UI-design for the app

Now, I'd like to merge my "bugfixing" branch into the "redesign" branch. But keeping the "bugfixing" branch untouched.

In other words, I want to update my named branch from default, but without actually merging the branches. Can't figure a way to that...

Should I just do

hg merge default

while in my named branch? But will this keep the two branches?

PS. I'm quite new to hg, sorry if this is a stupid question...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

栖迟 2025-01-15 09:30:46

我想更新默认的命名分支,但不实际合并分支

,即你想要根据 Mercurial 合并分支 - 合并默认值以重新设计。在 Mercurial 中,分支合并并不意味着“你不能再使用合并的分支”——你可以,只需更新到分支头,编辑并提交

I want to update my named branch from default, but without actually merging the branches

I.e you want merge branches in terms of Mercurial - merge default to redesign. In Mercurial branch-merge does not mean "You can't use merged branch anymore" - you can, just update to branch head, edit and commit

相对绾红妆 2025-01-15 09:30:46

我没有使用 Mercurial 分支,因为我们使用 Kiln“分支存储库”(基本上是与原始存储库一起存储在服务器上的存储库的克隆)。当我们将更改从一个存储库合并到另一个存储库时,它不会修改原始存储库,它更多的是“将更改从分支 A 复制到分支 B”而不是合并。 Mercurial 分支的工作方式可能完全相同。

测试它的最简单方法是将存储库克隆到某个地方,然后进行合并。只要你不推动,你就可以在完成测试后扔掉那个克隆。合并分支,看看它们是否都保留(我怀疑它们会保留,除非您明确关闭一个分支,尽管您所在的分支以及您合并的分支将给出相反的结果!)并进行您想要的更改。您始终可以使用“hg rollback”快速恢复上次操作并尝试不同的操作。

I haven't used Mercurial branches, as we use Kiln "branch repositories" (basically clones of a repo stored on the server alongside the originals). When we merge changes ffrom one repo to another, it doesn't modify the original one, it's more of "copying changes from branch A into branch B" than merging. It's possible that Mercurial branches work exactly the same.

The easiest way to test it, is to clone the repo somewhere, and do the merges. As long as you don't push, p you can just throw away that clone when you're done testing. Merge the branches, see if they both remain (I suspect they will, unless you explicitly close one, though which branch you're on, and which you merge, will give opposite results!) with the changes you want. You can always use "hg rollback" to quickly revert the last operation and try different things.

冷血 2025-01-15 09:30:46

合并 Alex 后,Mercurial 不会删除您的分支,它只是从 src(重新设计)分支获取文件并将其与目标(默认)分支合并。之后您的队友将继续在 src 分支中工作,如果您想再次拉取下一个版本,您只需再次执行合并即可。

之后,您可以决定是否要推送现在默认的合并分支,或者是否要等到分支稳定后再执行此操作。

Mercurial didnt deletes your branch after you merge Alex, it just get the files from the src (redesign) branch and merge it with the target(default) branch. Your team mate will keep working in the src branch after that and if you want pull the next versions again you just have to perform the merge again.

After that you can decide if you want to push the merged one that is your default now or if you will wait until the branch get's stable to do it.

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