[英]Mercurial workflow - when can I rebase, when should I merge?
We've been using Mercurial at work for a couple of months now. 我们已经在工作中使用Mercurial几个月了。 We've modified our workflow a few time and ended up with this: 我们已经修改了我们的工作流程一段时间,结果是:
The initital snapshot was on staging , we then cloned that onto our central repository and everyone cloned that locally . 初始快照正在进行分段 ,然后我们将其克隆到我们的中央存储库中 ,每个人都在本地克隆。
This has worked for us for a while, but there's still rough spot that make us go: "mmmmh, maybe there's a better way, it doesn't quite feel natural" . 这对我们来说已经有一段时间了,但是仍有一些让我们走的原点 : “嗯,也许有更好的方式,它不太自然” 。
The biggest issue we have is when we have a feature branch that grows old on our local machine. 我们遇到的最大问题是我们的本地计算机上有一个功能分支。
Example: 例:
At this point, that branch is way behind the current default. 此时,该分支远远落后于当前默认值。 If I finish it and try to merge it on QA I'll get so many conflicts (for which you pretty much always keep what's on QA now.) 如果我完成它并尝试将其合并到QA上,我将会遇到很多冲突(为此你几乎总是保留QA上的内容。)
What we sometime do to mitigate this problem is we merge default back into EpicNewFeature so as to bring it "up-to-speed". 我们有时会采取什么措施来缓解这个问题,我们将默认值合并到EpicNewFeature中,以使其“达到速度”。 This simplifies our merge on QA but it's still usually one heck of a local merge. 这简化了我们在QA上的合并,但它通常仍然是本地合并的一部分。
I've read about rebasing which is suppose to help making the next merge a fast-forward since you (from what I understand) inject the history in the middle, altering your own history. 我已经阅读了关于变基的内容,这可能有助于使下一次合并成为一个快进因为你(根据我的理解)在中间注入历史,改变你自己的历史。
Most place I've read about rebase warn you not to do it if you've already pushed your branches though, and definitely not if someone might have pulled your changes already. 我读过关于rebase的大多数地方警告你,如果你已经推动了你的分支,你就不要这样做,如果有人可能已经取消了你的修改,那绝对不会。 How can you make sure of that? 你怎么能确定这一点? we push often to the central repository for backup and we usually just hg pull everything. 我们经常推送到中央存储库进行备份,我们通常只需要提取所有内容。
Do you see something that would help us improve our current workflow? 您是否看到了有助于我们改进当前工作流程的内容? Would rebasing more often help us? 变形会更经常帮助我们吗?
I think you've misunderstood what rebasing does. 我想你误会了垫底呢。 It works by simply merging to the tip of your repository and then cutting away the original links. 它的工作原理是简单地合并到存储库的顶端,然后切掉原始链接。 It's pretty much the same action as taking a "diff" and applying that to the tip. 这与采取“差异”并将其应用于提示几乎相同。
You'll still get all the same merge conflicts you're trying to avoid. 你仍然会得到你想要避免的所有相同的合并冲突。
Usually the easiest way to deal with these conflicts is piecemeal. 通常,处理这些冲突的最简单方法是零碎的。 Don't try to to merge up to the tip all in one go. 不要试图一次性合并到提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.