Repositories, commits, and history
Three words you'll hear constantly. Let's demystify them.
A repository (or "repo") is just a folder that Git is watching. You turn an ordinary folder into a repo once, and from then on Git tracks everything inside it.
A commit is one save point. It's a snapshot of every file at a moment in time, plus a short message from you describing what changed ("added the login page", "fixed the broken signup button"). You make commits constantly — think of each as a checkpoint you might want to return to.
The history is the ordered list of all your commits. It's the timeline. You can scroll through it, read what each change was, and travel back to any point.
Here's how that looks in practice. Don't worry about memorizing it — you'll mostly have the AI run these for you — but read along so the words stop being mysterious:
# Turn the current folder into a Git repository (do this once)
git init
# See which files have changed since your last save point
git status
# Stage your changes, then save them as a commit with a message
git add .
git commit -m "Add the homepage layout"
# Look at your history — every commit, newest first
git log --oneline
git add . is you saying "include all my changes in the next save point." git commit is the actual save. The -m "..." is your note to your future self. Write notes you'd understand a month from now.