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
Check your tools
Terminalgit --version gh --versionEach prints a version number. If either says the command isn't found, go back to the setup guide for your system.
Tell Git who you are
Once per computer. Use your real name and the email on your GitHub account.
Terminalgit config --global user.name "Jordan Lee" git config --global user.email "jordan@example.com"Turn your folder into a repository
Terminalcd study-timer git initGit replies that it made an empty repository. Your files are untouched; Git just starts watching the folder.
Make your first save
Terminalgit add . git commit -m "First working timer"git add .picks every file in the folder for the next save.git commitsaves them with your note.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 Codecommit my changes with a descriptive messageDo that twice. Then look at your history:
Terminalgit log --onelineYou'll see three lines, newest first, each with a short code and its note.
Break it on purpose
Type into Claude CodeDelete the Start/Pause button from index.html. I'm practicing undoing a change.Reload the page and check that the button is gone.
Roll it back
You haven't saved the broken version, so put the file back to your last save:
Terminalgit restore index.htmlReload the page. The button is back. If you had already committed the broken version,
git revert HEADmakes a new save that undoes the last one, and your history keeps both.Connect your terminal to GitHub
Terminalgh auth loginAnswer 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:
Terminalgh auth setup-gitPut the project on GitHub
Terminalgh repo create study-timer --public --source=. --pushThis makes a public repository called
study-timeron 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.Turn on GitHub Pages
Open your repository on github.com (
gh repo view --webopens 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 (
mainormaster, whichever your repository shows) and the/ (root)folder, then click Save.
Pages looks for
index.htmlat 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.Open your live link
Open the address on your phone. From now on, every push to that branch updates the site.
Exercise
Proof of doneMake 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 --onelineshows at least three saves.- You broke the tool, ran
git restore(orgit 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.
- Claude Code quickstart, "Use Git with Claude Code": asking Claude Code to commit.
- Pro Git, First-Time Git Setup:
user.nameanduser.email. - git restore and git revert reference pages.
- gh auth login, gh auth setup-git, gh repo create and gh repo view in the GitHub CLI manual.
- Creating a GitHub Pages site and Configuring a publishing source: public repositories on GitHub Free, the Settings and Pages steps, the
index.htmlentry file.