Line At A Time
Level 4: Your First Branch
Your First Branch Create a branch: a safe place to try something new.

A branch is a movable label that points at a commit. You've been using one all along: main. Creating a new branch is how you start an experiment without touching the version that already works.

git branch feature creates a label called feature, but look closely at the picture: both labels point at the same commit, and HEAD (the "you are here" marker) stays on main. Creating a branch doesn't move you onto it.

Branch names have a style too: short, lowercase, hyphens between words, and often grouped with a slash, like feature/robot-arm or fix/login-bug. A good name says what the branch is for at a glance.

From this level on, the sandbox stages your changes for you, so git commit -m works directly; in real git you'd still run git add first.

git branchLists your branches; the * marks the one you are on.
git branch <name>Creates a new branch label at your current commit.
Your task

Create a branch: a safe place to try something new.

Open this level in your browser to type the commands at a live git prompt with an animated commit graph.