Mercurial:使长期分支保持最新状态以了解默认情况下的最新更改?
我们目前正在重写代码库的很大一部分。我们选择为此创建一个单独的分支,因为返工将需要几个月的时间,我们应该同时修复错误并使用新功能更新默认分支。显然,我们希望我们的返工分支不要偏离默认分支太多。
我们决定每月一次将默认值合并到返工分支中。这应该可以解决我们的问题,并在几个月后当我们想要在默认情况下合并返工分支时使我们免于合并的地狱。
今天,我们在返工分支中第二次合并了默认值(自返工开始以来已经过去了两个月),但我在合并过程中注意到了一些奇怪的事情。看起来我们第一次(一个月前)进行的合并今天必须再次进行。如果是这样,那么我们并不能通过每月的合并赢得任何时间,我们还可以将其推迟到返工结束时。但我的假设是否正确:如果我将默认值合并到一个分支中,一段时间后我再次在该分支中合并默认值,那么我第一次合并它并不重要?第二次合并的工作保持不变,我们是否可以不去管分支,最后进行一次大合并?
We are currently reworking a big part of our code base. We choose to create a separate branch for this since the rework will take several months and we should be fixing bugs and updating the default with new features in the meantime. Obviously we want our rework branch not drift away from the default too much.
We decided to merge the default into the rework branch once every month. This should solve our problem and save us from a hell of a merge after a couple of months when we want to merge our rework branch in the default.
Today we merged the default for the second time in our rework branch (2 months passed since the start of the rework), but I noticed something strange during the merge. It seems like the merging we did the first time (a month ago), we had to do it again today. If so, then we aren't winning any time with merging every month and we could as well postpone it to the end of the rework. But is my assumption right: if I merged the default into a branch and after some time again I merge the default again in that branch, it doesn't matter if I merged it the first time? The work for the second merge stays the same, we could as well leave the branch alone and do a big merge in the end?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是什么让您认为第一次合并“不起作用”?
第二次合并只需“合并”现在默认位置与第一次合并发生时默认位置之间的增量。
另外,根据两个分支中正在完成的工作量,我想说每月合并一次是一个很长的时间段,以保持分支不同步。
附带说明一下,如果您想让历史记录更漂亮,您可以只进行变基而不是不断合并(请记住,如果返工分支被推/拉,则这是不行的)。
What makes you think the first merge "didn't work"?
The second merge will only have to "merge" the delta between where default is now and where it was when the first merge occurred.
Also depending on the amount of work being done in both branches, I would say that merging once a month is a very long time period to keep the branches out of sync.
As a side note, if you want to keep the history prettier, you could just rebase instead of constantly merging (keep in mind that if the rework branch is being pushed/pulled, it's a no-go).