← All sessionsHomeSearch
AI Catalyst C3·Core Sessions - Week 8·2:39:48

Session 16: GitHub 101 — Fundamentals & Essentials

Akhil Trainer/mentor — returning Catalyst mentor (BC5 MCP session, session 6); signature Socratic style, first-principles build-ups, cohort members cast as characters in every analogy (Paul's expense app, Karen's frontend, the birthday-photos folder) · Niharika Cohort manager (CSAT survey, coordination)

Session map

WHY IT EXISTSTHE VOCABULARYTEAM SAFETY & SHIPPINGWhy GitHub existspackaging · backup · historyGit = diff trackingversions, not copiesGit vs GitHubsoftware vs platformRepositoriesfolders, split by serviceBranch treemain ← staging ← dev ← featureCommitstimestamped snapshotsClone · push · pullthe Rome ruleForkingwhole repo, across profilesMerge conflictsone line, two versionsPull requestsa ticket, not a mergePrivate + invitedshare without exposing.gitignore & secretskeys never enter the repoBranch → sitedev · staging · production
Why it existsThe vocabularyTeam safety & shipping
click a node — its card pops up (drag it anywhere, × to close)
Concept

The map reads left to right — why it exists flow into the vocabulary, then into team safety & shipping. Click any node to open that idea here; every timestamp jumps into the recording.

The short version

  1. Ground-up GitHub: why it exists (local code can't be shared, doesn't scale, has no history), what Git actually does (diff tracking — version control, not just backup), and what GitHub adds (remote backup + collaboration + access control on top of open-source Git).
  2. The vocabulary, each built from an analogy: repositories are folders; branches are working copies (n8n runs 1,607 of them); commits are timestamped snapshots; cloning is the first pull; push/pull are directional ('anything happens in Rome stays in Rome' — local changes don't exist remotely until pushed); forking copies a whole repo across profiles.
  3. The team-safety machinery: main branch holds production and nobody touches it directly; work flows feature → dev → staging → main; pull requests are 'raising a ticket, not a complete merge' — review gates (e.g. 2-of-3 approvers) keep juniors from breaking production, and rollback is a commit code away.
  4. Hands-on: a Sherlock-themed escape-room app built in Lovable, pushed to a private GitHub repo, collaborators added by username, dev branch + README + pull request + merge done in the UI, then the same repo cloned locally through Cursor and three learner-named branches pushed back up.
  5. Ship-safety rules that outlive the session: secrets live in .env, .env lives in .gitignore, real keys are configured at the hosting platform — never in a shared repo; and each branch can drive its own Vercel site so dev and staging stay private while only production faces users.

The concepts

01

Why GitHub exists: from one laptop to the cloud, and the three gaps

0:16:04

Before you memorize any Git command, rebuild the problem: code trapped on one laptop can't be shared, can't survive a crash, and can't remember its own history.

The session opens with Paul (yes, this cohort's Paul) writing an expense-management app on his own machine. It runs on his hardware, so he is the only beneficiary. Sharing it means shipping gigabytes to Dharmesh, Sayed and John until his storage quota dies — 'the lack of hardware will stop distributing the app.' Cloud computing solved that half: AWS (the pioneer, ~60% market share as stated), Azure and Google Cloud rent computation and storage by the unit, so the app can live on machines that scale.

But renting machines exposes three remaining gaps, and the trainer names them as insights: Paul needs to *package* his code in a standard way to move it between services; he needs a *reliable* copy somewhere safer than his breakable laptop; and he needs to *go back in time* — to know exactly which lines changed between versions. Those three needs — packaging, backup, history — are the job description Git and GitHub were hired for.

Worked example · from the session

Paul's expense app walk-through: sharing copies to three friends (1 GB, 5 GB, 500 MB) exhausts his storage; moving to rented cloud machines fixes distribution but leaves packaging, backup and change-history unsolved.

Why it matters

Knowing the three gaps keeps every later term honest: any Git feature you meet is solving packaging, reliability, or history. Nothing in this session is arbitrary ceremony.

People get this wrong

GitHub is where code runs.

Nothing runs on GitHub. Code executes locally or on hosting (Vercel, AWS); GitHub is the shared, versioned filing cabinet in between.

For your projects

You are literally the protagonist of this session's running analogy — Akhil builds the whole argument on 'Paul's expense app.' Beyond the joke: the KB repo itself currently sits uncommitted on one machine, which is exactly the reliability gap this concept names. OI-001's staging-branch decision is this lesson applied at home.

Go deeper

In one line: Local development means local hardware executes the code and only its owner benefits; cloud providers (AWS ~60% share, Azure, Google Cloud) rent compute/storage by usage and solve distribution. What remains: packaging code portably, backing it up reliably, and tracking exactly what changed between versions — the needs Git/GitHub exist to serve.

▶ Watch this taught: 0:16:04

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Cloud hosting already solved sharing — so what three problems was Git/GitHub still needed for?

Packaging code in a standard movable way, a reliable backup off your breakable machine, and change history — knowing exactly which lines changed between versions.

Why does the trainer start with a laptop story instead of Git commands?

First principles: every Git concept maps to one of the three gaps. If you know the problem each feature solves, the vocabulary stops being ceremony.

02

Git is diff tracking: versions, not copies

0:30:19

Git doesn't save your code twice — it saves what changed, down to an exclamation mark.

Git is an open-source version-control library, and its whole trick is diff tracking: between version 1 and version 1.1 it records only the difference. Change 'print hello world' to 'print hello world!!' and Git stores those two exclamation marks, not a second copy of the file. Each version compares to the *previous* one, not to the first — history is a chain of small deltas.

The trainer's sharper point: 'Git is not exactly the code backup. It is also the version backup.' A plain copy of your final code is nearly worthless for teamwork or debugging — without the version history you can't answer *what changed and when*, which is the question that actually matters when something breaks.

Worked example · from the session

The three-line evolution shown on the whiteboard: 'print hello world' → 'print hello world!!' (diff: two exclamation marks) → 'print hello world this is Paul' (diff: the added phrase). Git's record is those deltas, in order, with timestamps.

Why it matters

Diff thinking explains everything downstream: why commits are cheap, why pull requests can show exact +/- lines, and why rollback to any point in time is possible.

People get this wrong

Version control means keeping dated copies of the project folder.

That's backup, and it can't tell you what changed. Git stores ordered diffs — the changes themselves — which is what makes review, blame and rollback possible.

Go deeper

In one line: Git = open-source version control via diff tracking: each version records only the change from the previous version (not the first), to the letter — exclamation, period, space. It backs up versions, not just code; code without version history is 'of waste' for collaboration.

Contrast drawn with Google Drive's cat.png: Drive asks 'should I override?' — replacement, not versioning; Git keeps every version's diff instead of overwriting (0:30:19)

Version N compares only to version N−1, never to the first — history is a chain of deltas (0:30:19)

'Git is not exactly the code backup. It is also the version backup' (0:32:20)

▶ Watch this taught: 0:30:19

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

You change one character in a 10,000-line file and commit. What does Git store?

The diff — that one character's change — plus metadata. Not a second copy of the file.

Version 3 of a file — what does its diff compare against?

Version 2, the previous version. History is a chain of deltas, each relative to the last, never to the original.

03

Git vs GitHub — and why there is no 'local GitHub'

2:18:32

Git is software on your machine; GitHub is a company's website. You never install GitHub — you make a connection to it.

Git is the open-source version-control software: it runs locally and tracks diffs. GitHub is a platform — originally open-source-centric, acquired by Microsoft, monetized for enterprises — that stores your code *and its versions* remotely and layers on collaboration: access control, pull requests, reviews. Same relationship as your camera (Git) and a photo-sharing site (GitHub).

The confusion the session kept hitting: 'is there a local GitHub?' No — 'there is nothing concept as local GitHub.' When you clone, what you get is files plus a *connection reference*: pulls from that remote land in this folder, pushes from this folder go to that remote. GitHub Desktop and the terminal CLI are just two dashboards over the same operations.

Worked example · from the session

The live setup made it visible: git (in Cursor's terminal) did the cloning and branching on Akhil's machine; github.com in the browser showed the remote side catching up only when he pushed.

Why it matters

This one distinction prevents a whole class of beginner dead-ends — searching for a GitHub installer, expecting the website to see uncommitted local work, or blaming 'GitHub' when the local git state is the problem.

People get this wrong

GitHub is Git.

Git works fine without GitHub (it predates it). GitHub is one popular remote home for Git repositories — the version control itself happens in Git.

There is nothing concept as local GitHub, everyone. There's always a git connection that you make from local system to remote system.2:16:31
Go deeper

In one line: Git: open-source local version-control software (diff tracking). GitHub: Microsoft-owned remote platform adding versioned backup, collaboration and access control. No local GitHub exists — cloning creates a connection reference binding one local folder to one remote repo for push/pull. GitHub Desktop (UI) and CLI are interchangeable fronts.

▶ Watch this taught: 2:18:32

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

A teammate says their changes 'aren't showing up in GitHub.' What's the first question to ask?

Did they push? Local commits are Git's business and invisible to the remote until pushed — the website only knows what it's been sent.

What do you actually receive when you clone, besides files?

A connection reference: this folder is bound to that remote repo — its pulls come here, its pushes go there.

04

Repositories: folders, split by service

0:34:22

'Repository' is a fancy name for a folder — the craft is in deciding how many folders your project deserves.

A repository is the unit of storage and history on GitHub: one project space holding code plus all its versions. The best practice the trainer insists on for a full-stack project: split by service — frontend in one repo, backend in a second, database code in a third.

The payoff is maintainability and blast-radius control. 'If there is no change that I want to do for frontend, why would I change the entire piece of code?' A frontend tweak shouldn't drag backend history along, and separate repos also let you give collaborators access to exactly the layer they work on.

Worked example · from the session

Paul's expense app drawn as three repos — frontend, backend, database — each with its own branches, so Karen's UI work never touches the payments code.

Why it matters

Repo boundaries are the first architectural decision every project makes on GitHub, and retrofitting a split later is painful — worth getting roughly right at creation time.

People get this wrong

One project = one repository, always.

One *service* per repository is the stated best practice for full-stack work — a project is often several repos.

Go deeper

In one line: Repositories are folders holding code plus version history. Best practice for full-stack work: separate repos per service (frontend / backend / database) for maintainability, independent change history and per-layer access control.

▶ Watch this taught: 0:34:22

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Why three repos for one app instead of one repo with three folders?

Independent histories and blast radius: a frontend change doesn't ride through backend history, and access can be granted per layer. One repo with folders shares one history and one door.

05

Branches and the main → staging → dev → feature tree

0:38:36

A branch is a working copy with a name — and serious teams arrange those copies in a tree so nobody edits production directly.

Branches are 'copies of the repository with different names': you duplicate the current state so you can edit without disturbing the original — the birthday-photos analogy: hand Karen a copy of the photos folder to edit while the originals stay safe. Real projects run more branches than you'd guess: n8n's public repo carries 1,607.

The doctrine is the hierarchy. Main holds production — the code users are touching right now — and 'you do not want to disturb it.' Below it a staging branch, below that dev, and under dev the feature branches where individuals actually work (Karen's three frontend features, Paul's two backend ones). Changes climb the tree: feature → dev (where merges happen) → staging (where load and security testing happens) → main. More people and more features just mean a bushier tree — the shape survives.

Worked example · from the session

Paul's expense app v3.0: Karen branches three frontend features, Paul two backend ones; everything merges upward through dev and staging before production sees it. n8n at 1,607 branches shows the same shape at industrial scale.

Why it matters

The tree is the collaboration contract. Every workflow question later in the session — who merges, what a PR compares, which Vercel site updates — is answered by where you are in this tree.

People get this wrong

Branches are for big teams; solo builders can just work on main.

The moment anything is live, main is your production and deserves the same protection — even a solo dev branch keeps a broken experiment from taking down the running site.

main production — users live here staging load & security testing dev where merges happen feature 1 Karen · frontend feature 2 Paul · backend feature 3 next teammate promotion = merge upward n8n runs 1,607 branches never edited directly
Production sits untouched at the top; work climbs the tree toward it
For your projects

OI-001 — 'chats commit to staging, only Paul touches main' — is precisely this hierarchy applied to the KB repo. This session is the rationale for that decision, teachable back to yourself.

Go deeper

In one line: Branches = named copies within a repository for parallel work (branching is local-to-local or remote-to-remote — always within one repo). Best-practice hierarchy: main (production, never edited directly) ← staging (stress/security testing) ← dev (merge point) ← feature branches per person/feature. n8n: 1,607 branches in production.

▶ Watch this taught: 0:38:36

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Where do you actually write code in the hierarchy, and where does testing under load happen?

You write on a feature branch under dev; load and security testing happen on staging, the last stop before main.

Why does main stay untouchable even for a two-person team?

Main is what users are running. The hierarchy exists so experiments break dev or staging — never the code in production.

Is branching the same as copying the repo to your own account?

No — branching stays inside one repository. Copying a whole repo across profiles is forking, a different operation.

06

Merge conflicts: two versions of the same line

0:48:50

Two features edit the same line two different ways — Git can't choose for you, and that's a feature.

A merge conflict is exactly that: feature 1 and feature 3 both touched the same line in the same file, dev branch receives both, and asks 'which one should I prioritize?' You'll never want both. Resolution is human: keep one, discard the other, and the merge proceeds cleanly.

Who decides? 'Who is managing or accepting that merge is the final decision maker' — in an organization, an architect or senior engineer. The trainer's family analogy: two kids fighting over one pen until a parent allocates it. At scale (ten conflicted files), resolution is manual and tedious — which is where GitHub Copilot earns its keep, analyzing both versions and recommending what survives. And upstream of all of it: teams that coordinate — 'come over a call when you're ready for merge' — hit fewer conflicts in the first place.

Worked example · from the session

The whiteboard case: two features format the same 'hello world' line differently; dev branch flags the conflict; the senior engineer picks one and the merge completes.

Why it matters

Conflicts are the tax on parallel work. Knowing they're normal — and that resolution is a role, not a mystery — is the difference between a calm merge and a panicked one.

People get this wrong

A merge conflict means someone made a mistake.

It means two people did their jobs in parallel on the same lines. It's routine bookkeeping, resolved by a decision, not a bug to be feared.

Go deeper

In one line: Merge conflict: the same line(s) changed differently in two branches being merged; Git requires a human choice. Resolver = whoever owns the merge (architect/senior engineer in orgs). GitHub Copilot can analyze and recommend resolutions; intentional, coordinated merging reduces conflict frequency.

▶ Watch this taught: 0:48:50

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Git refuses to auto-merge your PR. What happened, and what's your job now?

Both branches changed the same lines differently. Yours (or the merge owner's) job is to pick which version survives — Git won't and shouldn't guess.

How do teams reduce conflicts before they happen?

Coordination: intentional merges, agreed ownership of files, and talking before merging — 'come over a call when you're ready for merge.'

07

Commits: timestamped snapshots (and Lovable's automatic ones)

0:52:55

A commit is you telling GitHub 'I stand behind this change, at this time' — a timestamped snapshot you can always return to.

Every saved change can become a commit: 'I commit this change for this version.' At 8 AM Akhil writes hello world; at 10 AM he adds two exclamation marks and pushes; those are two timestamps in the repo's memory. The chain of commits *is* the project's history — and any commit's code can be restored later (the session rolled back to a previous commit using its code, with Copilot assisting).

The hands-on twist: Lovable committed automatically — the escape-room app arrived on GitHub with 12 commits nobody wrote messages for. Convenient, but it surfaces a trade-off a learner spotted immediately: automation removes control. You don't choose the snapshot moments or describe them, which makes the history harder to navigate when something needs undoing.

Worked example · from the session

The escape-room repo landing on GitHub with 12 Lovable-authored commits; later, the dev branch showing '3 commits ahead of main' after the README work — the counter that tells you exactly how far branches have diverged.

Why it matters

Commits are the unit of time travel. Rollback, PR diffs, and 'what changed since it last worked' all address history commit by commit.

People get this wrong

Saving a file and committing are the same thing.

Saving changes your local file. Committing records a versioned, timestamped snapshot in history — the thing rollback and review operate on.

Go deeper

In one line: Commit = a timestamped snapshot of changes pushed to the repo's history ('the status of code at a particular time'). History is navigable and reversible via commit codes. Lovable auto-commits every change (12 commits on the demo app) — convenient but uncontrolled: no chosen moments, no messages.

▶ Watch this taught: 0:52:55

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

What two things does a commit record that a file-save doesn't?

The moment (timestamp in the repo's shared history) and the intent — it's a declared version you can diff against and roll back to, not just bytes on disk.

What's the cost of Lovable committing for you?

Control: you don't pick the snapshot points or write the messages, so the history is noisier and harder to navigate when you need to undo something specific.

08

Clone, push, pull: what happens in Rome stays in Rome

0:54:58

One rule organizes everything: your machine and GitHub are two worlds, and code only crosses between them when you explicitly push or pull.

Cloning is the first-ever pull: 'git clone <URL>' copies a remote repository to your machine — free, unlimited, no AI credits, and always remote → local. From then on the directions have names: local → remote is push, remote → local is pull. That's the whole vocabulary.

The rule that resolves every beginner confusion: 'anything happens in Rome stays in Rome — anything happens in the local system stays in the local system.' Create three branches locally and GitHub simply doesn't know until you push them. The live demo made it tactile: Akhil cloned the escape-room repo through Cursor's agent (102 files downloading), created branches named Deborah, Sayed and Dharmesh locally — remote showed nothing — then pushed, and all three appeared on github.com.

Worked example · from the session

Terminal, live: make a folder on the desktop → git clone the escape-room URL → 102 files arrive → three local branches created (invisible remotely) → push → github.com now lists dev, Sayed, Dharmesh, Deborah.

Why it matters

Ninety percent of early git panic is a local/remote mismatch. The Rome rule diagnoses all of it: if the website doesn't show it, it wasn't pushed; if your folder doesn't have it, it wasn't pulled.

People get this wrong

Git syncs my work to GitHub automatically.

Nothing moves without an explicit push or pull. (Tools like Lovable that 'auto-sync' are just pushing on your behalf.)

LOCAL (your machine — “Rome”) REMOTE (GitHub) working folder edits, commits, new branches local branches invisible to GitHub repository code + full version history remote branches what teammates see push pull first-ever pull = clone (git clone <URL> — free, no AI credits) Nothing crosses the gap by itself: what happens locally stays local until you push.
The Rome rule — nothing crosses the gap until you push or pull
Anything happens in Rome stays in Rome. Right? In the same way, anything happens in local system stays in the local system.0:56:59
Go deeper

In one line: Clone = first pull of a repo (always remote→local; 'git clone <URL>'; free, no credits). Push = local→remote; pull = remote→local. Local work is invisible to the remote until pushed ('anything happens in Rome stays in Rome'). Demo: 102-file clone via Cursor's agent, three local branches pushed to remote.

Try it now

Clone any public repo, create a branch locally, and refresh the repo's website — seeing the branch NOT appear until you push is the lesson.

▶ Watch this taught: 0:54:58

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

You created a branch and your teammate can't see it on GitHub. Broken?

No — branches you create locally stay local until pushed. The Rome rule: the remote only knows what it's been sent.

Which direction is cloning, and how often do you do it per repo?

Remote → local, and once — it's the first-time pull that also creates the connection. After that you pull updates, not re-clone.

09

Forking: copying a whole repository across profiles

1:01:01

Branching copies inside a repo; forking copies the repo itself — into your own account, as your own asset.

Forking duplicates an entire repository from someone else's profile to yours — remote to remote, across accounts. It only works on public repositories: you can't fork what you can't see. Once forked, the copy is yours to modify, build on, even commercialize (license permitting) — the trainer's example: admiring Paul's expense app and forking it to take it further.

Two practical uses stand out. Insurance: fork n8n's public repo (22,000 commits on master) and 'if tomorrow anything deletes this repository, you still have a copy in your profile.' And skills: public repos increasingly ship agent skills — n8n's agent-skills repo was shown — and forking is how you take a maintained skill collection and make it durably yours.

Worked example · from the session

n8n's open-source repository — 22,000 commits, 1,607 branches — forked in one click; the fork preserves the full state of master in Akhil's profile, immune to upstream deletion.

Why it matters

Forking is how the open-source economy works: take, adapt, contribute back. It's also the cheapest backup of any public dependency your projects rely on.

People get this wrong

Forking steals the project.

Forking public code is the designed mechanism of open source — the license governs what you may do with it, and the original remains untouched.

Go deeper

In one line: Forking duplicates an entire public repository to your own profile (remote-to-remote, across accounts; branching stays within one repo). Uses: building on others' work, insurance against upstream deletion, owning copies of skill/dependency repos. Private repos cannot be forked.

▶ Watch this taught: 1:01:01

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Branch vs fork in one sentence each?

A branch is a named working copy inside one repository; a fork is a copy of the whole repository into a different account.

Why fork a project you don't intend to modify?

Insurance — your fork survives even if the original is deleted or goes private. Cheap durability for anything you depend on.

10

Private by default, shared by invitation

1:42:02

Your repo can stay secret and still have teammates — private and shared are not opposites.

Everything Lovable pushes to GitHub arrives as a private repository, and the trainer endorses the default: 'we never know — that could be the next million-dollar app.' Notably: 'Lovable does not have the copyright of your code. Your code is yours.'

Sharing doesn't require going public. From the repo's settings you add collaborators by GitHub username or email — Sayed, Richard and Deborah were added to the escape-room repo live — and you manage what access each gets. 'You don't have to open-source your code' to work as a team; access control is the point of the platform layer.

Worked example · from the session

The escape-room repo: private from the moment Lovable created it, then three named collaborators invited through settings — public visibility never touched.

Why it matters

This kills the most common false dilemma beginners face ('make it public so my teammate can see it'). Invitation beats exposure, always.

People get this wrong

Private repos are only for paid accounts.

The free tier includes unlimited private repositories (with 500 MB package storage, as read off the pricing page in session).

Go deeper

In one line: Lovable-created repos are private by default; the code's copyright is yours. Collaborators are added by username/email with managed access levels — sharing never requires making a repository public.

Visibility is repo-level only: you cannot make parts of one repo private and parts public — split into separate repos if you need both (2:28:42)

Connecting an AI agent to a repo 'is like assigning a person to that repository' — same collaborator model, not a branch (2:26:39)

▶ Watch this taught: 1:42:02

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

A teammate needs access to your private repo. What do you NOT need to do?

Make it public. Add them as a collaborator by username or email and scope their access.

11

Pull requests: a ticket, not a merge

1:50:09

'Creating a pull request is as good as opening up a ticket. This is not a complete merge.' The gap between asking and merging is where teams stay safe.

A pull request reads oddly until you flip the perspective: *main* wants to pull code from dev, so it requests it. Opening one shows the exact diff — pluses for added lines, minuses for removed, 'to the T, whether it's an exclamation, a period, a space' — with an arrow showing merge direction.

The design insight is that raising a PR and merging it are separable powers. Junior developers can be allowed to raise PRs while 'their access stops there' — no ability to merge. Reviews become configurable gates: require, say, 2 of 3 named teammates to approve before a merge can happen. It exists 'to prevent accidents' — unstable code never reaches protected branches unreviewed. And if something bad lands anyway, any previous commit's code restores the branch (the session demoed a rollback with Copilot's help). Copilot can also pre-check a PR: 'I want to ask Copilot to do the necessary checks.'

Worked example · from the session

The README PR, run end to end in the UI: dev compared to main showing the added lines, PR created, reviewed, merged — then both branches identical; followed by a rollback to a previous commit to prove reversibility.

Why it matters

The PR gate is the single most transferable piece of team engineering in the session — the same raise/review/merge separation governs how you'll accept AI-agent changes, not just human ones.

People get this wrong

A pull request submits your code to the project.

It opens a reviewable proposal. Nothing moves until someone with merge rights — possibly after required approvals — completes the merge.

dev branch 3 commits ahead of main Pull request a ticket, not a merge main branch protected production Review gate e.g. 2 of 3 must approve diff shown to the character: + added · − removed juniors can raise… …only merge rights land it Merged something bad? Any previous commit code restores the branch — rollback is built in.
The PR gate — raise, review, then merge; access can stop at any step
Creating a pull request is as good as opening up a ticket. This is not a complete merge.1:50:09
For your projects

This is the mechanism behind OI-001: chats get 'raise' powers on a staging branch, only you hold merge-to-main. The session hands you the vocabulary to configure it in GitHub's settings when the repo goes up.

Go deeper

In one line: PR = a requested merge showing the exact diff (+/- to the character) with direction; 'raising a ticket, not a complete merge.' Powers are separable: who raises, who reviews (configurable, e.g. 2-of-3 approvers), who merges. Purpose: peer review, accident prevention, access control. Bad merges are reversible via commit codes; Copilot can pre-validate PRs.

Try it now

In any repo you own, protect main and require one review. Then try to merge your own PR — feeling the gate refuse you is the lesson.

▶ Watch this taught: 1:50:09

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Why is 'PR' named from main's point of view?

The receiving branch is doing the pulling: main requests dev's code. The arrow in the compare view shows that direction.

Your junior teammate can raise PRs but not merge. What is this arrangement buying the team?

Accident prevention with participation: they contribute at full speed while a reviewer gate keeps unvetted code out of protected branches.

A merged PR broke production. Options?

Roll back — restore the branch to a previous commit by its code (Copilot can assist), then fix on dev and re-run the gate.

12

.gitignore and secrets: keys never enter the repo

2:30:43

A repo is a shared place, so the rule is absolute: API keys go in .env, .env goes in .gitignore, and real keys live at the hosting platform.

.gitignore is a small file of patterns telling Git what never to track: '.env, .log, build folders — you should not care about them, just ignore them.' The one non-negotiable entry: .env — the file where local API keys and secrets live while you test. 'You will always have .env as part of your .gitignore. That's the best practice.'

The question that triggered this (Serendip's: what happens to API keys after a merge?) has a clean answer: they were never in the merge. Secrets are configured at the hosting-platform level — pasted into Vercel's environment settings, not into any file GitHub sees — 'because GitHub is a shared repository that you will use across your team.' Local .env for development, platform env-vars for deployment, repo carries neither.

Worked example · from the session

The .gitignore shown live with *.log, *.env and build-folder patterns; then Vercel's dashboard as the place the production keys are actually pasted.

Why it matters

Leaked keys are the most expensive beginner mistake in AI building — bots scrape public repos for them within minutes. This two-line discipline is the whole defense.

People get this wrong

A private repo is a safe place for API keys.

Private is an access setting, not a vault: every collaborator, every clone, and every future visibility change sees the full history. Keys stay out, period.

You will always have dot e n v as part of your git ignore. That's the best practice.2:30:43
Go deeper

In one line: .gitignore lists patterns Git must not track (*.env, *.log, build dirs). Best practice, always: .env (local secrets for testing) in .gitignore; production secrets configured at the hosting platform (Vercel env settings), never pushed to the shared repo.

Try it now

Check every project you have right now: is .env in .gitignore? If a key ever got committed, rotate it — deleting the file doesn't delete it from history.

▶ Watch this taught: 2:30:43

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

Where do the same API keys live in development vs production?

Development: local .env file, untracked because .env is in .gitignore. Production: the hosting platform's environment settings. The repo itself: never.

You committed a key last week and deleted it yesterday. Safe?

No — commits are history, and the key is still in it. Rotate the key; treat the old one as public.

13

One branch, one site: dev/staging/production deployment

2:32:45

Connect each Git branch to its own Vercel project and your branch tree becomes three living websites — two private, one public.

The branch hierarchy earns its keep at deployment. In Vercel you create a separate project per branch — pick the branch in the project's settings — so merging into dev auto-deploys a dev site, merging into staging refreshes a staging site, and pushing main updates the real one. Each gets its own URL; only main gets your actual domain name — 'this is what the users will see, not these two.'

This is how real companies ship a feature: build it on dev, test it there; promote to staging for the heavier passes (can it take the load? does it hold up on security?); then, timed with the launch, merge to main and it's live. The learner question 'do commits to main auto-update the site?' gets a flat yes: once connected, 'Vercel will take care of it.'

Worked example · from the session

Three Vercel projects wired to the escape-room repo's branches — dev and staging sites private for the team, the main site public — with a merge into each branch triggering its own redeploy.

Why it matters

This closes the loop the session opened: version control isn't bookkeeping, it's the steering wheel for what users actually see, environment by environment.

People get this wrong

Deployment is a separate manual chore after coding.

Wired this way, deployment IS the merge — the branch tree and the environments are the same structure, and Vercel just mirrors it.

dev branch merge point staging branch heavy testing main branch production auto-deploy on merge dev site Vercel URL · private staging site Vercel URL · private YOUR DOMAIN public — users see only this One Vercel project per branch. A feature ships dev → staging → main, and each merge refreshes its own site — launch day is just the last merge. Environment variables live here at the hosting platform — never in the shared repo.
Each branch drives its own Vercel site — only production wears the real domain
For your projects
  • When the KB's OI-016 remote-reading question lands (Cloudflare Pages + Access was the noted route), the same branch-per-environment pattern applies to the KB site itself — staging KB vs published KB.
Go deeper

In one line: Per-branch deployment: one Vercel project per Git branch (dev/staging/main), auto-deploying on push/merge to that branch. Dev = merge point site, staging = load/security testing site, main = production with the custom domain; dev and staging URLs stay private to the team.

▶ Watch this taught: 2:32:45

Check yourself

Answer from memory first — the recall attempt is what makes it stick. Then reveal.

How does a feature physically travel from an idea to users' screens in this setup?

Feature branch → merge to dev (dev site auto-redeploys, team tests) → promote to staging (heavier testing on its own site) → merge to main → production redeploys under the real domain.

What distinguishes the production Vercel project from the other two?

The custom domain and public visibility. Dev and staging have Vercel-issued URLs and stay private to the team.

Every concept, three clicks deep

The same concepts as a quick reference: the closed row is the glance, open is the study card, and every timestamp jumps into the recording.

01Why GitHub exists: from one laptop to the cloud, and the three gapsLocal development means local hardware executes the code and only its owner benefits;0:16:04

Local development means local hardware executes the code and only its owner benefits; cloud providers (AWS ~60% share, Azure, Google Cloud) rent compute/storage by usage and solve distribution. What remains: packaging code portably, backing it up reliably, and tracking exactly what changed between versions — the needs Git/GitHub exist to serve.

02Git is diff tracking: versions, not copiesGit = open-source version control via diff tracking: each version records only the change from the previous…0:30:19

Git = open-source version control via diff tracking: each version records only the change from the previous version (not the first), to the letter — exclamation, period, space. It backs up versions, not just code; code without version history is 'of waste' for collaboration.

Contrast drawn with Google Drive's cat.png: Drive asks 'should I override?' — replacement, not versioning; Git keeps every version's diff instead of overwriting (0:30:19)

Version N compares only to version N−1, never to the first — history is a chain of deltas (0:30:19)

'Git is not exactly the code backup. It is also the version backup' (0:32:20)

03Git vs GitHub — and why there is no 'local GitHub'Git: open-source local version-control software (diff tracking).2:18:32

Git: open-source local version-control software (diff tracking). GitHub: Microsoft-owned remote platform adding versioned backup, collaboration and access control. No local GitHub exists — cloning creates a connection reference binding one local folder to one remote repo for push/pull. GitHub Desktop (UI) and CLI are interchangeable fronts.

04Repositories: folders, split by serviceRepositories are folders holding code plus version history.0:34:22

Repositories are folders holding code plus version history. Best practice for full-stack work: separate repos per service (frontend / backend / database) for maintainability, independent change history and per-layer access control.

05Branches and the main → staging → dev → feature treeBranches = named copies within a repository for parallel work (branching is local-to-local or remote-to-rem…0:38:36

Branches = named copies within a repository for parallel work (branching is local-to-local or remote-to-remote — always within one repo). Best-practice hierarchy: main (production, never edited directly) ← staging (stress/security testing) ← dev (merge point) ← feature branches per person/feature. n8n: 1,607 branches in production.

06Merge conflicts: two versions of the same lineMerge conflict: the same line(s) changed differently in two branches being merged;0:48:50

Merge conflict: the same line(s) changed differently in two branches being merged; Git requires a human choice. Resolver = whoever owns the merge (architect/senior engineer in orgs). GitHub Copilot can analyze and recommend resolutions; intentional, coordinated merging reduces conflict frequency.

07Commits: timestamped snapshots (and Lovable's automatic ones)Commit = a timestamped snapshot of changes pushed to the repo's history ('the status of code at a particula…0:52:55

Commit = a timestamped snapshot of changes pushed to the repo's history ('the status of code at a particular time'). History is navigable and reversible via commit codes. Lovable auto-commits every change (12 commits on the demo app) — convenient but uncontrolled: no chosen moments, no messages.

08Clone, push, pull: what happens in Rome stays in RomeClone = first pull of a repo (always remote→local;0:54:58

Clone = first pull of a repo (always remote→local; 'git clone <URL>'; free, no credits). Push = local→remote; pull = remote→local. Local work is invisible to the remote until pushed ('anything happens in Rome stays in Rome'). Demo: 102-file clone via Cursor's agent, three local branches pushed to remote.

09Forking: copying a whole repository across profilesForking duplicates an entire public repository to your own profile (remote-to-remote, across accounts;1:01:01

Forking duplicates an entire public repository to your own profile (remote-to-remote, across accounts; branching stays within one repo). Uses: building on others' work, insurance against upstream deletion, owning copies of skill/dependency repos. Private repos cannot be forked.

10Private by default, shared by invitationLovable-created repos are private by default;1:42:02

Lovable-created repos are private by default; the code's copyright is yours. Collaborators are added by username/email with managed access levels — sharing never requires making a repository public.

Visibility is repo-level only: you cannot make parts of one repo private and parts public — split into separate repos if you need both (2:28:42)

Connecting an AI agent to a repo 'is like assigning a person to that repository' — same collaborator model, not a branch (2:26:39)

11Pull requests: a ticket, not a mergePR = a requested merge showing the exact diff (+/- to the character) with direction;1:50:09

PR = a requested merge showing the exact diff (+/- to the character) with direction; 'raising a ticket, not a complete merge.' Powers are separable: who raises, who reviews (configurable, e.g. 2-of-3 approvers), who merges. Purpose: peer review, accident prevention, access control. Bad merges are reversible via commit codes; Copilot can pre-validate PRs.

12.gitignore and secrets: keys never enter the repo.gitignore lists patterns Git must not track (*.env, *.log, build dirs).2:30:43

.gitignore lists patterns Git must not track (*.env, *.log, build dirs). Best practice, always: .env (local secrets for testing) in .gitignore; production secrets configured at the hosting platform (Vercel env settings), never pushed to the shared repo.

13One branch, one site: dev/staging/production deploymentPer-branch deployment: one Vercel project per Git branch (dev/staging/main), auto-deploying on push/merge t…2:32:45

Per-branch deployment: one Vercel project per Git branch (dev/staging/main), auto-deploying on push/merge to that branch. Dev = merge point site, staging = load/security testing site, main = production with the custom domain; dev and staging URLs stay private to the team.

Tools referenced

ToolCoverageMomentContext
GitHubdemonstrated0:12:01The session's subject: repo creation via Lovable, collaborators, dev branch, PR raise/diff/merge, rollback, fork walk-through, pricing page (free: 500 MB packages; Team $4/user/mo: 2 GB)
Lovabledemonstrated1:14:55Built the Sherlock escape-room app ('The Great Escape Society' / 'Baker Street Disappearance'), connected to GitHub via OAuth, auto-committed 12 times; also generated the README on the dev branch
Cursordemonstrated2:02:19Its agent ran the local half: terminal folder creation, git clone (102 files), three local branches, pushes, browser-based GitHub auth
ChatGPTdemonstrated1:21:05Escape-room ideation (20 themed variations) and the Lovable build prompt; conversation link shared with the cohort
Vercelexplained2:32:45Per-branch projects with auto-deploy on merge; environment variables configured here, not in the repo
GitHub Copilotexplained0:50:52Named for merge-conflict resolution, PR pre-checks ('ask Copilot to do the necessary checks'), and the rollback assist
AWSexplained0:20:07Cloud-computing origin story; 'the pioneer… about 60 percent of global market share' (as stated)
n8nmentioned0:42:39Scale exhibit: 1,607 branches, 22,000 commits on the public repo; its agent-skills repo shown as a fork-worthy asset
Azure / Google Cloud / DigitalOceanmentioned0:20:07Named alongside AWS as rentable compute
Supabasementioned0:24:10In the multi-cloud example (database piece); also surfaced in Sayed's escape-room variant (Supabase auth on the membership door, 2:24:38)
GitHub Desktopmentioned2:16:31UI alternative to terminal git — same operations, different front
ElevenLabsmentioned1:23:06Floated for escape-room audio, not used (ASR: '11 Labs')
GitLab / Bitbucketmentioned0:30:19Named as GitHub's competitive peers; Q&A verdict: 'the fundamentals will never change… just the app names change' (2:20:36)
GitLensmentioned2:18:32'A nerdy way of looking into Git stacks and graphs — you don't have to worry about it at this point'
Wispr Flowmentioned1:16:58Trainer's dictation tool while composing the escape-room prompt ('I'm using Whisperflow')

Session materials

Archived locally on V: — click to open. Companion pages link to the LMS.

Action items

Resources mentioned

Resources
  • docChatGPT conversation link — escape-room ideation and the full Lovable build prompt (20 themed variations) 1:25:13
  • docEscape-room GitHub repository ('Escaped Chronicles', private) — living example of commits, branches, PRs used in the session 1:40:00
  • docGitHub pricing page — free vs Team tier limits walked through live 2:00:17
  • docn8n public repository + agent-skills repo — the forking exhibits 1:58:16
  • docCopilot PR-validation prompt pattern ('here's my PR, dev into main — do the necessary checks') 2:20:36

Extraction notes

This page was built from an auto-generated transcript, which garbles product and people's names. Those were corrected silently in everything above and logged here for transparency. The warnings flag claims that were true on the recording day but change fast.

Transcript corrections applied

The transcript saysThe trainer actually means
Wersl / worse cell / WERSL / VersalVercel
Chargegbt / Chargeuty / ChargeddutyChatGPT
n 8 inn8n
11 LabsElevenLabs
Garmesh / DarnishDharmesh (learner)
Kareem / Karenthe same analogy character — rendered inconsistently by the ASR
GPT 5.6 sol / GPA 5garbled model-name fragments — exact model unresolved
pumping companieslikely 'FAANG companies' or 'big companies' — garbled
loose testload test

True on recording day — verify before relying