AI Global Academy Join the waitlist

Courses / Start here: setup and first steps

Lesson 0.4 · 45 minGit and GitHub: your safety net

Duration~45 min in the lesson + ~30 min homework
PrerequisitesThe folder and page from 0.3; the GitHub account from 0.2.
Checkpointlesson-0.4

What you will have

The project folder is a Git repository with at least two commits, a private copy on GitHub, and the tag lesson-0.4. The student has broken the page on purpose and restored it.

Video

The video for this lesson is not recorded yet.

Prompts used in this lesson

Part 4 — Let Claude make a change; review the diff; let Claude commit

Prompt to Claude
I want visitors to see when this page was last changed.

Add a small footer at the bottom of about-me.html with the text
"Last updated: October 2026".

Done means the footer shows at the bottom of the page in a smaller, lighter font.

Constraints: edit only about-me.html, keep everything else as it is, and do not
commit. I will review the change first.
Prompt to Claude
I have reviewed the footer change and I accept it.

Commit it to Git with a short message that says what changed.

Done means git status shows nothing left to commit. Commit only about-me.html,
and do not push.

Do along

Pause the video after each part named below and do the step before you continue.

  1. Pause after Part 3. In a plain terminal: cd ~/brightside-site (your own folder name), then the two git config --global commands.
  2. Run git init, git status, git add -A, git commit -m "Add about-me page", git log --oneline.
  3. Pause after Part 4. In a second terminal, start claude in the same folder, switch to Manual mode, and send the footer prompt from Part 4, or any small change with "do not commit".
  4. In the plain terminal run git status and git diff. Answer the three questions.
  5. Ask Claude to commit with the second prompt from Part 4. Read the commit message before approving.
  6. Pause after Part 5. Break the page: delete a block from about-me.html in VS Code and save. Reload the browser. Run git restore about-me.html. Reload again.
  7. Pause after Part 6. Create a private, empty repository on GitHub with the same name as your folder. On macOS, install the GitHub CLI and run gh auth login.
  8. Run git branch -M main, git remote add origin with your own address, git remote -v, git push -u origin main.
  9. Pause after Part 7. Run git tag lesson-0.4, git push, git push --tags.

Check your work

  1. Run git log --oneline. Expected: at least two lines, the newest marked with tag: lesson-0.4.
  2. Run git status. Expected: "nothing to commit, working tree clean".
  3. Run git tag. Expected: lesson-0.4.
  4. Open your repository on GitHub. Expected: it is Private, lists about-me.html, shows two or more commits, and its tags include lesson-0.4.
  5. Open about-me.html in the browser. Expected: the whole page, with the footer.

Common problems

  • The commit fails asking who you are, or says your name and email "were configured automatically". → They are not set. → Run the two git config --global commands; if the commit failed, commit again.
  • fatal: not a git repository. → Wrong folder. → cd into the project folder and repeat.
  • error: remote origin already exists. → git remote add was run twice. → Run git remote set-url origin followed by the correct address.
  • The push is rejected. → The GitHub repository was probably created with a README. → Delete it on GitHub, create it again empty, and push.
  • The push asks for a username and password. → The sign-in helper is missing. → Press Ctrl+C. On macOS run gh auth login; on Windows reinstall Git for Windows with the defaults. Push again.
  • The token '&&' is not a valid statement separator (Windows). → Two commands were joined with &&, which Windows PowerShell does not accept. → Run each command on its own line.
  • A .claude folder appears in git status. → Claude Code saved a local setting there. → Ask Claude: "Add .claude/settings.local.json to .gitignore and explain what .gitignore does."

Homework

About 30 minutes, after the lesson. No spending, and no later lesson depends on it. Task 1 changes the project: commit and push it, but do not create a tag.

  1. The whole rhythm once more, alone. Ask Claude for one small change of wording in the paragraph or the list of about-me.html, with "edit only about-me.html" and "do not commit". Leave the heading, the Contact section and the footer as they are; later lessons use them. Run git status and git diff, write your answers to the three questions, then ask Claude to commit, and run git push yourself.

    • Deliverable: one new commit on GitHub and three written answers.
    • Done when: git status says there is nothing to commit, GitHub shows one more commit than before, and git tag still prints only lesson-0.4.
  2. A second restore drill. Delete about-me.html from the project folder in Finder or File Explorer. Run git status, then git restore about-me.html, then git status again.

    • Deliverable: the file is back.
    • Done when: the page opens in the browser, and git status reports a clean working tree.
  3. Your history in your own words. Run git log --oneline, and find the same list of commits in your repository on GitHub. In your course notes, write one line per commit saying what changed and who made the commit, you or Claude.

    • Deliverable: a short "My history" note.
    • Done when: the note has one line for every commit in git log --oneline.

Save your work

git tag lesson-0.4
git push
git push --tags