将多个 Mercurial 分支合并在一起
我有一群开发人员使用分支修复错误。我的需要:自动(或者有没有办法)将所有这些分支合并到一个主分支“默认”的最佳方法是什么。
谢谢
I have a bunch of developers who do their bug fixes using branches. My Need: What's the best way to automate (or is there a way) merging all of these branches into one main branch, "default".
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
注意:这是我的意见,这里可能有多种意见,但至少要理解我的观点并决定你想要不同的观点。
首先,这里缺少一些东西,我认为从长远来看这会给你带来工作流程问题。
合并不应该被跳过或委托给其他人,在这些分支中工作的开发人员应该自行合并。他们,可能只有他们,会知道他们做了什么,以及如何解决合并冲突。
无论如何,完全自动化地完成它是行不通的。
这是开发人员应该使用的工作流程(在我看来)。
定期(例如每天早上),分支上的开发人员应该检查构建服务器以确保默认分支构建。如果确实如此(而且应该如此!),他们会将默认分支合并到自己的分支中。
这具有三个主要好处:
在某些时候,他们被读取将他们的工作集成回默认分支(或者定期,即新功能的部分发布,或者在最后,一切都完成),然后他们再次合并来自< /em> 默认回到自己的分支。这确保了任何挥之不去的合并冲突都由该团队在其分支中处理,然后再将其发布给其他开发人员。
当他们处理了由于该合并而导致的任何合并冲突时,他们可以合并另一个方向,从其分支返回到默认分支。此时,除非有人设法同时将任何冲突的更改合并/推送为默认值,否则根本不会出现合并冲突。
这样做可以确保:
如果其中任何一个不清楚,请发表评论,我会相应地更新/编辑。
Note: This is my opinion, there can be multiple opinions here, but at least understand my point here and decide you want it different.
First of all, there is something missing here, and I think this will generate workflow problems for you in the long run.
Merging is not something that should be skipped, or delegated to other people, the developers that work in those branches should merge themselves. They, and probably only they, will know what they did, and how to resolve merge conflicts.
In any way, doing it fully automatic, that's not going to work.
Here's the workflow the developers should use (in my opinion.)
Periodically, for instance every morning, the developers on a branch should check the build server to ensure that the default branch builds. If it does (and it should!), they merge from the default branch down into their own.
This has three major benefits:
At some point they're read to integrate their work back into the default branch (either periodically, ie. partial releases of new features, or at the end, everything is done), and then they do yet another merge from default back into their own branch. This ensures that any lingering merge conflicts are handled by that team, in their branch, before they release it to the rest of the developers.
When they have dealt with any merge conflicts due to that merge, they can merge the other direction, from their branch back to default. At this point, unless someone has managed to merge/push any conflicting changes into default in the meantime, there will be no merge conflicts at all.
Doing it this way ensures that:
If any of this was unclear, please leave a comment and I'll update/edit accordingly.