What is Git Flow, Code Review, Merge Request?

Firlandi Althaf Rizqi Ansyari
3 min readOct 25, 2022

--

Git Flow

Git flow helps the developer to more easily categorize and track each work individually. We can label each branch according to the name which is shown below as an example.

source: https://miro.medium.com/max/1400/1*Sy9xE3JmXqgXRtcLtc_G-w.png

How we decide which one is which can be seen in the short explanation for each label that is shown below:

Master Branch

Is the main branch (branch) that contains source code that is ready for deployment into the production environment. The source code on this branch has been agreed upon, tested, and is free of developer integration problems, making it ready for usage by the user.

Staging Branch

Is the main branch (branch) of the development process. This branch will aggregate the source code of each developer’s work in one location. This branch contains the application that will be used during the sprint review.

PBI[1..n] Branch

Is a branch (branch) for implementing a Product Backlog Item that was retrieved during a Sprint. Later, there will be multiple Product Backlog Item branches named by the Product Backlog Item that is being created.

Hotfix Branch

It is a branch of the master branch that is formed if the master branch contains a problem or error. The hotfix branch is where bugs that appear in the master branch are fixed. The hotfix branch gets merged back into the master branch after the problem has been repaired and is ready to be delivered.

Coldfix Branch

Is a rollback branch created? (delete all changes from all product backlog item branches). This can occur if the product owner refuses to release one or more of the product backlog items that have been implemented during a sprint review.

Code Review

source: https://openpracticelibrary.com/images/code-review.png

Code reviews are rigorous analyses of code that are intended to detect flaws, improve code quality, and assist developers in learning the source code.

We can use websites like sonarcloud to assist us when finding bugs, code smells, or duplicate codes in our commits. This can be seen in an example snippet below of my recent project.

It usually shows the bugs and how to fix them. It really helps the developer to find and fix each problem of the commits

Merge Request

Merge requests are used to validate source code changes in a branch. You may see and collaborate on code changes before merging when you open a merge request. This is really helpful to check if our branch has any merge conflicts with the branch we are going to merge.

In a team environment, merge requests are essential for creating a controlled environment in the team. This is because the branch is checked of conflicts before merging therefore other team members code will not break or cause errors.

An example of pull request that is getting review before a merge request happens is shown in the snippet below of my recent project.

That is all for my blog, thank you for your time.

References

Panduan PPL 2022 Git Flow Ver 4.1.docx — Google Docs

What is a code review? | GitLab

Merge requests | GitLab

--

--