Git and Release Governance: Branches, Versions, and Image Tags
Consistent branch, version, and image-tag rules together with repository permissions create trustworthy inputs for automated builds and deployments.
Overview
Section titled âOverviewâEfficiently developing and operating a cloud-based system requires CI/CD, source control, and deployment automation to work together as a single flow. This article covers how we combined three pillars (Git repository strategy, GitHub Actions-based build server operations, and GitOps-based deployment server operations) into a Tool Chain. Rather than explaining each tool in isolation, we focus on the operational considerations that come up once theyâre actually combined.
Git Branch Strategy
Section titled âGit Branch StrategyâThere are many branching strategies you can use across Git-hosted services like GitHub and GitLab. For this project, we adopted a modified GitHub Flow that doesnât separate dev/prod environments, but uses a develop branch instead of main as the default branch.
Git Flow, broadly, creates 5 branches that operate together, each with its own distinct role.
- Master (main): the branch thatâs ready for release to production. Tags are created from Master (Main) and deployed to production.
- Develop: the latest branch where completed development lands. This is where newly developed work is first merged.
- Feature: branches for developing individual features. Created per unit of feature work.
- Release: branched off Develop once development is complete, in preparation for release.
- Hotfix: fixes bugs found in a version already deployed to production. Since the hotfix also needs to be reflected in ongoing development, it must be merged into Develop as well.

Trunk Based Development
Section titled âTrunk Based DevelopmentâTrunk Based Development is a development approach where all developers work off a single common code line (typically called âtrunkâ or âmainâ). It significantly reduces the overhead of branch management: developers only need to keep their own feature branches in sync with main, which keeps things simple. Once code is merged to main, an automated CI system first verifies that main passes its test/integration process, and if there are no issues, the code on main is immediately ready for production deployment.

GitHub Flow
Section titled âGitHub FlowâGitHub Flow follows the philosophy of Trunk-Based Development while actively leveraging GitHubâs features to enable efficient collaboration and rapid deployment. The core of both GitHub Flow and Trunk-Based Development is the stability of main: the main branch must always be in a deployable state, and should never contain bugs or incomplete features. Before merging a working branch into main, a Pull Request (PR) is opened, teammates review it, and code review helps maintain quality and prevent bugs or defects ahead of time.
Comparing Branch Strategies
Section titled âComparing Branch Strategiesâ| Feature/Strategy | Git Flow | Trunk Based Development | GitHub Flow |
|---|---|---|---|
| Main branches | master, develop, feature, release, hotfix | main | main |
| Development flow | Linear flow, a branch per feature | All development happens on a single main branch | Centered on main, PR-driven |
| Pros | Stable release management, suited to complex projects | Fast deployment, simple branch management | Collaboration efficiency, quality assurance |
| Cons | Complex branch management, slower deployment | Main can become unstable during active feature development | Frequent merges can cause conflicts |
Adding environment branches: feature â dev â main
Section titled âAdding environment branches: feature â dev â mainâEven with GitHub Flow, if you must deploy to separate development and production environments, keep a long-lived branch for each environment.
- Development happens on feature branches;
devdeploys to the development environment andmaindeploys to production. - Once the review is complete, merge the feature branch into
dev. After validation in the development environment, mergedevintomainthrough a separate PR. - Keep
devandmaindeployable at all times, block direct pushes to both, and change them only through PRs.
This lets the dev â main PR control when changes reach production, but the two branches drift easily. If an urgent fix was applied directly to main, merge the same change into dev to remove the difference. To separate environments by promoting image tags instead of branches, see Container Image Tagging Strategy below.
During PR review, GitHub checks approval status and conflicts with the base branch before merging. Use branch protection rules to make required reviewers and passing CI merge conditions.
Application Versioning
Section titled âApplication VersioningâFor managing application releases to production, this project used a mix of date-based versioning and Git-tag-based image tagging.
Semantic Versioning
Section titled âSemantic VersioningâSemantic Versioning defines versions in the format MAJOR.MINOR.PATCH.
- MAJOR: incremented on incompatible API changes
- MINOR: incremented when new functionality is added while remaining backward-compatible
- PATCH: incremented for bug fixes and other improvements that donât change functionality
Example: 1.0.0 (initial release) â 1.1.0 (new feature added) â 2.0.0 (breaking change) â 1.0.1 (bug fix)
Date-based Versioning
Section titled âDate-based VersioningâThis approach assigns versions based on the release date or build time. Itâs mainly used for projects with a regular release cadence or that require frequent releases. Since it clearly indicates when each version was released, it fits well for short deployment cycles or when rapid updates matter.
Container Image Tagging Strategy
Section titled âContainer Image Tagging StrategyâImage tagging strategy tends to reuse Semantic Versioning or Date-based Versioning, just like application versioning. However, when a branching strategy like Trunk Based or GitHub Flow deploys a single image to multiple environments, you need separate management for the specific image deployed to production.
Managing via Release Branches
Section titled âManaging via Release BranchesâIn this strategy, CI runs and tags the Docker image whenever code is merged from main into a release branch. Rather than tagging with latest, the tag includes release information, for example âapplication-name:release241010â, so images deployed to production can be identified and managed distinctly.
- Pros: easy to manage images per release, clear separation of images per environment
- Cons: requires additional branch management overhead
Managing via Git Tags
Section titled âManaging via Git TagsâThis approach runs CI to tag the Docker image whenever a Git tag is pushed. The difference from the release-branch approach is that thereâs no merge into a release branch, management is done purely through Git tags.
- Pros: simple management, release timing is clear from Git history
- Cons: can become hard to manage as the number of image tags grows
Git Repository Structure and Access Management Example
Section titled âGit Repository Structure and Access Management ExampleâHow you split Git repositories by purpose and manage access is closely tied to the nature of each project, so internal alignment and communication are important.
Below is an example of the repository structure and OIDC-based access management used in a sample project (hereafter âthe sample projectâ) with a K8s-based application deployment environment.
Repository List
Section titled âRepository Listâ- An IaC repository for managing cloud infrastructure
- A GitOps repository for managing Kubernetes utilities
- A GitOps repository for managing application deployment
- Separate application backend/frontend repositories, split out as needed
| Repository | Purpose | Remarks |
|---|---|---|
| platform-argocd-init | Templates for deploying k8s utilities | GitOps repository for managing Kubernetes utilities / Language: Mustache, other Kustomize resources |
| platform-argocd-apps | Templates for application deployment | GitOps repository for application deployment / Language: Mustache, other Kustomize resources |
| platform-infra | Infra Terraform | IaC repository for managing cloud infra / Language: HCL, Shell |
| platform-auth | Backend auth app | Authentication backend API / Language: Java |
| frontend-app | Frontend app (React) | Frontend web UI / Language: TypeScript |
| backend-app | Backend app (Spring Boot) | Backend API / Language: Java |
GitHub Access Assignment
Section titled âGitHub Access AssignmentâBelow is an example of role assignment and access management based on GitHub Organization teams.
| Team | Role | Repository | Remarks |
|---|---|---|---|
| CDS | admin | All | Full repository creation and access management |
| SA | Maintain | platform-argo-apps, platform-auth, frontend-app, backend-app | Excludes CDS infra and Kubernetes utility management |
| SQE | Maintain | platform-mock | Managing the mock server for SQE test automation |
| SE | Write | platform-argo-apps, platform-auth, frontend-app, backend-app |
GitHub and Argo CD OIDC Access Assignment
Section titled âGitHub and Argo CD OIDC Access AssignmentâAn example of tying Argo CD access management to GitHubâs OIDC-based federation feature.
| Role | GitHub Team Role Name | Argo CD RBAC Name | Notes |
|---|---|---|---|
| CDS | CDS | admin | All permissions allowed |
| SA | SA | maintainer | Cluster get-only, otherwise all permissions |
| SQE / SE | SQE / SE | developer | Applications sync-only, otherwise get-only |
Summary
Section titled âSummaryâThis article set the Git and release-governance baseline. Next, examine the GitHub Actions runner platform that executes those inputs.
Series order
Section titled âSeries orderâNext: GitHub Actions Runner Platform: Hosted Runners, VMSS, and ARC