Featured image
"Don't bring a knife to a gun fight."

Selecting the appropriate Git workflow is essential for optimizing productivity in the daily work of an engineering team. While Git itself is relatively straightforward and can be learned quickly, it takes time and effort to establish an effective Git workflow that meets your specific needs.

Why choosing the right git flow is important? Link to heading

Git flow is a branching model that supports the software development process and facilitates Continuous Integration and Continuous Deployment (CI/CD). It allows engineering teams to efficiently release their products by organizing the codebase into different branches for development, testing, and release. A well-designed git flow simplifies the process of merging changes from lower branches to upper branches, reducing the complexity of deploying changes to different environments.

Why Kanban team needs a different git flow? Link to heading

Compared to other agile methodologies, Kanban places a strong emphasis on continuous delivery, whose main idea is to deploy compoleted features or batches of work to production as soon as they are finished, rather than waiting for a pre-defined time such as the end of a sprint. This approach can result in multiple features being implemented and released in a short period, which can create challenges for release managers when implementing features in parallel. They must continuously integrate and deploy features to the test and production environments without conflicts arising from merging different branches together. Scrum teams may use a simpler Git flow by creating a branch for each sprint and merging it after the sprint is completed, but this approach may not be as efficient or enjoyable as the continuous delivery approach taken by Kanban teams. In short, it’s not fun!

My opinionated git flow for a Kanban team Link to heading

Kanban Git Flow

Basically, the flow is:

  • When someone starts working on a new feature, a new feature branch (feature/*) will be created from the develop branch.
  • When the feature is completed, the feature branch is merged to the develop branch. It’s worth noting down that this is a one-way merge, we shouldn’t merge the develop branch to the feature branch or rebase the feature branch onto the develop branch.
  • The ‘develop’ branch is the branch to be deployed to the dev & QA testing environment.
  • After the testing is finished and the feature is considered to be ready for next testing stage (e.g. UAT testing), the changes will be merged to the master branch. Master branch is the branch whose codes are considered to be stable (well tested). The code chagnes for the feature will be merged to master branch using cherry-pick. The usage of cherry-pick is to prevent merging the un-ready codes. We can cherry-pick the commits from feature branches or develop branch.
  • The ‘master’ branch is the branch to be deployed to the UAT environment. If there are any bugs discovered during the UAT testing, the fix branch will be created from the master branch and be merged back to master when the issue is fixed. The fix will then be merged back to develop branch for being synced between different environments.
  • After the UAT testing is completed, the release branch will be created from master branch and deployed to production environment.

As mentioned above, when working on new features, it’s important to avoid merging the develop branch into the master branch until the features are fully implemented. However, it’s better to periodically “reset” the master branch by merging the develop branch into it, either when all current features have been completed or when there are only a few remaining features being implemented. The benefits of doing so are:

  • Reducing the divergence between the two main branches.
  • Making the integration of future changes into the upper branches easier.

Conclusion Link to heading

It’s important to remember that there is no perfect Git flow for any agile methodology, including Scrum, Kanban or any other methods. The software development environment is constantly changing, so it’s essential to observe and continuously improve the development process to ensure it remains effective and efficient. By staying flexible and adapting to new challenges, teams can optimize their Git flow and improve their overall development process over time.



Keep calm and good things will come!
Subscribe to our newsletter  •  About the author