Quickstart Publish your first site with Claude Code

Step 3 · Just enough Git

Commit & push

A commit is a save point with a short note. A push sends your save points to GitHub, and that's what updates your live site.

Time: 5 min
  • Commit: a save point for the whole project, with a note that says what changed. You can go back to any commit.
  • Push: sends your commits to GitHub. Until then, they exist only in the working copy.
  • Pull: brings down changes made somewhere else, such as on GitHub's website or from your other device.

Saving a file is not a commit. The agent saves files as it works, but nothing is in the history until it commits, and nothing is on GitHub until it pushes.

From an edit to your live site Inside the working copy, on your computer or in the cloud, the agent edits and saves files, which are not yet in the history. An arrow labeled commit leads to a save point with the note Add St. Pete timeline, and a second commit arrow leads to another save point, Fix a date. An arrow labeled push leads out of the working copy to your repo on GitHub. From there an arrow labeled Pages rebuilds leads to your live site at your-username.github.io/your-repo. A dashed arrow labeled pull runs from GitHub back up to the working copy. Working copy · computer or cloud Edit files saved, but not in the history yet commit Save point: "Add St. Pete timeline" commit Save point: "Fix a date" Push pull On GitHub your-username/your-repo Pages rebuilds Your live site your-username.github.io/your-repo
Commits stay in the working copy until a push sends them to GitHub. Once GitHub Pages is on, a push to main rebuilds your site.

Save your work

Say this
Commit and push to main.

The agent writes a short note for the commit that says what changed.

Look back and undo

See what's been saved:

Say this
Show me the last 5 commits in plain English.

Undo a commit you already pushed. A revert adds a new commit that reverses the old one, so the record stays:

Say this
Revert the last commit and push to main.

Changed something on GitHub's website, or on your other device? Start with:

Say this
Pull the latest changes from GitHub first.

If it goes wrong

The push was rejected because GitHub has changes I don't have

Someone, maybe you on another device, pushed first. Bring those changes down, then push again:

Say this
Pull first, then push again. Don't force-push.

A force-push would overwrite the changes on GitHub.

The agent committed, but my site didn't change

The commit may not be pushed yet, or it went to a branch other than main. Ask:

Say this
Is my last commit pushed to main on GitHub? If not, push it to main.
It says there's a merge conflict

Two changes touched the same lines. Let the agent explain it before anything is overwritten:

Say this
Explain the conflict in plain English and suggest which version to keep. Don't change anything until I choose.
What the agent runs for you
git status                        # what changed since the last commit
git add .
git commit -m "Add St. Pete timeline"
git push origin main
git log --oneline -5              # the last 5 commits
git revert --no-edit HEAD         # a new commit that undoes the last one (add -m 1 for a merge)
git pull --rebase                 # bring down GitHub's changes, then put yours on top

Saved only in this browser.