Step 3 · Just enough Git
The main branch
Your live site is published from one branch, main. Your changes reach the site only when they reach main.
A branch is a parallel line of work in the same repo. You can make changes on a branch without touching the main line. main is the line GitHub Pages publishes from, so your site updates only when main changes.
Make sure it's called main
Repos you create on GitHub, and forks of the starters, already use main. On the VS Code path, Git, Node & GitHub CLI set your computer to use main for new repos too. If you ever have the agent start a repo from scratch, name the folder and the branch:
In the your-repo folder, start a new git repository on a branch named main.
The app path: Claude's own branch
In the Claude app, Claude works on its own branch, named claude/…, and pushes that branch, not main. Your site doesn't change until the work is merged into main.
Two ways to get work onto main
Straight to main
The simplest way for a project only you work on. Say it with the task, or at the start of the session:
Commit and push to main.
Through a pull request
Let Claude push its claude/… branch, then say:
Open a pull request from your branch into main of your-username/your-repo (my repo, not the original) and merge it.
Or open the diff view, the panel that shows what Claude changed, and select Create PR at the top. Then open the pull request on GitHub, click Merge pull request, then Confirm merge.
On the VS Code path the agent usually works on main already, so "Commit and push to main." is all you need.
If it goes wrong
The agent says it can't push to main
Use the pull request way instead:
Push your branch, then open a pull request from it into main of your-username/your-repo (my repo, not the original) and merge it.
The agent pushed, but my site didn't change
The work is probably still on a claude/… branch. Ask:
Which branch is my work on? Get it onto main and push main.
After main changes, give GitHub Pages up to 10 minutes.
What the agent runs for you
# A new repo that starts on main
git init -b main
git config --global init.defaultBranch main # every new repo from now on
# Pull request, then merge (GitHub CLI). Naming the repo keeps a fork's
# pull request out of the original repo.
gh pr create --repo your-username/your-repo --base main --fill
gh pr merge branch-name --repo your-username/your-repo --merge
On the app path, Claude may use its built-in GitHub tools for the pull request instead.
Saved only in this browser.