The Scary Idea
Your site works. It looks good. And then you get a wild idea:
“What if the whole thing was dark mode, with a totally different font?”
It might be amazing. It might be terrible. And trying it means changing everything.
That’s what branches are for.
A Parallel Copy
A branch is a parallel copy of your project, where you can try an idea without touching the version that works.
Your working version lives on a branch called main. When you want to experiment, you make a new branch off it and do all your changes there.
Then you decide:
- Love it? Merge it. The idea joins
main, and it becomes part of your real site. - Hate it? Delete the branch.
mainis exactly as you left it, like the experiment never happened.
Why Not Just Use Save Points?
You could try the idea on main and go back to a save point if it fails. For small changes, that’s fine.
But branches shine for big experiments:
| Trying it on main | Trying it on a branch | |
|---|---|---|
| Your working site | Gets changed while you experiment | Stays safe the whole time |
| If it fails | Go back to a save point | Just delete the branch |
| Comparing | Hard, the old version is gone from view | Easy, switch between the two |
| Best for | Small tweaks | Big, risky ideas |
Small change? Just do it and save. Big risky idea? Branch it.
Switching Between Them
You can hop between branches any time. Your folder instantly changes to show that branch’s version of every file.
It feels like magic the first time: ask Claude to switch to main, refresh your site, and the dark mode is gone. Switch back, and it’s there again.
Just Ask Claude
| You say | What Claude does |
|---|---|
| “Make a branch called dark-mode to try a new look” | Creates the branch and switches to it |
| “Which branch am I on?” | Tells you |
| “Switch back to main” | Shows you your working version again |
| “I love it, merge dark-mode into main” | The idea becomes part of your real site |
| “I don’t like it, delete the dark-mode branch” | Throws the experiment away |
Try it
Make a branch, change something on it, then switch back to main and see that your change is gone. Then decide: merge it or delete it.
See an example prompt
Make a branch called experiment, and on it, add a line to notes.txt saying "this is just a test". Save a checkpoint. Then:
Switch back to main and show me what's in notes.txt. The test line isn’t there. Now choose:
Delete the experiment branch.