Effective Branching Strategies for Seamless Development

Prashant BalePrashant Bale
4 min read

Imagine John, a senior developer leading a team tasked with developing a new mobile app for a client. As they advance, they face challenges typical in software development: managing simultaneous changes, maintaining stability, and meeting deadlines effectively. Recently, the team has encountered difficulties with overlapping tasks and frequent conflicts in their codebase, causing delays in testing and deploying new features.

To address these issues, John proposes implementing a clear Git branching strategy to streamline their development process. Let's explore the step-by-step process John introduced for this Git branching strategy:

Step-by-Step Explanation:

  1. Master Branch

    For John, the master branch is the bedrock of the Git branching strategy.

    Its main purposes are to:

    • Ensure stability and reliability of the production code.

    • Serve as the single source of truth for the deployable application.

    • Enable controlled and disciplined updates.

    • Provide a foundation for quick and effective hotfixes.

    • Audit and Compliance - Provide clear record of all production releases and hotfixes.

    • Tagging Releases which are released to the production

By maintaining a robust master branch, John ensures that the development process is streamlined, and the final product delivered to users is of the highest quality.

Common Naming Conventions: master

  1. Develop Branch

    The Develop branch serves as the central integration point for our development efforts. It’s where all new features, bug fixes, and improvements come together. This branch allows team to collaborate effectively, ensuring that all changes are integrated and tested before they move to the production-ready Master branch.

    Purposes are:

    • Collaborative Development

    • Pre-Release Testing

    • Merge Feature Branches to Develop Branch

    • Release Branch creation from develop branch

    • Ongoing Development

Common Naming Conventions: develop

Release Branch

John decides that Release branch is essential for managing the final stages of the development cycle, ensuring that the app is stable, polished, and ready for deployment.

John listed few purpose of the Release branch:

  • Stabilization for Production - Final Preparation

  • No changes made to this branch after creation. Only urgent fixes allowed to push on Release Branch

  • User Acceptance Testing can be performed on Release Branch

  • Once everything is done and application is pushed to the production/live users, Release branch merged to Master Branch.

  • All Hot fixes needs to be done on a branch originated from Release Branch

Common Naming Conventions:

  • release

  • Some companies created seperate release branches for every production release with version mentioned in the branch name like

  • release-1.0, release-1.1 etc

  • Feature Branch

    John wants his team developers to work on individual features or improvements in isolation from the main codebase. This means that changes related to a specific feature do not interfere with the ongoing development in the Develop or Master branches. It provides a safe space to experiment and implement new functionalities.

  • Collaboration and Parallel work - Each developer can create a separate feature branch for their task, facilitating parallel development. This promotes efficient use of team resources and speeds up the overall development process.

  • Common Naming Conventions:

    • feature/<JIRA-ID>-login-page-development

      feature/<JIRA-ID>-registration-implementation

  • Hotfix Branch

    Imagine this: Sometimes, our beloved software decides to throw a surprise party in production, catching everyone off guard! When it's time to fix these unexpected antics and impress the higher-ups, we whip up a hotfix that's so urgent, it's like putting out a fire with a water gun—fast and effective!

    So Hotfixes are primarily to address critical issues or bugs that impact the functionality, security, or stability of a live production system.

    Common Naming Conventions:

    • hotfix/<JIRA-ID>-login-crash-fix

Benefits of Git Branching Strategy

  • Organized Workflow: This model helps maintain a clear and organized workflow.

  • Parallel Development: Multiple features and fixes can be developed in parallel without affecting the stable Master branch.

  • Quick Bug Fixes: Hotfix branches allow for immediate bug fixes in production.

  • Clear Release Process: Release branches ensure a controlled and stable release process.

By following this Git branching strategy, teams can efficiently manage their codebase, ensure stability in production, and streamline their development and release processes.

As always, Happy Coding....!!!

0
Subscribe to my newsletter

Read articles from Prashant Bale directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Prashant Bale
Prashant Bale

With 17+ years in software development and 14+ years specializing in Android app architecture and development, I am a seasoned Lead Android Developer. My comprehensive knowledge spans all phases of mobile application development, particularly within the banking domain. I excel at transforming business needs into secure, user-friendly solutions known for their scalability and durability. As a proven leader and Mobile Architect.