Codebases, repositories, Git, GitHub, and commits
Phase 5 changes the camera angle.
You know what systems are made of, and now you watch the humans make them.
And the first puzzle of professional software is social: forty engineers, one product, everyone editing at once. How does that not end in chaos?
This module is the answer, and it starts with the most important tool you have never been shown.
What is a codebase?
A company’s codebaseConcept · lights on your mapcodebaseA product’s entire source code, treated as one body of work — years of decisions written down in text. What a new hire actually inherits on day one. is all of its source code, taken together.
Physically, it is nothing exotic: thousands of Module 2’s plain text files, organized in folders. The coffee app’s codebase contains the frontend code, the backend services, the worker code, the infrastructure definitions from Module 8, everything the company has written.
Real codebases are large. A young startup’s might be tens of thousands of lines; a mature product’s runs to millions. Nobody has read all of it.
When engineers say “our codebase,” they mean the accumulated written work of everyone who ever built the product, including people who left years ago.
What is a repository?
The codebase lives in a repositoryConcept · lights on your maprepositoryThe codebase plus its memory: the current files and every version that preceded them, kept as one unit that can be copied anywhere whole. “The repo” in conversation., “the repo,” in daily speech.
A repository is more than a folder of code. It is two things at once:
- The files, as they are right now
- Their entire history — every version of every file, all the way back to the first day
When a new engineer joins the team, they clone the repository, and one command copies the whole codebase and its entire past onto their laptop.
That should sound remarkable. Every engineer carries not just the current product but every version of it that ever existed.
What is Git?
The machinery that makes history possible is GitConcept · lights on your mapGitThe tool that gives a codebase its memory: every change recorded, every past state recoverable, every line attributable. Learn its nouns and verbs and you can follow half of engineering conversation..
Git is a version-control system, which is a formal name for a time machine.
It records snapshots of the whole codebase over time, each one authored, dated, and explained. Pick any moment in the product’s past and Git can show you exactly what every file looked like and who last touched each line.
Git was created in 2005 by Linus Torvalds, the creator of Linux, making Module 2 pay off again. And it is effectively universal. Whatever company you work with, its code almost certainly lives in Git.
One design choice explains the clone you just met. Git is distributed. Every clone contains the full history, not a window onto someone else’s. Engineers can work, snapshot, and time-travel entirely on their own machines, syncing with the team when ready, which is the next lesson’s story.
What is a commit?
The unit of recorded history has a name. Meet the commitConcept · lights on your mapcommitOne recorded snapshot of changes, with an author, a timestamp, and a message saying why: “Add idempotency key to payment retries.” An engineer’s day produces a handful; a product’s history runs to millions.: a deliberate save-point that bundles related changes together with a message explaining them.
A commit records four things:
- What changed — the exact edits, per line
- Who made the change
- When
- And — the human part — a commit message saying why
The message is craft, not ceremony. Compare:
Add idempotency key to payment retries— a future engineer knows why this change existsfixed stuff— a future engineer knows nothing, and the author will be one of the mystified
Commits are the atoms of engineering work, and history is a chain of them. Watch a few get made:
An engineer finishes a fix and records it. Real commands, the daily rhythm of every engineer on Earth.
What is GitHub?
Git works entirely on one machine, which leaves the forty engineers disconnected from each other.
GitHubConcept · lights on your mapGitHubThe website hosting most of the world’s Git repositories, with discussion and review layered on top (lesson 3’s pull requests happen here). For most teams, “the code” means what lives on it. is a website that hosts the shared copy everyone syncs through, so repositories live where the whole team can reach them.
The distinction trips up newcomers constantly, so here it is plainly:
- Git is the tool — software running on each engineer’s machine, managing snapshots.
- GitHub is a meeting place — a company and website hosting a shared copy of the repo, plus collaboration machinery built around it.
A team could use Git without GitHub. In practice, nearly everyone uses a hosting service. GitHub is the dominant one, with GitLab and Bitbucket as the names of its main alternatives.
Module 3’s open-source commons is hosted almost entirely on GitHub, which is why the name was already familiar.
Why the time machine matters
There are three reasons, and each echoes through the rest of this module.
“What changed?” is answerable. The eternal first debugging question, every investigation’s opening move, has a literal, per-line, forever answer. Git can name the commit behind any line in the codebase, along with its author and stated reason. The command that does it is literally named git blame.
Undo exists. Any snapshot can be restored. Module 12’s “rollback,” undoing a bad release, is only possible because every previous version of the product still exists, restorable, in the history.
The history remembers everything, including secrets. Module 8 warned that a key pasted into code is remembered forever. This is the machinery that remembers. Deleting the secret from today’s files does not delete it from last month’s snapshot; anyone with the repo has the history. That is why a leaked secret must be revoked, never merely removed.
The mental model to remember
A codebase is all of a product’s source code, the accumulated written work of everyone who ever built it.
A repository is the codebase’s managed home: the files plus their complete history. Cloning it puts both on an engineer’s machine.
Git is the version-control tool, the time machine. Its snapshots come authored, dated, and explained. It is distributed. Every clone holds the full history.
A commit is one snapshot: what changed, who, when, and, in its message, why. The atom of engineering work.
GitHub hosts the shared copy the team syncs through. Git is the tool; GitHub is the meeting place.
The history makes “what changed?” answerable, makes undo possible, and never forgets, which is a superpower for debugging and a warning about secrets.
You should now be able to read the four-beat rhythm of daily engineering (status, add, commit, log) and explain why the history underneath it is the foundation everything else in this module builds on.
A bug appeared sometime in the last month. Without version control, the team would be guessing. With Git, an engineer can:
▼ answer the check to continue ▼