Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Last updated: Monday 09 November 2026 @ 12:56:44

Release Deployment

Git · Release engineering

Release Deployment

Practise a scheduled release: stabilise a release branch, tag the approved revision and prepare a patch without disrupting ongoing work.

Release branchesVersionsTagsHotfixesMaintenance
Plan a release

Distinguish an integration branch from a release-stabilisation branch.

Publish a version

Tag a specific commit and verify the files associated with that release.

Maintain and repair

Apply a hotfix and compare two release versions.

Release-driven development

Unlike a continuously deployed project, a release-driven project may batch approved changes into a scheduled version. This chapter uses develop for ongoing integration and main for published releases, matching the original release-branch diagrams. Feature branches start from develop; release branches are stabilised and then merged into both permanent branches.

Release workflow showing develop and main branches

Two permanent branches separate development and published releases.

Branch roles

BranchPurposeRetained?
mainPublished release historyYes
developIntegrated work for the next versionYes
feature/*New functionalityUntil integrated
release/*Stabilisation and release notesUntil published
hotfix/*Urgent production repairUntil integrated

Practical: prepare a release

  1. Initialise a local repository, configure a lab-only author and make the initial release.

    mkdir -p ~/git-release-lab && cd ~/git-release-lab
    git init -b main
    git config user.name "Git Student"
    git config user.email "student@example.invalid"
    printf 'Sensor service v1.0\n' > app.txt
    git add app.txt
    git commit -m "feat: baseline service"
    git tag v1.0.0
  2. Create the integration branch from the published baseline.

    git switch -c develop
    git branch -v
  3. Record the distinction between main, develop and the tag.

    git log --all --graph --oneline --decorate

Feature development

Feature branch based on development branch

Feature branches feed into develop before entering a release.

  1. Start a feature branch from develop and create a new file.

    git switch develop
    git switch -c feature/adc
    printf 'ADC module enabled\n' > adc.txt
    git add adc.txt
    git commit -m "feat: document ADC module"
  2. Review the feature and integrate it into develop.

    git diff develop...feature/adc
    git switch develop
    git merge --no-ff feature/adc -m "merge: ADC feature"
  3. Confirm that main still represents the older published version.

    git diff main..develop --stat
    git show main:app.txt

Stabilise and publish a release

Release branch merged into published and development branches

Release branches hold the selected set of changes during stabilisation.

  1. Branch from develop and prepare version-specific release notes.

    git switch develop
    git switch -c release/v1.1.0
    printf 'v1.1.0\n- ADC documentation\n' > CHANGELOG.md
    git add CHANGELOG.md
    git commit -m "docs: prepare v1.1.0 release notes"
  2. Verify the proposed release files and compare its commits with main.

    git log --oneline main..release/v1.1.0
    git diff --stat main..release/v1.1.0
    git status --short
  3. Merge the approved release into main, and tag the published commit.

    git switch main
    git merge --no-ff release/v1.1.0 -m "merge: release v1.1.0"
    git tag v1.1.0
    git show --stat v1.1.0
  4. Merge release-specific changes back into develop.

    git switch develop
    git merge --no-ff release/v1.1.0 -m "merge: sync release v1.1.0"
    git branch -d release/v1.1.0
  5. Inspect both branches and the release tags.

    git log --all --oneline --graph --decorate
    git tag --list

Patch an urgent issue

  1. Return to the published main and create a focused hotfix branch.

    git switch main
    git switch -c hotfix/v1.1.1
    printf 'Sensor service v1.1 (verified)\n' > app.txt
    git add app.txt
    git commit -m "fix: clarify sensor service label"
  2. Merge the fix into main and tag the new published version.

    git switch main
    git merge --no-ff hotfix/v1.1.1 -m "merge: hotfix v1.1.1"
    git tag v1.1.1
  3. Integrate the same repair into the development branch.

    git switch develop
    git merge --no-ff hotfix/v1.1.1 -m "merge: sync hotfix v1.1.1"
    git branch -d hotfix/v1.1.1
  4. Compare the released versions.

    git diff v1.1.0..v1.1.1 -- app.txt
    git log --oneline --decorate --all --graph

Supporting older releases

A patch for an older supported version must be based on that older version, not blindly on today’s main. The original release model uses maintenance branches such as support/v1.x; such branches are appropriate when several versions must be supported simultaneously.

  1. Create a maintenance branch at the original v1.0.0 tag.

    git switch -c support/v1.0 v1.0.0
    git show --stat HEAD
  2. Make a documentation-only maintenance change and identify its scope.

    printf 'v1.0 maintenance notice\n' > SUPPORT.md
    git add SUPPORT.md
    git commit -m "docs: add v1.0 support notice"
    git log --oneline -2
  3. Return to the development branch without merging the maintenance line; discuss whether its change should be cherry-picked.

    git switch develop
    git log --all --graph --oneline --decorate

Release checklist

Release artifact approval and deployment process

A production release can also require an externally approved artifact or bundle.

When might another model be better?

Use a release-driven workflow when approvals or scheduled publication are required. If every passing commit can be released automatically and safely, the extra permanent develop branch and release branches may add unnecessary integration work. If multiple incompatible versions require long-term support, use explicit maintenance policies rather than assuming all fixes will merge automatically.