Skip to main content

A Fictional Team Untangles Years of Branch Confusion

This case study follows an invented product team that spent a long stretch untangling years of branch confusion. The organisation, its repository and its troubles are fictional, assembled from patterns that are common in source control work. No outcome here should be read as a measured result. The value lies in the order of the decisions and the reasons behind them.

The starting position

The team maintained a billing application and two companion services in a single Git repository. Over several years the branch list had grown past anyone's ability to explain it. There was a main branch, a branch called develop, another called develop-new, release branches with inconsistent names, customer-specific forks and a large collection of personal branches.

The practical symptom was uncertainty. When a defect was reported, nobody could say quickly which line of code a given customer was running. A fix applied in one place sometimes reappeared as a bug in the next release because it had never reached the other branches. Release preparation depended on one engineer's memory.

Resisting the urge to delete

The first proposal was to remove everything older than a chosen date. The team rejected it. Age does not show whether a branch holds work that matters. Instead they produced an inventory with one row per branch: name, last commit date, commits not present in main, apparent owner and whether any deployed system had been built from it.

Git commands that list merged and unmerged branches supplied part of the data. The rest required conversation. Where build records existed, the team matched deployed artifacts to commit identifiers. Where they did not, they marked the entry as unknown and left it alone until evidence appeared.

Sorting into four groups

Each branch received one label.

  • Live: something in use was built from it.
  • Pending: it held unfinished work that an owner still wanted.
  • Finished: its changes were already contained elsewhere.
  • Unknown: no one could yet say.

Finished branches were tagged where history needed a marker and then removed. Unknown ones were renamed under an archive prefix, with a note about how to restore them. This reduced the visible clutter without destroying anything that could not be recovered.

Finding the missing fixes

The harder work concerned the live lines. For each, the team compared commits against main, using commit comparison that recognises equivalent patches where possible. That method misses fixes that were rewritten by hand, so engineers also reviewed defect records and read the relevant files.

Every difference was classified as a fix that main lacked, a deliberate customer variation or an accidental divergence. Missing fixes were brought into main through reviewed pull requests, each with a test reproducing the original defect. Deliberate variations raised a design question: should these differences be configuration or feature flags instead of separate code? Some were converted. One was kept as a branch for the time being, with a named owner and an explicit condition for ending it.

A worked example from the inventory

One entry shows how the method behaved. A branch named for a former customer had not received a commit in a long while, and the initial instinct was to call it dead. The inventory showed several commits absent from main. A support engineer then found that a scheduled export job on an internal server was still built from it.

The branch moved from finished to live. Two of its commits turned out to be a rounding fix that main had since solved differently. A third handled a file format used only by that export. The team wrote a test around the format, brought the behaviour into main behind a configuration setting, rebuilt the job from main and compared its output with the old one using sample data. Only after the files matched and the job's owner agreed was the branch tagged and archived. The episode changed the group's habit: every later entry required a check of build and server records before anyone judged it by date.

Choosing a branching policy

The team debated two models. A structure with long-lived develop and release branches felt familiar. A trunk-based approach with short-lived branches promised fewer places for changes to hide. They chose the second, with a qualification: because some customers upgraded slowly, release branches would exist for supported versions only.

The written policy fitted on one page. Work branches start from main and are merged within days. Changes arrive through pull requests with passing checks. Fixes land on main first and are then cherry-picked to supported release branches, with the original commit referenced. Releases are marked with annotated tags. Support windows decide when a release branch is closed.

Enforcing the rules with the system

A document alone would have faded. The repository was configured to protect main and release branches, require review and block direct pushes. A naming check rejected new branches outside the agreed patterns. Merged work branches were removed automatically. The build embedded the commit identifier in each artifact and displayed it on an internal status page, so the question of what was running had an answer.

The team also added a scheduled report listing branches that had gone quiet. It informed owners and deleted nothing.

Bringing people along

The engineers did not share one level of Git confidence. The team ran short practice sessions on a disposable copy of the repository, covering rebase, cherry-pick, tag inspection and recovery through the reflog. Participants made mistakes there deliberately. A rotating reviewer answered branching questions during the transition, and the policy page was updated whenever the same question came up twice. This kept the rules connected to daily work instead of leaving them as one person's design.

Where the plan stumbled

Shortening branches exposed weak tests. Early merges broke main several times, and some developers argued for returning to the old habit. The response was to improve the checks that ran before merge and to hide incomplete features behind flags. Flags brought their own housekeeping, so each received a removal task when it was created.

Large refactoring posed another difficulty. The team split it into steps that could coexist with the old code, which took more planning than a single long branch and made problems visible sooner.

What changed, within the story

By the end of the account, a new joiner could draw the branching model after a short explanation. A support engineer could move from a customer's version to the exact source. Release preparation no longer belonged to one person. Some archive entries remained unresolved, and the team recorded that plainly.

Lessons for a real repository

Inventory before removing. Tie deployed software to commits. Keep the policy small and let the server enforce it. Decide where fixes land first. Expect testing gaps to surface when integration becomes frequent. This blog's older post on build and release training sits close to these themes. Teams seeking outside facilitation can also consult the Cotocus site about DevOps and training services, which lists process improvement, advisory work and corporate workshops; check that source control practice is covered in the way you need. Your branch list will have its own history, and the first useful step is simply to write it down.

Comments

Popular posts from this blog

PR Points Calculator Guide

Planning to move abroad for better career opportunities, education, or long-term settlement is a major life decision. One of the first challenges people face is understanding whether they qualify for immigration programs in their target country. Many popular destinations now use points-based immigration systems , where applicants are evaluated based on factors such as age, education, work experience, language skills, and income. Understanding how these systems work can help you determine your chances of qualifying for permanent residence or long-term visas. To simplify this process, DesiNRI offers a collection of PR Points Calculators that help individuals estimate their immigration eligibility for several global destinations. These tools allow users to quickly check their potential score and explore immigration pathways in countries such as Australia, Austria, Canada, Japan, New Zealand, and South Korea . Explore all calculators here: https://www.desinri.com/pr-points-calculator/ The...

Building Resilient Digital Enterprises in 2025: The Role of Database Administration, Cybersecurity, and Vulnerability Assessment

The digital-first economy of 2025 demands more from enterprises than ever before. Data volumes are doubling every few years, cyber threats are becoming more advanced, and compliance frameworks are increasingly strict. In this landscape, organizations that can manage data efficiently, defend against evolving attacks, and proactively address weaknesses will thrive, while those that don't will struggle to survive. At the heart of this resilience lie three interdependent technology pillars : Database Administration – ensuring reliability, scalability, and efficiency. Cybersecurity – protecting digital assets from attacks and breaches. Vulnerability Assessment – identifying and fixing weaknesses before adversaries exploit them. This blog explores how these domains are shaping enterprises in 2025 and why integration between them is no longer optional — it's essential. Database Administration: The Backbone of Enterprise Data Modern enterprises run on data. ...

Build and Release Training by DevOpsConsulting.in

Build and Release Training by DevOpsConsulting.in DevOpsConsulting is a brainchild of passionate technopreneurs having vast experience in managing, designing and delivering large scale enterprise solutions with prime focus on achieving business goals with high performance systems. We are an IT technologies and consulting firm specialised in DevOps and software practices to improve efficiency and cost effectiveness of an Organisation. We have extensive experience in various verticals like telecom, healthcare, finance, insurance, media etc. Our comprehensive knowledge and expertise includes but not limited to DevOps Architect Design, Technical Debt Reduction, Cloud Migration, Continuous Integration, Continuous Delivery and Continuous Deployment. The basic course program is outlined here Software Configuration Management overview Introduction of Version management / Source Code Management Overview of Build management Overview of Packaging management Overview of Release an...