Skip to content

Level 2 — Git & GitHub

This is the central skill — the one to learn deeply if you learn nothing else. With Git in place, you can let the AI try anything, because you can always undo.

What it is. Git saves snapshots (“commits”) of your project. You can roll back to an earlier one if the AI breaks something that used to work.

Key ideas:

  • commit — a saved snapshot with a short description of what changed.
  • diff — exactly what changed since last time.
  • revert / rollback — go back to a working version.

Why it matters with AI. Without Git, one bad AI prompt can mean lost work. With Git, you can let the AI break anything — there’s always an undo button.

What it is. GitHub stores your project on the internet (a backup), lets you share it, and is where deploy services pick up your code from.

Git ≠ GitHub. Git is the tool on your computer. GitHub is the website that stores a copy. You can use Git with no GitHub at all — but together they’re the standard workflow.

  • Repository (“repo”) — your project folder under Git’s control. One project, one repo.
  • local vs remote — the copy on your computer (local) and the copy on GitHub (remote). You keep them in sync.
  • push / pull — push sends your changes up to GitHub; pull brings changes down. That’s the syncing.
  • branch — a parallel version of the project so you can experiment without breaking the working one. More advanced, but useful.

What it is. The short description you attach to each commit. A widely used convention called Conventional Commits puts a one-word type in front, so the history reads at a glance (and tools can auto-build changelogs):

  • feat: — a new feature (“feat: add login screen”)
  • fix: — a bug fix
  • chore: — routine upkeep that doesn’t change the product (dependencies, config, renames)
  • refactor: — rewrote code without changing behaviour
  • docs: — documentation · test: — tests · revert: — undo a previous commit

Whether a change is feat or chore just depends on what it is: a new button is feat, bumping a library is chore. As a solo builder this is optional polish — but it keeps your history readable.

Why it matters with AI. Pick ONE language and stick to it — a history that’s half English and half your own language is the worst outcome. English is the path of least resistance: the type prefixes are English anyway, it’s the universal norm, and the AI defaults to it. Tell the AI once — “always write commits as Conventional Commits in English” — and it stops drifting between languages.

What it is. A small file that lists what Git must ignore — never track, never push to GitHub. Two kinds of things belong in it: secrets (your .env file with API keys) and generated junk (folders like node_modules that can be rebuilt and would only bloat the repo).

Why it matters with AI. This is your safety catch against the single most expensive beginner mistake — a leaked API key. If .env is listed in .gitignore, your secrets physically cannot reach a public repo, no matter what you commit. Before your very first push, confirm a .gitignore exists and that it includes .env. (What actually goes inside .env is Level 4; the horror story is Expensive mistakes.)

After the AI makes a change you like, commit it with a clear message (“added login screen”). Make another change, then practice viewing the diff and reverting back to the commit. Feel how it’s impossible to lose the good version.