Claude Code Society, home

Learn, lesson 3 of 6

Save your work, undo your mistakes, put it online

Git keeps a saved copy of every version of your project, so breaking something stops being scary. GitHub holds those versions online, and GitHub Pages turns them into a link you can send to anyone.

What you're doing

A commit is a saved version of your project with a short note about what changed. You'll make three of them, break the timer on purpose, put it back, then publish it. You can type the Git commands yourself or ask Claude Code to run them. Do it by hand once, so you know what Claude is doing when it does it for you.

Steps

  1. Check your tools

    Terminal
    git --version
    gh --version

    Each prints a version number. If either says the command isn't found, go back to the setup guide for your system.

  2. Tell Git who you are

    Once per computer. Use your real name and the email on your GitHub account.

    Terminal
    git config --global user.name "Jordan Lee"
    git config --global user.email "jordan@example.com"
  3. Turn your folder into a repository

    Terminal
    cd study-timer
    git init

    Git replies that it made an empty repository. Your files are untouched; Git just starts watching the folder.

  4. Make your first save

    Terminal
    git add .
    git commit -m "First working timer"

    git add . picks every file in the folder for the next save. git commit saves them with your note.

  5. Make two more saves

    Start claude, ask for a small improvement (a bigger font, a counter of finished rounds), check it in the browser, then ask Claude Code to save it:

    Type into Claude Code
    commit my changes with a descriptive message

    Do that twice. Then look at your history:

    Terminal
    git log --oneline

    You'll see three lines, newest first, each with a short code and its note.

  6. Break it on purpose

    Type into Claude Code
    Delete the Start/Pause button from index.html. I'm practicing undoing a change.

    Reload the page and check that the button is gone.

  7. Roll it back

    You haven't saved the broken version, so put the file back to your last save:

    Terminal
    git restore index.html

    Reload the page. The button is back. If you had already committed the broken version, git revert HEAD makes a new save that undoes the last one, and your history keeps both.

  8. Connect your terminal to GitHub

    Terminal
    gh auth login

    Answer its questions: GitHub.com, then HTTPS, then log in with a web browser. It finishes the sign-in on github.com and keeps the login in your computer's credential store. Then let Git use that login when you push:

    Terminal
    gh auth setup-git
  9. Put the project on GitHub

    Terminal
    gh repo create study-timer --public --source=. --push

    This makes a public repository called study-timer on your account and pushes your three saves to it. It has to be public for free GitHub Pages. Anyone can read a public repository, so never commit a password, a key or a token.

  10. Turn on GitHub Pages

    Open your repository on github.com (gh repo view --web opens it for you). Then:

    • Click Settings, then Pages in the sidebar.
    • Under "Build and deployment", set Source to Deploy from a branch.
    • Pick your branch (main or master, whichever your repository shows) and the / (root) folder, then click Save.

    Pages looks for index.html at the top of the folder you picked, which is where yours already is. Publishing takes a little while, so refresh the Pages settings page until it shows your site's address.

  11. Open your live link

    Open the address on your phone. From now on, every push to that branch updates the site.

Exercise

Proof of done

Make three saves of your lesson 2 tool, break it on purpose, roll back, push it to GitHub, and turn on GitHub Pages so it answers at a link.

You're done when

  • git log --oneline shows at least three saves.
  • You broke the tool, ran git restore (or git revert), and it works again.
  • Your repository is on github.com with your saves in it.
  • Your GitHub Pages link opens the tool on your phone.

Sources

Read on October 4, 2026.

  1. Claude Code quickstart, "Use Git with Claude Code": asking Claude Code to commit.
  2. Pro Git, First-Time Git Setup: user.name and user.email.
  3. git restore and git revert reference pages.
  4. gh auth login, gh auth setup-git, gh repo create and gh repo view in the GitHub CLI manual.
  5. Creating a GitHub Pages site and Configuring a publishing source: public repositories on GitHub Free, the Settings and Pages steps, the index.html entry file.