Portmint Lighthouse

Branches — Parallel Drafts

Here is the plain idea: a branch is a separate line of work — a private copy of your project where you can experiment freely, leaving the real version untouched until you're sure your idea is good.

Branches are where version control stops being just a safety net and becomes a playground. They're the answer to "I want to try something risky, but I don't want to break what already works."

The alternate-draft notebook

Picture our author with a finished, working manuscript — the main version everyone relies on. They have a bold idea: kill off a character in chapter five. But that might wreck the whole book.

So instead of scribbling on the real manuscript, the author photocopies it into a fresh notebook and writes the experiment there. The main manuscript sits safe and unchanged. If the bold idea sings, its pages get folded back into the main book. If it flops, the author tosses the notebook — and the real book never knew a thing.

That fresh notebook is a branch. The main manuscript is the main branch (often literally called main). Making the photocopy is creating a branch; moving your attention into it is switching to it.

Why this is so freeing

Without branches, every experiment happens on top of your real work, and a failed idea leaves you frantically un-doing to get back to safety.

With branches, the real work is never at risk. Your wild idea, your half-finished feature, your "let me just try something" — all of it lives in its own notebook. The main version stays clean and usable the entire time. You can even keep several branches at once: one for each idea, none disturbing the others.

This is exactly how teams build software. One person revamps the homepage on their branch while another fixes a bug on theirs, and the shared main version stays stable for everyone until each piece is ready.

Switching is instant — and tidy

When you switch from one branch to another, Git rearranges the files in your folder to match that branch. Step into your experiment notebook and the killed-off character appears in chapter five. Step back to main and they're alive again.

It feels almost magical, but it's just Git swapping your working pages to match whichever notebook you've opened. One quiet rule: file your current draft (commit) before switching, so no loose pages get muddled between notebooks.

Branches are cheap — use them freely

In the paper world, photocopying a whole manuscript is a chore. In Git it's instant and costs almost nothing, because Git is clever about not duplicating what's identical.

So the healthy habit is: any time you're about to try something you're not certain about, make a branch first. It's a fresh, throwaway notebook. Worst case, you abandon it and lose nothing. Best case, you've just built something great in perfect safety.

Your turn

Think of a project and one risky change you'd hesitate to make directly.

On paper, name a branch for it — short and descriptive, like try-new-intro or bold-ending. You've just planned a safe experiment. Whatever happens in that notebook, your main version stays sound.

Next we'll bring a successful experiment home — merging a branch back into main. 🐙

Stuck or curious?

Ask Pip about this lesson — tap the porthole bottom-right.