Where your files actually live, and how to undo anything
You met this three weeks ago, about one checkbox in IntelliJ. Today it is the whole hour.
| Look inside a window | ls |
| Double-click a folder | cd karel-starter |
| Click the back arrow | cd .. |
| Read the title bar: where am I? | pwd |
| Double-click a file | open · start |
| Open this folder in a window | open . · explorer . |
The bridge goes both ways. You are not leaving the Finder behind.
mkdir ~/Desktop/scratch cd ~/Desktop/scratch for i in {1..100}; do touch "student_$i.txt" done
1..100 | ForEach-Object {
New-Item "student_$_.txt" -ItemType File
}
Now do that with the mouse. I will wait.
rm -rf /deletes everything. no trash, no undo, no "are you sure?"
In 1998 somebody at Pixar ran this on the wrong folder and deleted most of Toy Story 2. It survived because a technical director working from home with a newborn happened to have a copy of the whole film.
That copy was their version control.
In six minutes you get a much better one.
Two ways in. Today we learn the one you do not have yet.
/
└── Users
└── you
├── Desktop
│ └── karel-starter ← you are here
│ ├── MyKarel.java
│ ├── lib/karel.jar
│ └── worlds/
├── Downloads
└── Documents
javac -cp lib/karel.jar MyKarel.java
java -cp ".:lib/karel.jar" MyKarel
javac -cp lib/karel.jar MyKarel.java
java -cp ".;lib/karel.jar" MyKarel
One character apart. Colon on macOS, semicolon on Windows. Copy the side that is yours.
essay_final.docx essay_final_v2.docx essay_final_REAL.docx essay_final_REAL_usethisone.docx
That is version control, done badly, by hand. Git is that, done properly, by a computer.
| Saving before the boss fight | git commit |
| Naming the save | the commit message |
| Your list of saves | git log |
| Load the last save | git restore . |
| Cloud saves, on somebody else's machine | GitHub |
Nobody is frightened of dying in a game. You saved. No version control is a roguelike: one run, no saves, good luck.
Reload a save and the game forgets you died. Git keeps every attempt, including the ones that did not work.
Which is why you got to watch me change my mind about your homework.
And why I cannot quietly delete the evidence.
# what did I just break? git diff # and here is it never having happened git restore .
Not backups. The ability to try something, watch it fail, and get back to working in one command.
git init git add . git commit -m "Karel reaches the beeper" # make the empty repo on github.com first. # Public, and do NOT tick "Add a README" git remote add origin https://github.com/USERNAME/karel-starter.git git push -u origin main
After the first push it is add → commit → push, forever.
⭐ This is the slide to come back to. Build Checkpoint 1 is this repo.
Two of your five Professional Foundations boxes, collected today.
git config lines20% of your grade. Due Sun, Dec 6. Demo Day is Wed, Dec 9. The menu and the rubric are on the course site.
A tiny thing that works beats an ambitious thing that doesn't.
Do not start this in November.