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]>
35 lines
2.1 KiB
JSON
35 lines
2.1 KiB
JSON
{
|
|
"id": "git-everyday-basics",
|
|
"title": "Init, Track, Commit — Your First Real Repository",
|
|
"category": "Git",
|
|
"isolation_type": "shared_namespace",
|
|
"difficulty": "Easy",
|
|
"type": "task",
|
|
"weight": 4,
|
|
"description": "## Init, Track, Commit — Your First Real Repository\n\n**Your task**, inside `/srv/git-lab-everyday/`:\n\n1. Initialize a new Git repository\n2. Create a file named `notes.txt` containing any text you like\n3. Stage and commit it, with a commit message that includes the word `notes`\n4. Confirm your work with `git log` and `git status`",
|
|
"hints": [
|
|
{
|
|
"title": "The full sequence",
|
|
"body": "`git init` creates the repository. `git add` stages a file (moves it from working tree to staging area). `git commit` records the staged snapshot permanently.",
|
|
"command": "cd /srv/git-lab-everyday\ngit init\necho 'my first notes' > notes.txt\ngit add notes.txt\ngit commit -m 'Add notes file'"
|
|
}
|
|
],
|
|
"setup_commands": [
|
|
{ "command": "mkdir -p /srv/git-lab-everyday" },
|
|
{ "command": "git config --global user.email [email protected]" },
|
|
{ "command": "git config --global user.name 'RootNode Student'" }
|
|
],
|
|
"validation": {
|
|
"commands": [
|
|
{ "description": "a real Git repository was initialized", "command": "git -C /srv/git-lab-everyday rev-parse --is-inside-work-tree 2>/dev/null", "expected_output": "true", "match": "exact" },
|
|
{ "description": "at least one commit exists", "command": "git -C /srv/git-lab-everyday log --oneline 2>/dev/null | wc -l | tr -d ' '", "expected_output": "^[1-9][0-9]*$", "match": "regex" },
|
|
{ "description": "notes.txt is tracked in the latest commit", "command": "git -C /srv/git-lab-everyday show --name-only --format= HEAD 2>/dev/null", "expected_output": "notes.txt", "match": "exact" },
|
|
{ "description": "the commit message mentions notes", "command": "git -C /srv/git-lab-everyday log -1 --pretty=%s 2>/dev/null", "expected_output": "notes", "match": "contains" }
|
|
]
|
|
},
|
|
"default_namespace": "default",
|
|
"teardown_commands": [
|
|
{ "command": "rm -rf /srv/git-lab-everyday" }
|
|
]
|
|
}
|