Branching Isolation
A branch is the cheapest safety net in software. This module turns it from a word developers say into a tool you reach for the moment a build lands on your desk.
Why This Module Matters
Here is the situation every tester recognises. A new login form is ready. You want to poke at it hard — change the config, add debug logging, break the seed data on purpose. But the repository is shared, and main is what everyone else is working from.
A branch dissolves that tension completely. It is a movable label pointing at one commit, and creating one costs Git a few dozen bytes and about a millisecond. Your experiments live on it. main never notices. When you're done, you either merge the useful part or delete the branch and the experiment vanishes without a trace.
The other half of the module is orientation. Almost every "Git did something weird" story starts with someone not knowing which branch they were on. HEAD is Git's answer to where am I? — and once you can read it, that whole category of confusion disappears.
What You'll Learn
- Why isolating test work in a branch is a professional habit, not an advanced trick
- Creating a branch with
git branchand switching withgit switch/git checkout - The
-band-cshortcuts that create and switch in one step - What
HEADis, how to see where it points, and what "detached HEAD" means - Listing local and remote branches, naming them so a stranger understands them
- Deleting merged branches with
-d, and why-Ddeserves a moment's thought
Pro Tip
Run git branch --show-current before every destructive command. It takes half a second and it is the single highest-value habit in this entire trail.