1

In development, we often come across a scenario like this:

In a MVC web development, stuff A may mainly develop View, while stuff B may mainly develop Controller, then a feature branch like feature/account maybe shared by A and B to cooperate the development of account.

If we manage feature branches like above:

Question 1: Is it recommended that sharing feature branches between stuffs between stuffs?

There's another way to manage feature branches, like this:

  • stuff A manage a branch named feature/account-view
  • stuff B manage a branch named feature/account-controller

However, If we manage feature branches like account-view and account-controller, we need to merge these two feature branches first before doing some testing jobs. And it seems the workflow becomes more complicated.

Question 2: Which branch management is better? feature/account or feature/account-view feature/account-controller

Charles0429
  • 1,406
  • 5
  • 15
  • 31

1 Answers1

0

Is it recommended that sharing feature branches between stuffs?

Yes, that is what a configuration is:

Generally, feature/account-controller is more practical, and closer to a configuration management: your branch represents the configuration you need to work.
If stuffA and stuffB are in their own Git repos, then it is a component approach, where you use one branch to isolate evolutions done on a set of components (group of files, here stuffA and stuffB, your config) you need to develop and test.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I try to catch your meaning. Do you mean that we should take `feature/account-controller` as one component? – Charles0429 Jan 03 '14 at 07:03
  • @Charles0429 no, unless stuffA and stuffB are in the same repo. A "component" (coherent set of file) usually is a all Git repo. Anyway, the idea is to use the same branch for StuffA and StuffB. – VonC Jan 03 '14 at 07:43
  • @Charles0429 by the way, are StuffA and StuffB 2 different Git repos, or 2 folders within 1 repo? – VonC Jan 03 '14 at 07:46
  • stuffA and stuffB works in the same git repos, stuffA focus on frontend programming and stuffB focus on backend programming. But at the same time, they should cooperate to finish a function(ie user account management in a web system). So, when we need do some testing, we need to merge the two branches if we manange branch like `account-controller`, so I think it's not very convenient at the time of testing. If we manage branch like `account`, stuffA and stuffB share the branch, then they may affect each other, so I ask this question to find a better solution. Please give me some advice~ – Charles0429 Jan 03 '14 at 09:42
  • @Charles0429 If they are in the same repo, one branch is enough for both components, especially if they are linked (meaning changing one usually involves changing the other) – VonC Jan 03 '14 at 10:21