问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/20895718/sharing-features-or-not-in-git-flow