arrow keys · F fullscreen · P read as page
COSC 10001 · Week 4 · Wed, Sep 16, 2026

Your Terminal,
Git & GitHub

Where your files actually live, and how to undo anything

You have read this before

Two ways to
say one thing

You met this three weeks ago, about one checkbox in IntelliJ. Today it is the whole hour.

The same computer, two doors
Look inside a windowls
Double-click a foldercd karel-starter
Click the back arrowcd ..
Read the title bar: where am I?pwd
Double-click a fileopen · start
Open this folder in a windowopen . · explorer .

The bridge goes both ways. You are not leaving the Finder behind.

Convenient depends on how many times

A hundred files

macOS

mkdir ~/Desktop/scratch
cd ~/Desktop/scratch

for i in {1..100}; do
  touch "student_$i.txt"
done

Windows

1..100 | ForEach-Object {
  New-Item "student_$_.txt" -ItemType File
}

Now do that with the mouse. I will wait.

The one place this really is dangerous

Do not try
this at home

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.

Why bother, if the mouse is easier?
  1. A GUI is a menu somebody else wrote. Every button exists because a person decided to build that button.
  2. Next Wednesday you hand work to an agent, and it has no hand. Everything it does, it does here.

Two ways in. Today we learn the one you do not have yet.

Big idea 1

A filesystem
is a tree

/
└── Users
    └── you
        ├── Desktop
        │   └── karel-starter        ← you are here
        │       ├── MyKarel.java
        │       ├── lib/karel.jar
        │       └── worlds/
        ├── Downloads
        └── Documents
The three ideas · the commands are googleable
  1. A filesystem is a tree. The icons are a costume over it.
  2. You are always standing somewhere in that tree. pwd asks where, cd walks, ls looks around.
  3. "command not found" does not mean the program is missing. It means the computer does not know where to look. That is PATH.
Run Karel from the terminal

macOS

javac -cp lib/karel.jar MyKarel.java
java -cp ".:lib/karel.jar" MyKarel

Windows

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.

Big idea 2 · everybody has this folder
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.

And here is the version you already know

Git is save points

Saving before the boss fightgit commit
Naming the savethe commit message
Your list of savesgit log
Load the last savegit restore .
Cloud saves, on somebody else's machineGitHub

Nobody is frightened of dying in a game. You saved. No version control is a roguelike: one run, no saves, good luck.

One difference, and Git wins

The failed run
stays in the log

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.

Three things to hold onto
  1. A commit is a save point with a note attached. You can always go back to one.
  2. The history is a story.
  3. GitHub is not Git. Git runs on your laptop. GitHub is a website that holds copies. Either one works without the other.
Break it on purpose, then undo it
# 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.

Your Karel repo, start to finish

The whole thing,
once

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.

Before you leave the room

Post two links
in Slack

Two of your five Professional Foundations boxes, collected today.

Where to look things up

When you forget
one of these

Ninety seconds, then go

Ship-It

20% 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.