Mercurial:使一个分支与另一个分支相同(Mercurial: make one branch identical to another)

编程入门 行业动态 更新时间:2024-10-27 08:39:07
Mercurial:使一个分支与另一个分支相同(Mercurial: make one branch identical to another)

我正在与另一位相对较新的开发人员合作。 为了让我对她的工作进行代码审查,我让她创建了一个分支,我可以查看并定期合并,如果我对这些变化感到满意的话。

那个分支已经被软管了,所以我只想“重置”它,以便它与主线相同,所以她可以从干净的代码重新开始。

我可以创建一个新分支,但我想保留相同的名称,避免创建不必要的副本。

那么如何使分支B与分支A完全相同?

I'm working with another developer who's relatively new. In order to allow me to do code review on her work, I had her create a branch which I can review and periodically merge if I am happy with the changes.

That branch has gotten hosed, so I just want to "reset" it, so that it's identical to the mainline, so she can start again from clean code.

I could create a new branch, but I'd like to keep the same name and avoid creating unnecessary copies.

So how do I make branch B exactly the same as branch A?

最满意答案

(简单的好奇心:那个分支是如何被“h”的?)

您可以关闭当前的代码审查分支,然后使用--force以相同的名称启动另一个分支。

hg com --close-branch -m "closing" hg branch "same_name" --force

(Simple curiosity: how has that branch been "hosed"?)

You can close the current code review branch, then start another with the same name with --force.

hg com --close-branch -m "closing" hg branch "same_name" --force

更多推荐

本文发布于:2023-08-05 10:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1431255.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分支   Mercurial   identical   branch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!