TExcelTAD
Home › Assets, Tools & Shipping › Branches, Tags & Release Lines

Branches, Tags & Release Lines

Game teams branch differently from web teams. A web app deploys many times a day and only one version is live. A game ships a build, players keep it for months, a platform holder certifies one exact build, a patch must fix a crash in that build while the next update is half finished on main. The branching strategy has to make that easy. Basic branching and merging are covered in Git Branch and Git Merge.

Three strategies

Strategy How it works Good for
Trunk-based everyone commits small changes to main (directly or via short-lived branches merged within a day or two); unfinished features hide behind flags small teams, continuous playtest builds
Release branches trunk-based, plus a release/1.0 branch cut when a version is feature-complete; only fixes go there anything that ships versions: Steam, consoles, mobile
Long-lived feature branches big features live on their own branch for weeks rarely worth it in games: binary assets can't be merged, so long branches cause lost work

Most game teams end up with trunk + release branches + tags: main is always playable, each shipped version has a branch for patches, and every build that reaches players has a tag.

A release line, step by step

This session (real Git 2.54) cuts a release branch, ships v1.0.0, keeps working on main, fixes a crash on the release branch, ships v1.0.1, and brings the fix back to main with a cherry-pick:

bash · try it yourself
mkdir game && cd game && git init -q
c() { echo "$2" >> "$1"; git add "$1"; git commit -q -m "$2"; }   # c <file> <message>
c loop.js "Core loop"; c levels.json "Three levels"; c menu.js "Menus and settings"
git switch -q -c release/1.0                 # feature freeze for 1.0
c menu.js "Fix typo on title screen"
git tag -a v1.0.0 -m "1.0.0 sent to store"
git switch -q main
c levels.json "Level 4 (for 1.1)"; c enemies.js "New enemy type (for 1.1)"
git switch -q release/1.0
c pause.js "Fix crash when pausing during cutscene"
git tag -a v1.0.1 -m "1.0.1 hotfix"
git switch -q main
git cherry-pick -x release/1.0 > /dev/null    # bring the crash fix to main too
git log --oneline --graph --all --decorate=short | sed 's/ *$//'
* 3071428 (HEAD -> main) Fix crash when pausing during cutscene
* 7eb82fa New enemy type (for 1.1)
* 6f4dbef Level 4 (for 1.1)
| * ca100bd (tag: v1.0.1, release/1.0) Fix crash when pausing during cutscene
| * c16c7a2 (tag: v1.0.0) Fix typo on title screen
|/
* 80c7dc7 Menus and settings
* d8946ec Three levels
* 79123d1 Core loop

Read the graph from the bottom: three commits of shared history, then two lines. release/1.0 only ever received fixes and carries both shipped tags. main got the 1.1 features and the crash fix, copied by cherry-pick -x (which appends "cherry picked from commit …" to the message, so you can trace it later).

Why fix on the release branch first?

Fixing on main and cherry-picking to the release branch also works, but fixing on the oldest supported line first has two advantages: the fix is written against the code players actually run, and you can't accidentally drag 1.1 features into a patch. Whichever direction you pick, pick one and write it in the README.

Tags are build identities

A tag answers "what exactly did players get?", years later. Use annotated tags (git tag -a), which store who tagged and when, and push them (git push origin v1.0.1). Then git describe turns any commit into a readable name relative to the last tag, which makes a good build identifier:

bash · try it yourself
mkdir game && cd game && git init -q
echo 1 > f && git add f && git commit -q -m "Release candidate"
git tag -a v1.2.0 -m "1.2.0"
echo 2 >> f && git commit -q -am "Fix shop prices"
echo 3 >> f && git commit -q -am "Balance boss"
git describe --tags
git describe --tags --abbrev=0                   # just the last tag
git rev-list --count v1.2.0..HEAD                # commits since it
echo 4 >> f
git describe --tags --dirty                      # uncommitted changes are flagged
v1.2.0-2-g61e829a
v1.2.0
2
v1.2.0-2-g61e829a-dirty

v1.2.0-2-g<hash> means "two commits after v1.2.0, at commit <hash>". Version & Build Numbers builds on this.

Feature flags instead of feature branches

Unfinished work goes into main hidden behind a flag, so it's tested with everything else every day but players never see it:

csharp
// a ScriptableObject, a JSON config, or a define per build profile
if (Features.NewCraftingUI) OpenCraftingV2(); else OpenCraftingV1();

Remove the flag (and the old path) once the feature ships; a project with forty stale flags is its own kind of mess.

Test yourself

Where should a crash fix for the shipped 1.0 version be made first, in the strategy shown?

  1. On main only
  2. On the release/1.0 branch, then cherry-picked to main
  3. On a new long-lived branch
  4. In the tag

What does v1.2.0-2-gabc1234 from git describe mean?

  1. Version 1.2.0, build 2
  2. Two commits after the tag v1.2.0, at commit abc1234
  3. Two tags since v1.2.0
  4. A broken tag

Why are long-lived feature branches especially risky in game projects?

  1. Git can't handle them
  2. Binary assets edited on both branches can't be merged, so work gets lost
  3. They are slower to clone
  4. Engines don't support branches