Files
rootnode-academy/scenarios/data/git-remote-clone-push.json
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

36 lines
2.3 KiB
JSON

{
"id": "git-remote-clone-push",
"title": "Clone, Commit, and Push to a Real Remote",
"category": "Git",
"isolation_type": "shared_namespace",
"difficulty": "Medium",
"type": "task",
"weight": 5,
"description": "## Clone, Commit, and Push to a Real Remote\n\nA bare Git repository already exists at `/srv/git-lab-remote.git` — this plays the role of a real remote (like Gitea or GitHub) without needing any account or network access. It is currently empty.\n\n**Your task:**\n\n1. Clone it to `/srv/git-lab-clone`\n2. Inside the clone, create a file `README.md` with any content\n3. Add and commit it\n4. Push your commit back to the remote (`origin`)",
"hints": [
{
"title": "The full sequence",
"body": "`git clone` copies a remote repository (bare or not) into a new working directory, automatically configuring it as `origin`. `git push origin main` sends your local commits back to it.",
"command": "git clone /srv/git-lab-remote.git /srv/git-lab-clone\ncd /srv/git-lab-clone\necho '# My Project' > README.md\ngit add README.md\ngit commit -m 'Add README'\ngit push origin main"
}
],
"setup_commands": [
{ "command": "git config --global init.defaultBranch main" },
{ "command": "git config --global user.email [email protected]" },
{ "command": "git config --global user.name 'RootNode Student'" },
{ "command": "rm -rf /srv/git-lab-remote.git /srv/git-lab-clone" },
{ "command": "git init -q --bare /srv/git-lab-remote.git" }
],
"validation": {
"commands": [
{ "description": "the clone has origin configured pointing at the remote", "command": "git -C /srv/git-lab-clone remote get-url origin 2>/dev/null", "expected_output": "/srv/git-lab-remote.git", "match": "exact" },
{ "description": "the commit actually reached the remote (not just the local clone)", "command": "git --git-dir=/srv/git-lab-remote.git log --oneline 2>/dev/null | wc -l | tr -d ' '", "expected_output": "^[1-9][0-9]*$", "match": "regex" },
{ "description": "README.md is part of what was pushed", "command": "git --git-dir=/srv/git-lab-remote.git show --name-only --format= HEAD 2>/dev/null", "expected_output": "README.md", "match": "exact" }
]
},
"default_namespace": "default",
"teardown_commands": [
{ "command": "rm -rf /srv/git-lab-remote.git /srv/git-lab-clone" }
]
}