The Wise Operator, Scott Krukowski
Back to Dictionary

Branch

A separate copy of your project's code where you can make changes without affecting the main version, like a draft you can test before publishing.

A branch in Git is a separate line of development that lets you make changes without affecting the main version of your project. Creating a branch doesn’t copy your files; it creates a parallel track where you can experiment, build features, or fix bugs in isolation. When the work is ready, Git can merge the branch back into the main codebase, combining the changes cleanly.

The Simple Version

Imagine you’re editing a document and you want to try a big rewrite without risking the original. You’d make a copy, experiment on the copy, and only replace the original if the rewrite turns out well. A branch is that copy, but smarter: Git tracks both versions and can merge them back together when you’re ready.

The main branch (usually called main) is the live, production version. Feature branches are where you experiment safely.

Why It Matters

Branches are how developers work on new features without breaking what already works. You can build an entire feature on a branch, test it, get feedback, and only merge it into the main codebase when it’s ready. If the experiment fails, you just delete the branch and nothing is harmed.

How It’s Used on This Site

When this site was migrated from React to Astro, the original code was preserved on a legacy branch before any changes were made to main. This meant the old version was always available as a safety net. New features are sometimes built on separate branches and merged once verified.


Browse the Full Dictionary