Learning Objectives
By the end of this lesson you will be able to:
- Explain what a branch actually is, in terms of commits and pointers
- Describe the specific risks a shared
mainbranch creates for a tester - Recognise the situations where a branch is the right answer
- Read a typical team branching convention without being told what it means
The Problem, Before the Solution
Imagine a repository with no branches. Everyone commits to one line of history. The consequences show up quickly:
- A developer commits a half-finished feature. Your regression run fails, and nobody can tell whether it's the feature or a real bug.
- You add three debug
console.loglines to reproduce an issue. They ship to production on Thursday. - Two people edit the same test config within an hour of each other and the second one silently wins.
None of these are hypothetical. They are the default outcome of a single shared line of history, and they are exactly what branches were invented to prevent.
What a Branch Actually Is
This part is worth getting precise, because the mental picture people carry is usually much heavier than the reality.
A branch is a movable pointer to one commit. That's it. It is a file containing a 40-character commit ID.
cat .git/refs/heads/main
8f3c2a1d9e4b7a6c5f2e1d0b9a8c7d6e5f4a3b2c
Because a commit records its parent, that single ID is enough to describe the whole line of history behind it. When you make a new commit, Git writes the new commit and moves the pointer forward one step. Nothing is copied. Nothing is duplicated.
This is why creating a branch is instant even in a repository with 200,000 commits — Git writes a 41-byte file.
A───B───C ← main
\
D───E ← feature/login-form
Two pointers. One shared history up to C. Commits D and E exist only on the feature branch, and main is completely unaffected by them until someone merges.
Why This Matters Specifically for QA
A developer branches to build something. A tester branches for different reasons, and they are worth naming explicitly.
Isolation of destructive experiments. Testing often means deliberately breaking things: corrupting seed data, forcing a timeout, pointing the app at a dead service. On a branch, all of it is disposable.
Testing a specific state. "Does this bug exist in the release candidate?" is a question about one exact point in history. A branch (or a checkout of one) gives you that state precisely, rather than approximately.
Parallel work. You can have your automation refactor sitting on test/retry-logic while you check a hotfix on hotfix/session-expiry, and neither one contaminates the other.
A clean story. When your work does get merged, the branch name and its commits explain what happened. feature/auth-test is documentation; a stream of commits mixed into main is not.
Reading a Team's Branch Names
Most teams use a prefix convention. You do not need to memorise anyone's rules to read them:
| Prefix | Meaning |
|---|---|
feature/ |
New functionality under development |
fix/ or bugfix/ |
A correction to existing behaviour |
hotfix/ |
An urgent fix, usually branched from production |
release/ |
A version being stabilised before shipping |
test/ or qa/ |
Test work — often yours |
A branch called hotfix/PAY-4417-double-charge tells you the urgency, the ticket and the symptom before you have read a single line of code. That is not an accident; it is the point of the convention.
Pro Tip: When a developer says "it's on my branch", ask for the exact branch name and write it down. Half of the "I can't reproduce it" conversations in testing are two people looking at two different branches.
The One Rule
Whatever else a team's workflow says, one rule is close to universal:
main must always be in a working state.
Everything else follows from it. Work happens on branches. main receives work only when it has been reviewed and tested. A tester who understands that rule understands why the process exists.
Key Takeaways
- A branch is a movable pointer to a commit — creating one is instant and nearly free
- A single shared line of history causes unfinished work, debug code and silent overwrites to reach everyone
- Testers branch to isolate destructive experiments, pin an exact state, and work in parallel
- Branch-name prefixes (
feature/,hotfix/,release/) carry real information — learn to read them - The universal rule:
mainstays working; everything risky happens elsewhere