I tried to google the answers and got articles all about branching models and how to create feature branches, which are not the answers I am looking for. I know I might not use the proper key words to search the answers, the guide about the key words for the relevant answers would also helpful.
My question has two parts:
When we are developing features for a project and these features could be used for other projects in the future, we want to source control each feature so that other projects can just take whatever features needed for the specific feature(s) in the specific project. Is this what feature branch model can help achieve?
As a feature is just part of a complete program, which can be run and tested, should a feature branch contain the whole program, or just the source files for that specific feature?
Thanks! Crane
I'm going to put this here, but the question will likely be closed as opinionated. There's a whole Software Development Life Cycle that needs to be understood here.
The concept of a
featurebranch is part of thegitflowworkflow.https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
Let's say you have a bunch of projects, each project has a ticket in Jira or a similar program. Each ticket outlines a feature for your project. The feature can be a small change or a big change. A big ticket (an Epic) might be broken down into a collection of smaller tickets.
So for each ticket, you create a
featurebranch. If the ticket isPRJ-1234, then create a new branch off of thedevelopormainbranch (depending on your process). Name that branchfeature/PRJ-1234.You create a pull request from that
featurebranch. Have it reviewed, then it gets merged to yourdevelopbranch. You can keep using that feature branch to address bugs during the development time period. Once that code has been merged and it's made ready to deploy to production, you can delete thatfeaturebranch since the code is now part of the main code base.So if you have 8 tickets, then the dev team should have had 8
featurebranches. Those branches should generally only exist for the life of that sprint (release). You don't reusefeaturebranches for other tickets.