I am starting a new Project and it has been decided that we shall use git for our version control.
It is a project which involves development of multiple components / Microservices from scratch.
To address the complexities in our organisation where we have junior developers, senior developers, dev leads, architects etc., I was looking to use a git workflow based more or less on gitflow, so that we can ensure that developers can work on feature branches and before moving on to the develop branch, we have some code review process in place. I want to have master branch which corresponds to the production / production ready code and release branches to signify the current release in progress.
It is an agile project so my idea is to have develop branch corresponding to the sprint code (unit tested and reviewed) and the release branch corresponding to the release (=3 sprints).
The only issue I am facing is how to define the master branch and the relationship between master and develop at the beginning.
Since it is a new dev project, we begin with no production code and everything would basically start from feature branches, move to develop, release and then the master when we have the production ready code.
Any suggestions on how to handle this in a good way and also, is this a good idea
Thanks in advance
Here are a few options:
Git Flow (branch from develop, merge into develop)
The idea behind git flow is that developers build and contribute to a "develop" branch and once the powers-that-be decide it's about time to do a release, you "cut" off of that branch and create a release branch to refine until it's good enough to actually be released.
Pros:
Cons:
Branch from master; merge into release branch
This is one that I think is the most straight forward but definitely has drawbacks. The idea is that all features are branched off of master (which matches production at all times) with the assumption that these branches can be merged into ANY branch at ANY time. When you are ready to start testing a release, you simply make a new Release_v99 branch (with an appropriate name) off of the master branch. You merge in the feature branches you want to be released, then test against the Release_v99 branch.
Pros:
Cons: