The Problem...


https://www.youtube.com/watch?v=Bqx6li5dbEY&t=9s

You have probably made a folder that looks like this:

  essay.docx
  essay_final.docx
  essay_final_FINAL.docx
  essay_final_FINAL_v2.docx
  essay_final_FINAL_v2_actually_final.docx
				

This is manual version control. It works (barely) for a single document. For code, it breaks immediately:


Git solves all of this. It tracks every change you tell it to track, stores a complete snapshot of your project at each point, and lets you move back to any of those points at any time.
The FINAL_v2 folder problem is universal — everyone has done it. The key pain points: (1) no way to compare versions, (2) no clear history, (3) no safety net. Git addresses all three.

What Git Is (and Is Not)

Git is a version control system. It tracks changes to files over time. Every time you take a "snapshot" — called a commit — Git records exactly what your project looked like at that moment, plus a short message from you describing what you did.


Think of it as a timeline of your project:

  [start] ──── [added HTML structure] ──── [added CSS] ──── [added animation] ──── [now]
		

You can jump back to any point on that timeline. You can see exactly what changed between any two points. You can compare what AI gave you to what you kept.

The Dropbox distinction is important — students often assume git is automatic like cloud sync. It is always intentional. The "not a tool for catching students" point is worth saying out loud.

The Basic Workflow

Every project needs a one-time setup:


Initialize Repository (git init)
You tell Git: "start tracking this folder."

A repository (or "repo") is your project folder plus a hidden .git folder where Git keeps the full history: every snapshot, every message, every change. Initializing creates that hidden folder. Your files stay exactly as they are, and the history lives on your computer.

After that, every commit follows the same three-step cycle, whether you do it in the terminal or in VS Code:


1. Stage — choose which changes to include
You tell Git: "these are the changes I want in this snapshot."

2. Commit — save the snapshot with a message
You tell Git: "save this. Here is what it represents."

3. Push (optional, later) — send the commit to a remote copy such as GitHub
You tell Git: "put a copy over there so it's backed up and shareable."

You don't have to push at all. Commits accumulate locally, and you push when you want a backup or want to share. A remote can be GitHub, GitLab, Bitbucket, or a server you run yourself.


  Your computer ──── (push) ────► Remote (e.g. GitHub)
       ▲
       │ commit (local)
       │
  Your editor
		
Initialize happens once per project. If a student asks where the history is stored, it is the hidden .git folder inside the project folder; deleting it deletes the history. The staging step trips students up. The clearest analogy: staging is like packing a box before you seal it. You choose what goes in, then you seal (commit), then you ship (push).

Using Git in VS Code

VS Code has a built-in Git panel. You'll do most of your Git work here — no terminal commands needed.


How to find it:
Click the Source Control icon in the left sidebar (it looks like a branching diagram), or press Ctrl+Shift+G.


The three steps in VS Code:

  1. Stage — Changed files appear in the Source Control panel. Click the + button next to a file to stage it, or click Stage All Changes to stage everything.

  2. Commit — Type your commit message in the text box at the top, then click the Commit button (or press Cmd+Enter).

  3. Push — After you commit, the blue Commit button turns into Sync Changes. Click it to push to GitHub. You can also click the circular arrows icon next to your repository name, or the circular arrows in the bottom status bar.


Copilot can also run git commands for you. In Agent mode, you can ask: "Initialize a git repository in this folder and make an initial commit." Copilot will run the terminal commands. You should still know what it did and why.
Most students will use VS Code's Source Control panel. The terminal is important to know conceptually, but the GUI is fine for daily work. Copilot in Agent mode can also run git commands — which is great, as long as students understand what it ran.

One-Time Setup: Tell Git Who You Are

Git stamps every commit with a name and an email address. A new computer does not have them yet, so your very first commit may fail with a message asking you to say who you are. Do this once, before your first commit.


  1. In VS Code, open Terminal → New Terminal.
  2. Type each line below with your own name and email. Press Enter after each one.
git config --global user.name "Jane Doe"
git config --global user.email "jane@example.com"

  1. Go back to Source Control and click Commit.
  2. To check it worked, type git config --global --list.

Watch out for:
1. Quotes. Keep the quotation marks around your name, especially if it has a space.
2. Your email goes public once you publish. For GitHub, use the private "noreply" address: GitHub → Settings → Emails.
3. Shared computers. If you share one login, leave out --global and type the lines in a terminal opened inside your own project folder, after you initialize it.
This is needed once per computer, so it is easy to forget because the instructor's machine already has it set. If students skip it, the first commit fails or a popup appears, and VS Code has no settings screen to fix it, so the terminal is the quickest route. The email does not go anywhere until a student publishes to GitHub, and then it appears on every public commit, which is why the noreply address is the safer choice. GitHub Desktop would also ask for these during its own setup, but it is a bigger install than two typed lines.

Demo: The Starting Point

We start in VS Code with a new folder containing one file, the dictionary, and no repository yet. The third icon in the left bar is Source Control. Opening it shows two buttons that do very different things.



1. The folder in the Explorer, Source Control icon in the left bar

2. Initialize Repository and Publish to GitHub

Initialize Repository = git init. Local only, no account, no internet. Publish to GitHub also creates a copy on your GitHub account. In this demo we click Initialize Repository and keep everything on this computer.
Students often think Publish to GitHub is required to start. It is not. Initialize Repository is the only required first step. Everything in this demo stays local.

Demo: Stage the File

After initializing, the file shows up under Changes with a U (untracked). Git sees it but is not tracking it yet. Staging chooses what goes into the next snapshot.



3. Hover over a file and click + (Stage Changes)

4. The file moves to Staged Changes, badge changes from U to A

Look at the branch name at the bottom left. main* means there are uncommitted changes. main+ means something is staged and ready.
Point at the badge change: U (untracked) becomes A (added to the next commit). The + button next to a file stages only that file, which is the whole point of staging.

Demo: First Commit

Type a message in the box above the file list. VS Code opens a small message editor tab. Click the small Commit button to save the snapshot.



5. Write the commit message and click Commit

6. The Graph now shows the first commit, labeled main

The panel now offers Publish Branch instead of Sync. That is because this repository has no copy on GitHub. Everything so far lives only on this computer.
Show the Graph section. Each dot is a commit, and the label main marks where the branch currently points. Publish Branch appearing is a good moment to remind students that local and GitHub are separate.

Demo: Edit, Read the Diff, Commit Again

Edit the dictionary file and save. It reappears under Changes with an M (modified). Click it to see a side by side comparison: red is removed, green is added.



7. The diff: red lines removed, green lines added

8. Stage, commit with a message, and the Graph shows two commits

Write a message that says what changed and why, for example: Added animals to empty category.
Reading the diff before committing is a habit worth building. The message should make sense to someone who has not seen the file.

Demo: Order 1

Order 1 arrives as a new file, order1.txt, marked U. Following it means removing all animals living in water from the dictionary. Both files now show as changed.



9. order1.txt appears as a new file

10. Both files staged, ready to commit

Stage both files and commit with a message such as Removed all animals living in water from dictionary.
Order files are part of the repository too, so they are committed alongside the change they caused.

Demo: Order 2

Order 2 (order2.txt) asks for a new category at the end of the list for the water animals. The animals were removed in Order 1, so they are no longer in the current file. But Git still has every earlier version of the file. Open an older version from the past, copy the animals from it, then return to the current file and paste them into the new category. Nothing has to be remembered or retyped.



11. The new category, filled with animals copied from a past version of the file

12. Four commits in the Graph

The animals in the new category come from a past file, not from memory. Stage the file and commit with a message such as Created a new category for animals living in water. The Graph now shows four commits, and the history keeps both the removal and the return of the water animals.
The point of this step: history is not only for undoing. Old versions of a file stay readable, so you can open one, copy from it, and bring that content into the present. Students do this themselves in the lab by clicking a commit in the Graph and opening the file as it was then. Then let students read the Graph from bottom to top as a story.

Demo: Order 3 Chage of mind

Order 3 (order3.txt) says the water category was a mistake and the dictionary should return to how it was right after Order 1. We must find that commit. Click a commit in the Graph and then a file under it to see exactly what it changed.



13. order3.txt arrives

14. Open the dictionary file under the Order 1 commit to see its diff

The goal is not to delete the category by hand. The goal is to travel back to the moment right after Order 1 was carried out.
The commit messages are what make this search possible. This is the payoff for writing them well.

Demo: Going Back in Time

Right-click the Order 1 commit in the Graph and choose Checkout (Detached). VS Code now shows the folder exactly as it was at that moment.



15. Right-click a commit, choose Checkout (Detached)

16. A commit id replaces main, and the category is gone

The branch name main is replaced by a commit id. This is called a detached HEAD. You are looking at the past, and nothing has been lost.
Reassure students: the later commits still exist. Detached means we are viewing an old snapshot rather than standing on the branch. If anyone wants to keep work from here, create a branch first.

Demo: Looking Around in the Past

Check the Explorer. Files that did not exist yet are gone, such as order2.txt. The untracked order3.txt stays, because Git never tracked it.



17. Explorer in the past: order2.txt is gone

18. With order3.txt moved aside, the asterisk is gone

The asterisk next to the commit id means an untracked or changed file is present. Once it is moved away, the working folder is clean.
This is the point where students see that Git rewrites the folder for them. The present is not gone, it is just not checked out.

Demo: Back to the Present

Click the commit id in the status bar. A picker opens with options to create a branch or check out something else. Choose main to return to the latest commit.



Everything returns: the water category, order2.txt, and all four commits.
How Order 3 is finally carried out (viewing only, branching from the old commit, or reverting) is decided live in class.

Key Vocabulary

You don't need to memorize commands right now. You do need to know these words — because Copilot, GitHub, and every tutorial you find will use them.


WORKING DIR your edited files not yet in git STAGING AREA selected changes ready to commit LOCAL REPO commits + branches on your computer REMOTE GitHub online backup git add git commit git push git pull repository — lives on your computer on the internet
Term What it means
repository (repo) A folder that Git is tracking. Your project folder, once you've initialized Git in it.
commit A saved snapshot. One point on the timeline. Includes all your files at that moment, plus a message you write.
staging / stage Choosing which changes to include in the next commit. Like deciding what goes in the photo before you take it.
remote A copy of your repo stored somewhere else — usually GitHub. Your local repo and the remote stay in sync when you push/pull.
push / pull Push = send your commits to GitHub. Pull = get changes from GitHub onto your computer.
branch A parallel version of your project. You won't use branches much in this course, but you'll see the word constantly.
merge Combining two branches. Also something you'll see but won't need much.
Students can look up commands easily. What they need to internalize are the nouns — repo, commit, remote, branch — because those words will appear everywhere and cause confusion if they don't know them.

Git Commands on the Terminal

You'll mostly use Copilot or VS Code's Source Control panel rather than typing these. But you need to know what each command does — so that when Copilot uses one, you know what happened.


Command What it does
git init Start tracking the current folder. Creates a hidden .git/ folder inside it. Do this once per project.
git status Show what has changed since the last commit. What's new, what's modified, what's staged. Run this constantly.
git add . Stage everything that has changed. The . means "all files." You can also stage specific files: git add index.html
git commit -m "message" Save the staged changes as a commit. The -m flag lets you write the message inline.
git push Send your local commits to GitHub (or another remote). The first time you push a new project, it may ask you to set up the remote first.
git log Show the history of all commits — most recent first. Each entry shows the message, author, date, and hash.
git diff Show exactly what changed since the last commit — line by line. Green = added, red = removed.
Students don't need to type these from memory. The goal is recognition — when VS Code's Source Control panel does something, or when Copilot uses one of these in a terminal command, students should be able to say "I know what that is." git status is the one to emphasize: run it constantly.

Going Back: Returning to an Earlier State

Because every commit is a complete snapshot, you can return to any point in your history at any time. This is one of the most useful things Git does — and one of the main reasons to commit often.


A realistic scenario:
Your three.js scene is working. You ask Copilot to add a shader effect — it commits that. You then try to adjust it yourself. Now nothing renders. You have no idea what broke. Without Git, you'd be stuck. With Git, you go back to the last commit where the scene worked and start the shader attempt fresh.

set up scene add geometry add color ✓ scene works Copilot: shader HEAD nothing renders git checkout <hash> returns you to this exact snapshot go back to here

How to do it in VS Code:

  1. Open the Source Control panel → click History to see all commits
  2. Or use the Timeline panel at the bottom of the Explorer sidebar
  3. Right-click any commit → Checkout…, then choose Checkout detached in the box that opens at the top

Terminal reference:
git log --oneline — see all commits and their short hashes
git checkout a3f7c29 — go back to that snapshot (read-only; your other commits are still there)
git checkout main — return to the present

Git has several ways to undo things (checkout, revert, reset) with different tradeoffs. As a beginner, ask Copilot which to use for your specific situation before running anything.
Ask:
"I want to go back to a previous commit to see how my code looked then, without losing my recent commits. What is the safest way to do this in git?"
Going back is one of the most motivating demonstrations of why students should commit often — it only works if there are commits to go back to. Detached HEAD state will confuse students; the practical answer is always "ask Copilot which command is right for this situation." The key concept: your history is never destroyed by going back — you can always return to the present with git checkout main.

Git Isn't Just for Code

Git works on any plain text file — not just HTML, CSS, and JavaScript. If you're writing a thesis, a long essay, or any document where you make significant revisions over time, Git can track that too.


What this looks like for a thesis:
  "first full draft of chapter 2"
  "restructure argument — moved section 3 before section 2"
  "advisor feedback incorporated — introduction rewritten"
  "cut 800 words from lit review per advisor note"
  "final proofread pass"
		    
Each commit is a named checkpoint. You can go back to any earlier draft at any time. You can see exactly what changed between drafts. If you decide the restructure was wrong, you can recover the original.

The one constraint: Git works best with plain text files — .md, .txt, .html. It can track Word documents (.docx), but it can't show you a readable diff of what changed inside them. For a thesis, writing in Markdown or plain text and converting to a final format at the end is a workflow many writers use for exactly this reason.


GitHub even renders Markdown files directly — so a thesis tracked in Git and pushed to GitHub is readable in a browser, with a full revision history anyone can browse.
This slide is worth a brief mention for students who are writing a thesis or long paper alongside the course. The argument: the habits you're building for code — commit often, write descriptive messages, use history to recover — transfer directly to any long-form writing project. The plain text constraint is real but easy to work around with Markdown.

Walkthrough — Git with a Text File, Step by Step

Every step below uses the same commands you would use with code. The example is a short artist statement being written and revised. Follow along — the file is called statement.txt.


1 — Start tracking the folder

  $ git init
  Initialized empty Git repository in /artist-statement/.git/
		

2 — Write a first paragraph. Stage it. Commit it.

statement.txt

My work explores the relationship between memory and place.
I collect fragments — receipts, photographs, recorded voicemail —
and reassemble them into structures that resist easy narrative.
  $ git add statement.txt
  $ git commit -m "first paragraph — memory and place"
		

git add is required here because statement.txt is a brand new file — git has never seen it before and won't track it automatically. Once a file has been added, you don't need to git add it again for future changes.


3 — Write a second paragraph. Commit again.

statement.txt

My work explores the relationship between memory and place.
I collect fragments — receipts, photographs, recorded voicemail —
and reassemble them into structures that resist easy narrative.

The browser is my primary medium. I am drawn to the web because
it is simultaneously public and intimate, permanent and ephemeral.
  $ git commit -am "add second paragraph — browser as medium"
		

The -a flag stages all changes to already-tracked files automatically. No separate git add needed.


4 — Try a different direction. Rewrite paragraph 1. Commit that too.

statement.txt

My work is interested in systems that forget. GPS coordinates
that drift. Timestamps that contradict. I build things that
fail in precise ways.

The browser is my primary medium. I am drawn to the web because
it is simultaneously public and intimate, permanent and ephemeral.
  $ git commit -am "rewrite paragraph 1 — shift to systems that forget"
		
Three ways to stage — same result, different control:

git add statement.txt  — stage one specific file. Required the first time a new file is added.

git add .  — stage everything that has changed. Useful when you have multiple files and want to commit all of them.

git commit -am "message"  — skip the staging step entirely for already-tracked files. Fastest option for a single ongoing file.

5 — Look at your history

  $ git log --oneline

  a3f7c29  rewrite paragraph 1 — shift to systems that forget
  8b1d4a1  add second paragraph — browser as medium
  f2c3d11  first paragraph — memory and place
		

Three snapshots. Each one a decision.


6 — See exactly what changed in the last commit

  $ git diff HEAD~1

  - My work explores the relationship between memory and place.
  - I collect fragments — receipts, photographs, recorded voicemail —
  - and reassemble them into structures that resist easy narrative.
  + My work is interested in systems that forget. GPS coordinates
  + that drift. Timestamps that contradict. I build things that
  + fail in precise ways.
		

Lines beginning with - were removed. Lines beginning with + were added. HEAD~1 means "the commit just before the current one."


7 — The rewrite isn't working. Go back to the previous version.

You want to return to the state after Step 3 — both paragraphs, original first paragraph. Copy the hash from git log:

  $ git checkout 8b1d4a1
		

statement.txt now reads:

My work explores the relationship between memory and place.
I collect fragments — receipts, photographs, recorded voicemail —
and reassemble them into structures that resist easy narrative.

The browser is my primary medium. I am drawn to the web because
it is simultaneously public and intimate, permanent and ephemeral.

The rewrite commit still exists in the history — nothing was deleted.


8 — Come back to the present

  $ git checkout main
		

You are back at the most recent commit. All three commits are intact. You can go back and forward as many times as you like.


9 — Push to GitHub

All of the above happened locally — only on your computer. To send your commits to GitHub, you push. The first time, you need to tell git where to send them:

  $ git remote add origin https://github.com/yourname/artist-statement.git
  $ git push -u origin main
		

After that first setup, every subsequent push is just:

  $ git push
		

In VS Code, the first push appears as a Publish Branch button in the Source Control panel — it handles the setup automatically.

The point: Git didn't protect you from making a bad revision — it protected you from being stuck with it. Push gets that history off your machine and onto GitHub — backed up, shareable, and visible as a portfolio of your process.
Walk through this live in class with a plain text file open in VS Code. Key moments to pause: after git log (have students read the three commit messages aloud — does the history tell the story?), after git diff (the +/- format is unfamiliar but immediately readable once you see it), and after git checkout (show that the file literally changes in the editor window). The return to main reassures students that going back is always reversible.

Lab: Initialize and Make Your First Commits

  1. If it's your dirst time using Git on this computer, tell Git who you are.
    Open Terminal → New Terminal in VS Code and type these two lines, with your own name and email. Press Enter after each one. You need both.
    git config --global user.name "Jane Doe"
    git config --global user.email "jane@example.com"
    Check that both saved with git config --global --list. You only do this once per computer.

  2. Set it up:
    Open a folder in VS Code. Put existing text/html/css/js files that you have from past project into the folder. Use the Source Control panel (or Copilot in Agent mode) to initialize a git repo in that folder. Make an initial commit with the message: initial commit — starting file

  3. Make 2 more meaningful commits:
    Make a intentional/noticeable change to your files. Stage and commit it with a message that describes the decision. Repeat once more. You should have 3 commits total.

  4. Look at your history:
    In the Source Control panel, open the Timeline. Read your own commits back.

  5. Optional — push to GitHub:
    Create a repository on github.com and push your project. Ask Copilot to walk you through the steps if you haven't done this before.

You're done when: you have at least 3 commits with commit messages that describe your change decisions.
The lab is intentionally simple — the goal is the habit, not the complexity. Students who have 3 descriptive commits have internalized the core idea. GitHub push is optional here; it becomes required for Phase 2 submissions.