What a Branch Is
A separate line of work.
A branch is a separate line of work. It lets you try something new, like a dark mode for your site, without touching the version that already works. If the idea works out, you bring it back. If not, you just throw the branch away.

- A separate line of work
- Try ideas safely
- Keep them, or throw them away
Branches as lines
Here's our history, three commits on main. Main is the default branch. Now we create a branch called dark, starting from the latest commit. When we commit on dark, main doesn't move at all. Dark grows on its own line. And main can keep growing too, completely separately.
Why branches are great
Branches are cheap. Creating one is instant, and takes almost no space. They keep main safe, so main always works. And they let several people work on different things at the same time, without getting in each other's way.
Summary
A branch is a separate line of commits. Main stays safe while you experiment. Next, creating and switching branches.
Key takeaways- A branch = a line of work
- main is the default
- Branches are cheap