sreenivas./courses
Git & GitHub for Beginners — all lessons
🌿

MODULE 02 · 4 MIN READ

Experimenting without fear

Your project works. You want to try something risky. Without branches your options are: experiment on the real thing and pray, or copy the whole folder into my-project-EXPERIMENT-copy2 — Day 1's problem all over again, one level up.

A branch is a parallel universe of your project. Experiment freely there; the original stays untouched. If it works, merge it in. If it fails, delete the universe and nobody ever knows.

Demystified: it's just a label

A branch isn't a copy of your files — it's a movable label pointing at one commit. That's why creating one is instant and free, no matter how big your project is. You've been on a branch this whole time: it's called main.

c1c2c3c4main ← HEADidea
commits are dots · branches are movable labels · lines show parents