1. Courses
  2. AI Engineering
  3. Build and Launch a Site with AI
  4. Stop 3

25 minBeginner

Save points with Git and GitHub

Every working step deserves a save point you can return to, and a copy that lives somewhere safer than your laptop. This lesson connects your project to GitHub, shows you how to commit and push without typing Git commands, and how to undo a bad change in a minute.

By the end you can

  • Explain repository, commit and push in plain words
  • Create a private GitHub repository and push your project to it
  • Keep secrets out of the repository, and know what to do if one gets in
  • Undo a bad change with a revert, and use a branch for a risky one

The everyday picture

Think of a video game with save points. Before the hard level you save, so that if it goes badly you restart from there instead of from the beginning. Now imagine every save also went into a fireproof safe across town, with a note saying what you had just done.

Git makes the save points on your laptop. GitHub is the safe across town. The note is the commit message.

Three words: repository, commit, push

  • A (repo) is your project folder plus its whole history.
  • A is one save point with a message, such as "Recipe pages".
  • A sends your new commits to GitHub.

Commits stay on your laptop until you push. In lw-05, every push to GitHub will also make Vercel build a new version of the live site, so a push is the moment a change starts heading to visitors. Next.js's setup command already made the first commit for you.

Changed files after a checked step commit Your laptop History push GitHub (private) later: Vercel builds it
A commit saves a checked step into the history on your laptop. A push copies new commits to GitHub, where Vercel will pick them up from lw-05 on.

Quick check

You made three commits today but didn't push. Your laptop dies tonight. What is lost?

Loading the rest of the lesson…