Files
ced4568andClaude Sonnet 5 e68b6f445a feat(root03): author Git & Collaborative Development
Adds all 6 ROOT 03 modules (why version control exists, the Git mental model, everyday Git,
branching & merging, remote repositories, engineering Git workflow) — 31 activities. Uses only
real LOCAL Git repositories throughout — no Gitea account, no network access, and no
RootNode-canonical-repo credential is ever needed or exposed in a student Lab
(docs/ROOT_FOUNDATIONS_LAB_STRATEGY.md §4). Modules 1, 2, and 6 are conceptual bookends with no
lab, matching the flexible readiness standard already used in ROOT 01/02.

Adds 3 new hands-on Git scenarios plus 2 MCQs: git-everyday-basics (init/add/commit, validated
by inspecting real `git log`/`git show` state, not just command output strings — Step 6's
explicit requirement), git-branching-and-merge (a REAL merge conflict caused on purpose by two
branches editing the same line, resolved by the student, validated by confirming the conflict
markers are gone and a real two-parent merge commit exists), and git-remote-clone-push (a real
local bare repository standing in for a remote — clone/commit/push validated by inspecting the
REMOTE side directly, not just the student's own clone). All tested end-to-end via the real
scenario-validation API, including negative tests.

Wires rootnode-git-fundamentals-assessment (2 required + 3 random-draw scenarios) using the
existing Phase 3B assessment engine.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-26 17:08:00 -05:00

2.3 KiB

Everyday Git

The commands you'll actually use constantly

Module 2 gave you the model. This module gives you the six commands that make up the vast majority of real, everyday Git usage.

git init — start tracking a project

$ git init

Creates a new, empty repository in the current directory (a hidden .git folder holds everything). You only run this ONCE per project, at the very beginning.

git status — where do things stand right now?

Shows what's staged, what's modified-but-unstaged, and what's untracked — the single most useful command for orienting yourself, and one you'll run constantly, almost reflexively, before and after almost every other Git command.

git add — stage a change

$ git add file.txt        # stage one specific file
$ git add .                # stage everything currently changed

git commit — permanently record what's staged

$ git commit -m "Add configuration loader"

A good commit message describes WHAT changed and, ideally, WHY — future-you (or a teammate) reading git log months later should understand the change without re-reading the entire diff.

git log — see the history

$ git log --oneline
a1b2c3d Add configuration loader
9f8e7d6 Initial commit

git diff — see exactly what changed, before you commit it

$ git diff              # unstaged changes vs. the last commit
$ git diff --staged     # staged changes vs. the last commit

Reading your own diff before committing is one of the highest-value habits in this entire course — catching an accidental leftover debug line, or a change you didn't mean to include, BEFORE it becomes a permanent part of history.

Instructor Notes

Lesson goal: Convert Module 2's model into the six commands used in nearly every real Git session — this is the fluency floor for everything that follows in ROOT 03.

Approximate timing: 15 minutes read; 10 minutes live.

Common misconception to watch for: treating git add . as always safe — it stages EVERYTHING changed, including files you might not have intended to include; git status before git add . is the habit that prevents this.

Demo idea: run the full init→status→add→commit→log→diff sequence live, narrating git status's changing output at each step.