how to create multi-level remote branch in git?

1.2k Views Asked by At

for example , my project have two branches, master and test.Branch master is used for code which is already tested and can be delivered, Branch test is used for code which is just submitted and need to be tested.But Since we have 5 developers and we want to create 5 sub branches in test branch , what can I do?

1

There are 1 best solutions below

0
On

If ever you want more branches, simply create them. Pick a good spot to base them from (some commit on master would be ideal), and you and your team can work from there.

In a few Git workflows - notably Git Flow - this strategy comes to be known as creating feature branches; that is, a branch for a feature which is relatively short lived, merged into an integration branch for testing, and merged into production code. Since branches are inexpensive to create, it would be a good idea to create a branch per feature, merge it into your test branch, and once it's ready to go, merge it from the test branch into master and delete the feature branch.

I would not advise that you create a branch per developer, as this means that the work they're doing quickly becomes conflated with the branch they're on. More granular changes mean that integration points are a lot less painful when the time comes to merge everything upstream.