seed: curriculum content
This commit is contained in:
46
1.solar-system/1.welcome/03.first-repo/index.md
Normal file
46
1.solar-system/1.welcome/03.first-repo/index.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
type: battle
|
||||
title: "First Repo"
|
||||
xp: 200
|
||||
duration: 30
|
||||
difficulty: 1
|
||||
---
|
||||
|
||||
# First Repo
|
||||
|
||||
> **[INCOMING — Mission Control, Earth]**
|
||||
>
|
||||
> Cadets, your first paired exercise. One of you will set up a fresh
|
||||
> Git project; the other will verify it. Then swap.
|
||||
>
|
||||
> Pair up. Decide who goes first as **defender** and who goes first
|
||||
> as **attacker**.
|
||||
>
|
||||
> [END TRANSMISSION]
|
||||
|
||||
## The Task
|
||||
|
||||
The **defender** writes a single shell script — `setup.sh` — that,
|
||||
when run inside an empty workspace:
|
||||
|
||||
1. Initializes a fresh Git repo on branch `main`.
|
||||
2. Sets `user.name` and `user.email` on the repo.
|
||||
3. Creates a file called `hello-world.txt` containing exactly:
|
||||
```
|
||||
Hello, World
|
||||
```
|
||||
4. Stages and commits it with the message `add hello-world`.
|
||||
|
||||
## Battle Rules
|
||||
|
||||
- **Defender**: writes `setup.sh` in a clean workspace. Does not show
|
||||
the file until done.
|
||||
- **Attacker**: receives the script, runs it in a clean folder,
|
||||
inspects the resulting repo, and submits a review.
|
||||
- **Then swap**: roles flip; the new defender writes their own
|
||||
`setup.sh` (no copy-pasting).
|
||||
- Both pass the battle if both scripts pass review.
|
||||
|
||||
## Tools
|
||||
|
||||
`git init`, `git config`, `echo`, `>`, `git add`, `git commit -m`.
|
||||
38
1.solar-system/1.welcome/03.first-repo/review/general.md
Normal file
38
1.solar-system/1.welcome/03.first-repo/review/general.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# First Repo — Extended Notes
|
||||
|
||||
*Not rendered yet. For instructors and a future "learn more" surface.*
|
||||
|
||||
## Purpose
|
||||
|
||||
The first paired exercise of the program. Cadets have just finished
|
||||
the bash basics; this introduces them to the battle pattern (defender
|
||||
writes, attacker reviews, then swap) using a tiny but real Git
|
||||
workflow: init, commit, log.
|
||||
|
||||
## Skills Demonstrated
|
||||
|
||||
- Composing learned commands (`git init`, `git config`, `git add`,
|
||||
`git commit`) into a single script
|
||||
- Reading another cadet's script to verify behavior
|
||||
- Filling out the review checklist constructively
|
||||
|
||||
## Common Pitfalls
|
||||
|
||||
- **Skipping `git config`** — the commit either fails or uses a
|
||||
fallback identity that's not the cadet's. Reviewer should run
|
||||
`git config --local user.name` to confirm.
|
||||
- **Wrong file content** — `echo "hello world"` (lowercase) doesn't
|
||||
match `Hello, World`. Reviewer must `cat hello-world.txt` and check
|
||||
byte-for-byte.
|
||||
- **Wrong commit message** — `add hello world` (no dash) is *not*
|
||||
`add hello-world`. Reviewer should run `git log --format=%s`.
|
||||
- **Multiple commits** — sometimes a cadet stages files twice and
|
||||
ends up with two commits. The spec asks for exactly one.
|
||||
|
||||
## Discussion Prompts (post-battle)
|
||||
|
||||
After both rounds, pair discusses for 2–3 minutes:
|
||||
|
||||
1. Whose script was easier to read? Why?
|
||||
2. What did you check first when reviewing? Why?
|
||||
3. If this script ran on a server, what could go wrong?
|
||||
27
1.solar-system/1.welcome/03.first-repo/review/review.json
Normal file
27
1.solar-system/1.welcome/03.first-repo/review/review.json
Normal file
@@ -0,0 +1,27 @@
|
||||
[
|
||||
{
|
||||
"title": "Repo Setup",
|
||||
"icon": "ph:git-branch-duotone",
|
||||
"items": [
|
||||
".git/ exists after running setup.sh",
|
||||
"user.name is set on the repo",
|
||||
"user.email is set and looks like an email"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "File Content",
|
||||
"icon": "ph:file-text-duotone",
|
||||
"items": [
|
||||
"hello-world.txt exists at the repo root",
|
||||
"File contains exactly the line 'Hello, World'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Commit",
|
||||
"icon": "ph:git-commit-duotone",
|
||||
"items": [
|
||||
"Exactly one commit in git log",
|
||||
"Commit message is exactly 'add hello-world'"
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user