Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branch per feature\story\epic VS branch per sub-task in a Frontend+Backend repo?

We have a team in web development project and we've decided to go with a single repository with its pros and cons. We have our backlog split up into Jira stories and every story has several FE and BE tasks. Like:

  1. ABC-1 Display cats

    1.1. ABC-2 [FE] Display cats markup

    1.2. ABC-3 [FE] Send CRUD requests for cats

    1.3. ABC-4 [BE] Create CRUD endpoints for cats

The question is should we create a single branch abc-1-display-cats and put FE+BE commits in it and then merge it into dev branch, OR should we create small abc-2-display-cats-markup, abc-4-create-crud-endpoints-cats branches for each sub-task and then merge every small branch into dev ?

Branch per feature

  • +we can easily remove feature by undo 1 merge commit
  • -anyone can break a feature branch with his code

Branch per subtask

  • +everyone works in his own branch and may break codebase
  • -we cannot simply remove a feature of 5-6 branches
like image 751
user3468806 Avatar asked Feb 20 '18 09:02

user3468806


1 Answers

You can create a feature branch like abc-1-display-cats branch from dev branch. For each of the subtask create a new branch abc-4-create-crud-endpoints-cats from the feature branch abc-1-display-cats and merge it back to the same feature branch. dev branch will interact only with feature branch, so you can perform rollback of whole feature. Also each developer can work independently on its subtask branch.

like image 189
Ritesh Agrawal Avatar answered Sep 27 '22 00:09

Ritesh Agrawal