简体   繁体   English

Git将master合并为分支和新功能

[英]Git merge master into branch and new feature

I have 2 components being developed at the same time component A and component B. And component A needs to use component B for it to be complete. 我同时开发了两个组件A和B。组件A需要使用组件B才能完成。

If component B is completed first and then merged into master as it is a stand alone component. 如果组件B首先完成,然后合并为母版,因为它是独立的组件。 How should I go about getting that into A so it can be completed? 我应该如何将其放入A以便可以完成?

After merging B into master should I merge master into A? 将B合并为master之后,我应该将master合并为A吗?

Should I merge A in half done and then retrench? 我应该将A合并成两半然后缩减吗? (This doesn't seem correct) (这似乎不正确)

Is there some option that I am missing? 有什么我想不到的选择吗?

Thank you 谢谢

将B合并到master中,然后将master合并到A中。

This is really a matter of etiquette on your repository, there's no right answer except the answer given by the owners of your code repository. 这实际上是您存储库中的礼节问题,除了代码存储库所有者给出的答案之外,没有正确的答案。

However the thing which is (almost) universal is to avoid merging A and B together directly. 但是,(几乎)通用的事情是避免将A和B直接合并在一起。 If A and B are truly separate pieces of work, they should be merged into master individually. 如果A和B是真正分开的工作,则应将它们分别合并到母版中。

The most common work flow here would be: 这里最常见的工作流程是:

  • The developer of B completes the work, then submits a pull request B的开发人员完成工作,然后提交拉动请求
  • The pull request is approved and B is merged into master 拉取请求被批准并且B被合并到主请求中
  • A's developer merges master into A . A的开发人员将master合并到A中 No pull request required, A's developer owns A's branch and can change it as much as they like. 不需要拉取请求,A的开发人员拥有A的分支,可以随意更改。
  • A's developer completes the work, then submits a pull request A的开发人员完成工作,然后提交拉取请求
  • The pull request is approved and A is merged into master . 拉取请求被批准,并且A合并到master中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM