The diagram below is the most famous one describing Gitflow.
However, it is not easy to understand at a first glance.
There are tons of alternative and different ways to apply Gitflow to your project. In this post, introduce the easiest and comprehensible strategy that I use.
First, check the simple workflow for developing projects for most companies (including start-ups) below.
In the workflow, the most important process is improving and checking every single detail for the service and product.
If those important processes apply to the developing process with git, the processes look like the way on the diagram below.
Names mentioned above, Develop
, Staging
, and Master
, can be changed up to the situation, plus they are just branch names. These are conventional naming rules: Develop
, Staging
, and Master
.
Mostly develop
branch is giving a developer a chance to freely test their own work for no cost, so that developer easy to see how their job is applied to service, not the local but on the browser or other runtime environment.
The feature branch
is basically branching out from the Master
.
At this point, the Master
, Staging
, and Develop
branches are identically the same.
Naming feature
branch is also up to the company’s or team’s convention.
They use feature/[developer's name]
or f-[ticket number]
or other variation.
The Staging
branch is for QA(Quality Assurance).
After developers confirm and test their own jobs from the Develop
branch, it pushes and merges Develop
branch to the Staging
branch.
If developers are perfect (they aren’t), Inevitably, there are feedbacks from QA.
If so, back to your Feature
branch then pushes and tested to the Develop
branch.
Then pushes again to the Staging
branch and confirmed from QA.
After QA is confirmed, it is now time to pushes & merges to the Master
branch.
Then, release the service to the public.
Here is another Git flows example you can apply.
Developer can test on Develop
branch, then not merging from Develop
to Staging
, but directly pushes to Staging
branches.
After QA confirmed, Developer also just pushes to the Master
branch.
It also can be applied emergency situation such as Hotfix.
That’s it!
When I first heard about Git flow
, I thought what the heck was that?
.
However, now, I think it is just a reasonable approach for managing the development process stable and conservative.
You can easily adapt soon this Git flow
soon.