Back to PIT Home

Heads-up — AI-assisted content: The formatting and some of the written content on this page were drafted with the help of an AI assistant. The material has been reviewed by Mr. Johnston and is presented in good faith, but specific steps (especially Gitea menus, Git Bash output, and exact UI labels) may differ slightly from what you see on your actual machine. Because you've been given this notice, you are expected to flag any irregularities you encounter — bring the exact wording, screenshot, or error text to class so we can correct the page. Reporting a mismatch is full credit; following a wrong step silently is not.

Gitea Workflow: Peer Review, Iteration & Git History Surgery

Follow-up to the Pro Local Dev practicum — publish to the classroom Gitea server, iterate on real peer feedback, then practice the three Git operations that save professional developers from disaster: discard, revert, and cherry-pick. · Two 180-minute classes (360 min total) — due at the end of Class 2

Fun fact: The Gitea server, the public nginx file viewer, and everything else on the classroom network are running on a single Raspberry Pi sitting on Mr. Johnston's desk. No cloud, no AWS, no Microsoft — just a credit-card-sized computer and good open-source software. Our district network blocks GitHub, so we host our own. That is a real, paid skill.

What You'll Do Today

Today you build on every Git skill from the Pro Local Dev practicum, then add four new ones that professional teams use constantly: publishing to a remote, iterating on peer feedback, discarding unwanted changes, and surgically editing your project's history with git revert and git cherry-pick.

Learning Objectives

  • 1. Create a Gitea account and a public repo named my_first_repo_lastname.
  • 2. Build a small HTML / CSS / JS splash page (AI assistance permitted).
  • 3. Push the page to the classroom Gitea server and view it live on a public URL.
  • 4. Exchange peer feedback with another student and use that feedback to drive a real iteration loop, committing each change you like.
  • 5. Practice discarding uncommitted changes you don't want (git restore).
  • 6. Practice rolling back a specific past commit (git revert) and rebuilding a project from chosen commits (git cherry-pick).
  • 7. Submit a deliverable with screenshots, peer-feedback notes, and a written reflection.

Pacing — Two Class Meetings, 360 Minutes Total

You have two full 180-minute class periods to complete this project. The deliverable is due at the end of Class 2. The blocks below are guideposts, not stopwatches — you'll have time to think, experiment, and revisit anything that didn't click the first time. If you finish a block early, use the extra minutes to polish your splash page, give better feedback, or start the Day 2 work early.

Class 1 — 180 minutes (Building, Publishing, Peer Review)

  • Block 0 — Warm-Up: What Did You Already Learn? ~15 min
  • Block 1 — Tour the Server, Make Your Account & Repo ~25 min
  • Block 2 — Build & Push Your Splash Page ~60 min
  • Block 3 — Peer Review & First Iteration Loop ~60 min
  • Class 1 Wrap-Up — Commit-message audit & what to expect Day 2 ~20 min

Class 2 — 180 minutes (History Surgery, Experimentation, Submit)

  • Block 4 — Discard Uncommitted Changes ~35 min
  • Block 5 — History Surgery: Revert & Cherry-Pick ~60 min
  • Block 6 — Open Experimentation Lab (choose your own) ~45 min
  • Block 7 — Deliverable Assembly & Final Reflection ~40 min

Class 1 — Day 1 (180 minutes)

Building, publishing, and the first round of peer feedback. By the end of today, your splash page is live and you've already iterated on it once.

Block 0 — Warm-Up: What Did You Already Learn?~15 min

Here's What In the Pro Local Dev practicum you set up Python locally, imported a CMU Graphics program, and used git init, git add, git commit, and git log to take snapshots of your work. That was Git running entirely on your machine.
So What If a tool sits unused for a week or two it disappears from your hands. Walking back through what a commit, staging area, and repository are at the start of this class is what makes today's harder concepts (push, revert, cherry-pick) actually stick.
Now What Open a blank document (Word, Google Doc, or a new REFLECTION.md in VS Code) and write the short prompt below. This becomes the first section of your deliverable PDF.
Warm-up reflection (3–5 sentences each, full credit if honest):
  1. In your own words: what is a Git commit? Pretend you're explaining it to a freshman who has never opened VS Code.
  2. Why is committing better than just saving the file? Give one reason that has nothing to do with "in case the file gets deleted."
  3. What was the most confusing thing about Git from the last lesson? Be specific — this is the thing today's class needs to clear up for you.
Quick Review MCQ

A classmate says: "Every time I press Ctrl+S in VS Code, Git takes a new snapshot of my file." Which best corrects them?

1 Block 1 — Tour the Server, Make Your Account & Repo~25 min

Here's What Gitea is a self-hosted Git server — like a tiny private GitHub running on the classroom Pi. You'll register an account, then create a remote repository: a copy of your project that lives on the server instead of on your laptop.
So What Every professional team puts their code on a remote so multiple people can collaborate, see each other's history, and not lose work when a laptop dies. The terms local (your machine) and remote (the server) are the vocabulary of every coding job interview.
Now What Make the account and the repo. Keep the username and the exact repo URL handy — you'll need both in Block 2.

Step 1.1 — Register on the classroom Gitea

  1. Open a browser to http://10.12.6.236:3000/.
  2. Click Register.
  3. Use a username you'd be okay seeing in a URL (it'll appear in your repo's public address).
  4. Use your school email so password resets work.
  5. Sign in.
The server only answers on the classroom network. If you try this on cellular data or off-campus, the page won't load. That's not a bug — self-hosted services live where the hardware lives, and our district network still blocks GitHub.

Step 1.2 — Create a public repository

  1. In Gitea, click the + in the top-right → New Repository.
  2. Name it exactly: my_first_repo_lastname (use your real last name, lowercase, no spaces, e.g. my_first_repo_johnston).
  3. Set Visibility to Public. Public is required so the nginx server can serve your page on the web.
  4. Leave Initialize Repository unchecked.
  5. Click Create Repository.

Gitea will show a "quick setup" page with a clone URL that looks like:

http://10.12.6.236:3000/your-username/my_first_repo_lastname.git

Copy that URL.

Checkpoint screenshot #1: Your Gitea repo page showing the repo name and the Public badge. Save this for your deliverable.
Practice MCQ

In Git vocabulary, what is the difference between a local repository and a remote repository?

Practice MCQ

Why does this lesson require the repository to be marked Public?

2 Block 2 — Build & Push Your Splash Page~60 min

Here's What You'll clone the empty repo, build a simple HTML + CSS + JS splash page (AI is allowed, and in fact encouraged for the first draft), commit it, and push it. The new Git command today is git push — it sends your local commits up to the remote.
So What Push is what turns "I have code on my laptop" into "the world can see this." It's also the moment your mistakes go public, which is why we'll be deliberate about what we push.
Now What Build something you'd actually want a stranger to see on the school network — a clean splash page about you, your projects, or a topic you care about.

Step 2.1 — Clone the empty remote

DO NOT clone into a OneDrive folder. OneDrive rewrites files in the background and corrupts Git's .git directory. Use a folder that is NOT synced to OneDrive (e.g. C:\Users\you\pit-projects).
  1. Open Git Bash.
  2. Move to (or create) a non-OneDrive folder:
    mkdir -p /c/Users/$USER/pit-projects
    cd /c/Users/$USER/pit-projects
    pwd
    The path you print should not contain the word "OneDrive." If it does, raise your hand.
  3. Clone the empty remote (replace your username and last name):
    git clone http://10.12.6.236:3000/your-username/my_first_repo_lastname.git
    cd my_first_repo_lastname
  4. Confirm the remote is wired up:
    git remote -v
    You should see origin pointing at the Pi.

Step 2.2 — Configure your Git identity (if you haven't already)

If you already did this in the Pro Local Dev practicum on this same machine, skip this step. Otherwise:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Use the same email as your Gitea account so commits get linked to your profile.

Step 2.3 — Build a splash page (HTML + CSS + JS)

Open the folder in VS Code:

code .

Create a file named exactly index.html. You may use the AI of your choice (ChatGPT, Claude, Gemini, Copilot) for the first draft. A starter prompt:

Generate a single-file index.html for a personal splash page.
Requirements:
  - My name as a big heading
  - A short bio paragraph (2-3 sentences)
  - A list of 3 things I'm working on this semester
  - Inline <style> with a clean color scheme (no external CSS)
  - Inline <script> that does ONE small thing on load
    (e.g. shows the current date, or a friendly console.log greeting)
  - No external scripts, no tracker pixels, no analytics

Paste the generated HTML into index.html, save, and open the file in your browser to make sure it renders before you push.

Read what the AI gave you before you paste. Strip out anything that loads from a domain you don't recognize. You're about to publish this publicly on the school network.

Step 2.4 — Add a .gitignore

Create a file named exactly .gitignore in your repo with at least:

# OS and editor junk
.DS_Store
Thumbs.db
desktop.ini
.vscode/

# Secrets
.env
*.key
secrets.json

Step 2.5 — Stage, commit, and PUSH

git status
git add .
git commit -m "Add initial splash page"
git push

Read git status before you stage. Only .gitignore and index.html should be listed.

First-time push: Git Credential Manager may open a browser window pointed at Gitea. Click Authorize, then return to Git Bash. Your machine will remember the credentials after that.

Step 2.6 — See your page live on the public URL

  1. Refresh your Gitea repo page — you should now see index.html in the file list.
  2. Open the classroom web host in a new tab:
    http://10.12.6.236/
    You'll land on an index page that lists every public repo on the server. Find your username, click in, then click your repo — your splash page will load. The Pi's nginx is serving it like a real web host.
  3. Once your page loads, look at the URL in the browser bar — it'll look like http://10.12.6.236/sites/your-username/my_first_repo_lastname/. That's the link to share with your partner in Block 3.
Checkpoint screenshot #2: Your splash page rendered at the public URL (URL bar visible).
Practice MCQ

You ran git commit -m "Add splash page" and got a success message. You then closed Git Bash without running git push. A friend visits your public URL. What do they see?

Practice MCQ

Which is the BEST reason to read the output of git status before running git add . on a repo you're about to push publicly?

3 Block 3 — Peer Review & First Iteration Loop~60 min

Here's What Pair up with someone in class. You each visit the other's public splash page, give written feedback, then go back to your code and act on at least two pieces of feedback. Each change you're happy with becomes its own commit and push.
So What A first draft is never the finished product. The instinct to show the work, hear the response, fix it, ship again is the exact rhythm of modern software teams — and of basically every creative or technical field. This is the loop that turns "I made something" into "I made something good."
Now What Trade URLs with a partner. Write feedback specific enough to act on. Then iterate.

Step 3.1 — Swap public URLs

Easiest way: both you and your partner open http://10.12.6.236/, navigate into your own repo, then copy the URL from the browser bar and share it. Or, if you prefer, just tell your partner your Gitea username — they can find your repo from the index at http://10.12.6.236/ themselves.

Step 3.2 — Write feedback for your partner

Open your partner's page in a browser. In a text doc, write them three specific pieces of feedback. "It's good" is not feedback. Examples of good feedback:

  • "The contrast between the gray text and the white background is hard to read — consider darker text or a softer background."
  • "Your bio mentions you like robotics but doesn't say what you've built — one concrete example would make it land harder."
  • "The console.log greeting is cute but only shows up if I open dev tools. Could you make the greeting visible on the page itself?"

Send your three pieces of feedback to your partner (DM, paste in a doc you share, whatever method your class uses).

Checkpoint #3 (text, not screenshot): Save the feedback you received from your partner verbatim. Paste it into your deliverable.

Step 3.3 — Iterate. Commit each improvement.

Pick at least two pieces of feedback you got. For each one:

  1. Edit index.html in VS Code to address that piece of feedback.
  2. Save the file.
  3. Reload your local file in the browser to check it.
  4. Once you're happy with the change:
    git status
    git add index.html
    git commit -m "Fix low-contrast text per peer feedback"
    git push
  5. Reload the public URL — your partner can see the improvement.
Commit message rules of thumb:
  • Imperative mood: "Fix contrast" not "Fixed contrast".
  • Specific enough that future-you can read the log and remember why.
  • ~50 characters or fewer for the summary line.
Checkpoint screenshot #4: The output of git log --oneline after your iteration commits — should show at least 3 commits (initial + 2 feedback fixes).

Iteration "Ship, review, fix, ship again" is the dominant workflow in modern industry

What you just did — build a small thing, get specific feedback, act on it, publish the next version — is the same pattern at the heart of:

  • Software — pull requests with code review comments before merging.
  • Marketing — A/B testing landing pages, keeping the version that performs.
  • Manufacturing — Toyota's kaizen: small, documented, continuous improvements.
  • Design — user testing rounds on low-fi prototypes before any pixel is polished.
  • Writing & journalism — editor passes that produce numbered drafts.

The shared idea: nobody gets it right the first time, and pretending you do is the slowest way to get good.

Practice MCQ

After you make a code change that addresses peer feedback, in what order should you run these commands?

Practice MCQ

Which commit message is the most professional?

Class 1 Wrap-Up~20 min

Here's What Before you log off for today, take 20 minutes to land the plane on Day 1 work cleanly — so Day 2 isn't spent fixing yesterday's loose ends.
So What Coming back to a half-pushed repo with mystery uncommitted changes is the most common reason a project loses momentum. A clean stop is a clean start.
Now What Run through the checklist below.

End-of-Day-1 checklist

  • Run git status. It must say "nothing to commit, working tree clean." If not, decide: commit it, or discard it with git restore (covered tomorrow).
  • Run git log --oneline. Re-read each commit message. Are they imperative, specific, and ~50 characters? Note any you'd write differently next time.
  • Confirm your public URL still loads in a fresh browser tab.
  • Add a short note to your draft deliverable: which feedback you've already acted on, what you might still want to change tomorrow.
  • If a partner is absent on Day 2, you can do their peer feedback round asynchronously by leaving comments in a shared doc — flag this with the teacher today, not tomorrow.
Day 1 closeout reflection (3–5 sentences, for your deliverable): What part of today's work felt smoothest? What part felt hardest? What's one thing you want to remember when you come back tomorrow?

Heads up for Day 2: tomorrow we work entirely inside Git history — discarding uncommitted changes, reverting a published commit, and cherry-picking a specific commit back. We'll also have an Open Experimentation Lab where you choose your own Git adventure.

Class 2 — Day 2 (180 minutes)

History surgery, open experimentation, and submitting your deliverable. By the end of today, you can fearlessly undo, redo, and surgically edit a Git project. Deliverable due end of class.

4 Block 4 — Discard Uncommitted Changes~35 min

Here's What Your repo is in a clean state — everything that's committed is also pushed. Now you'll deliberately make a bunch of changes you don't like, look at them in the browser, then use Git to throw them away and return to your last known-good commit.
So What Every developer eventually goes down a rabbit hole, mangles the code, and wants to start over from the last save point. Without Git, that means hours of "Ctrl+Z until it looks right." With Git, it's one command. This is the most-used Git feature in any developer's daily work and you should be fluent with it.
Now What Follow the guided steps exactly. The goal is to experience losing changes on purpose so you trust the command later when you really need it.

Step 4.1 — Confirm you're at a clean baseline

git status

You should see "nothing to commit, working tree clean." If you see anything else, commit and push it before continuing — we want this experiment to start from a known good state.

Step 4.2 — Make a mess on purpose

Open index.html in VS Code and intentionally make it worse:

  • Change the body background color to hotpink.
  • Change your heading text to all caps and add 10 exclamation points.
  • Delete a section of your bio.
  • Add a paragraph that says <p>I LOVE GIT SO MUCH</p> three times in a row.

Save the file (Ctrl+S). Open it in the browser locally to see the mess.

Step 4.3 — Look at what Git sees

git status
git diff index.html

git diff shows you exactly what changed since the last commit — red lines are removed, green lines are added.

Read the diff carefully — this is professional muscle memory. Before discarding anything, scan the diff and make sure nothing in it is worth keeping. If there's even one change you want to keep, copy it to a scratch file before you discard.

Step 4.4 — Discard everything since the last commit

git restore index.html

That's it. Reload the browser — your splash page is back to the way it was at the last commit.

To verify:

git status   # should say "nothing to commit, working tree clean"
git diff     # should print nothing
git restore on a file PERMANENTLY throws away uncommitted edits to that file. There is no undo. This is exactly why we commit often — so the worst git restore can do is erase the last few minutes, not the last few hours.
Checkpoint screenshot #5: Side-by-side or before/after — (1) the mangled page in the browser, then (2) the clean page after running git restore. Add a one-sentence caption explaining what happened.

Safety Net "Throw away the experiment" is a cross-industry concept

The instinct to try something risky knowing you can roll back in one move is a professional habit:

  • Photoshop / Lightroom — non-destructive editing layers; the original is never overwritten.
  • Video editing — "save as a new version" before any major cut.
  • Surgery — intra-op decision points where the team can abort a procedure and revert to a stable plan.
  • Trading floors — "paper trading" before any real money moves.

If you can't roll back, you can't experiment. Git's restore is your "experiment safely" button.

Practice MCQ

You've edited index.html, saved it, and decided you hate every change. You have NOT run git add or git commit yet. Which command returns the file to its state at the last commit?

Practice MCQ

Why is it important to run git diff before running git restore?

5 Block 5 — History Surgery: Revert & Cherry-Pick~60 min

Here's What Block 4 was about throwing away changes that weren't yet committed. This block is about editing changes that have been committed — sometimes even after they've been pushed. You'll learn git revert (undo a specific past commit safely) and git cherry-pick (apply a specific past commit on top of where you are now).
So What Real teams ship bad commits constantly — a styling change that breaks mobile, a feature that fails for some users, a typo that goes live. Reverting the bad commit while keeping every other later change is the move that gets the site working again without losing the team's progress. Cherry-picking is what you use when you want one specific change from a different branch or a previous attempt — without dragging along everything that came with it.
Now What Because today is your first time doing this, you'll practice on a separate file (practice.html) so you can't accidentally damage your splash page.

Step 5.1 — Set up the practice file with 4 commits

Inside your repo (same folder as index.html), do each step below in order, committing after each one. This gives us a history we can perform surgery on.

Commit A — Create a new file practice.html with this exact content:

<!DOCTYPE html>
<html>
<head>
  <style>
    body { background: lightyellow; font-family: sans-serif; }
  </style>
</head>
<body>
  <p>This is a practice file for Git history surgery.</p>
</body>
</html>

Then:

git add practice.html
git commit -m "A: Create practice file with yellow background"

Commit B — Add an <h1> heading inside <body>, above the existing paragraph:

<h1>Welcome to the Practice Page</h1>

Save, then:

git add practice.html
git commit -m "B: Add welcome heading"

Commit C (intentionally ugly) — Change the body background from lightyellow to purple:

body { background: purple; font-family: sans-serif; }

Save, then:

git add practice.html
git commit -m "C: Change background to purple"

Commit D — Add an h1 rule and a keyframes rule so the heading bounces. Replace the <style> block with:

<style>
  body { background: purple; font-family: sans-serif; }
  h1 { animation: bounce 1s infinite alternate; }
  @keyframes bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-10px); }
  }
</style>

Save, then:

git add practice.html
git commit -m "D: Add bounce animation to heading"
git push

Check the history:

git log --oneline

You should see D, C, B, A (newest first), each with a short hash. Open practice.html in a browser — you'll see a purple page (ugly!) with a bouncing heading.

Step 5.2 — git revert: undo a specific past commit, keep everything else

The purple background (commit C) is bad. The bounce animation (commit D) is good. We want to undo C while keeping D.

Copy the short hash of commit C from git log --oneline. Then:

git revert <hash-of-C> --no-edit
git push

Look at the file in the browser — the background is back to yellow, and the heading is still bouncing. Run git log --oneline again. You'll see a new commit at the top — something like "Revert "C: Change background to purple"". The original C is still in history; the new commit just undoes it.

Why revert instead of just deleting a commit? Because commit C was already pushed. Erasing it from history would mess up anyone else who has cloned the repo. revert adds a new commit that cancels out the old one, leaving history intact and shareable. This is the safe way to undo published work.
Checkpoint screenshot #6: git log --oneline showing your A–D commits plus the new "Revert C" commit on top.

Step 5.3 — git cherry-pick: grab a specific commit by hash

Cherry-pick is the inverse problem: instead of taking a commit out, you take a commit and apply it onto your current state.

Let's simulate a realistic case. Pretend we want to make a small detour: temporarily remove the bounce animation, then later re-apply only commit D's changes by cherry-picking.

Step 5.3a — Undo commit D so we can practice picking it back up. We'll use revert again:

git log --oneline   # find the hash of "D: Add bounce animation to heading"
git revert <hash-of-D> --no-edit
git push

Reload the page. The bouncing should stop — the heading sits still.

Step 5.3b — Now cherry-pick the original commit D back. Its changes were good; we just want them re-applied:

git log --oneline   # find the hash of "D: Add bounce animation to heading" (the ORIGINAL D, not its revert)
git cherry-pick <hash-of-D>
git push

Reload the page — the heading is bouncing again. Run git log --oneline one more time: you should see the cherry-picked commit at the top with the same message as the original D.

What just happened: cherry-pick took the diff of commit D — "add the bounce animation rules" — and applied that diff as a brand-new commit on top of your current state. The original D is still in history. The new cherry-pick commit is a fresh snapshot that contains the same changes.
Checkpoint screenshot #7: Final git log --oneline after the cherry-pick. Add a one-sentence caption explaining what the cherry-pick did.

When would you use each?

CommandWhen to use it
git restore <file>You haven't committed yet and you want to throw away the file's changes. The most common Git "oops" command.
git revert <hash>You committed (and probably pushed) a change that turned out to be bad. You want to undo it safely without rewriting history.
git cherry-pick <hash>There's a specific commit you want to re-apply — from earlier in your history, or from another branch — without dragging along the surrounding commits.
git reset --hard <hash>You're only working locally (nothing pushed), and you want to throw away one or more commits entirely. Dangerous on shared work — rewrites history.
Mini-reflection (3–5 sentences, in your deliverable): Explain in your own words the difference between git restore and git revert. Give one realistic scenario where you'd use each.

Career "Rollback without a time machine" is a real specialty

People get hired specifically because they can use Git to safely undo published work. In bigger fields:

  • Site Reliability Engineering (SRE) — on-call engineers at Google, Meta, and Cloudflare are paid to know exactly which commit broke the site and how to revert it during an outage.
  • Game studios — a hotfix patch is often a cherry-pick of one targeted commit onto a stable branch.
  • Banking & trading platforms — "release engineering" teams hand-pick which commits make it into a regulated release.
  • Hospital IT — EHR software updates are deployed with explicit rollback plans mapped to exact Git revisions.

Today's class is the same shape as a $200K+ SRE job — just at a much smaller scale.

Practice MCQ

Your team pushed five commits to the shared remote today. The third one broke the login page. The other four are fine and your teammates depend on them. Which Git operation is the SAFEST way to undo only the third commit?

Practice MCQ

A teammate wrote a tiny bug fix on a different branch. You don't want their other 12 work-in-progress commits — you only want that one fix on your branch. Which Git command best fits?

6 Block 6 — Open Experimentation Lab (Choose Your Own)~45 min

Here's What You've been guided through the core Git moves — now you get unstructured time to push past the script. Pick at least two of the experiments below and try them. Document each one (what you did, what you expected, what actually happened, what you learned) in a short section of your deliverable called "Experiments."
So What Professional Git fluency doesn't come from following one tutorial perfectly — it comes from playing in a sandbox where mistakes are cheap. This block is your sandbox. Real teams use these moves daily.
Now What Skim the menu below, pick experiments that look interesting (or scary), and try them. Use your practice.html repo or make a brand-new throwaway repo — do not test these on a teammate's work.
Rules of the lab:
  • Try the experiment first. Then look up the docs if you're stuck.
  • Run git status and git log --oneline before and after each experiment. Screenshot the diff in state if it's interesting.
  • If you break your repo, you can always clone a fresh copy from Gitea and start over. That's the whole point of having a remote.
  • Document at least two experiments. More is welcome.

Experiment menu

A. Branch & merge

The most common "real team" Git workflow. Make a side branch, do some work, and merge it back to main.

git checkout -b feature-fancy-button   # create + switch to a new branch
# edit practice.html, add a button
git add practice.html
git commit -m "Add fancy button"
git checkout main                       # switch back to main
git merge feature-fancy-button          # bring the branch's commits in
git push

Then run git log --oneline --graph --all — you'll see the branch structure visually.

B. Make a merge conflict on purpose — then resolve it

Create a branch that changes the same line as main. Merge it. Git will refuse and ask you to pick. Open the file — you'll see <<<<<<< markers. Edit the file to the version you want, then:

git add practice.html
git commit                              # finishes the merge

Conflicts are not bugs — they're Git asking you a question. Resolving one is a rite of passage.

C. git stash — set aside work-in-progress

You're mid-edit and a teammate asks you to switch to fix something else. You don't want to commit half-done work. Stash it:

git stash                # tucks all uncommitted changes away
git status               # working tree clean
# ...do the other thing, commit it...
git stash pop            # bring your half-done work back

D. git reflog — recover a "lost" commit

Make a commit, then run git reset --hard HEAD~1 (which "deletes" it). Panic for one second. Then:

git reflog               # shows EVERY HEAD movement, including the "lost" commit
git reset --hard <hash>  # bring it back

Git almost never actually deletes commits — it just stops pointing at them. reflog is the safety net.

E. Two-machine simulation

Clone the same Gitea repo into a second folder on your machine to simulate a teammate. From the first folder, push a commit. From the second folder, run git pull and watch the change appear. This is exactly what real collaboration looks like.

cd /c/Users/$USER/pit-projects
git clone http://10.12.6.236:3000/your-username/my_first_repo_lastname.git my_first_repo_lastname_2
# from the original folder: commit + push something
cd my_first_repo_lastname_2
git pull                  # the change you just pushed appears here

F. git diff archaeology

Pick any two commits in your history. Run:

git diff <older-hash> <newer-hash> -- practice.html

Read every change that happened between those two snapshots. This is how a developer reviews a colleague's pull request or audits what changed during an incident.

G. git blame — who wrote this line and why?

git blame practice.html

For each line of the file, Git shows the commit hash, author, and date that introduced it. On a team, this is how you find out who to ask when you don't understand a piece of code.

H. Propose your own experiment

Have a Git question you want to answer? Try it. Document it. Bring it up in the closing share-out. New questions are the goal of this block.

Checkpoint screenshot #8 (Experimentation Lab): For each of your two (or more) experiments, capture a screenshot or pasted terminal block showing what you did. Add a 2–3 sentence write-up: what you tried, what happened, what you'd use this for in real work.

Career "Pay for hours, hire for curiosity"

Hiring managers across IT routinely say the same thing: the difference between a junior who plateaus and a junior who gets promoted is whether they play with their tools. The engineer who tried git stash on a random Tuesday before they needed it is the engineer who reaches for it calmly six months later when the bug bell rings.

This block is small-scale exposure to the habit. Build it now.

Block 7 — Deliverable & Final Reflection~40 min

Here's What Combine everything you produced today — screenshots, peer-feedback notes, mini-reflections — into a single PDF and submit it through Schoology.
So What The deliverable is how this work gets credit, but it's also a portfolio artifact. Future you, applying for an internship, will be glad you have a clean, well-captioned PDF that documents that you can push, iterate, peer-review, and surgically edit Git history.
Now What Build the PDF in this order, with clear section headings.

Required sections of the PDF

Submit a single PDF named LASTNAME_FIRSTNAME_GiteaWorkflow.pdf with these sections, in this order:

  1. Cover page — name, date(s), period, lesson title.
  2. Warm-up & Day 1 closeout reflections — the Block 0 prompts (what a commit is, why committing beats saving, most confusing thing prior) AND the short Class 1 wrap-up reflection (smoothest part, hardest part, what to remember tomorrow).
  3. Gitea evidence — Checkpoint #1: your repo page on Gitea showing the public badge and repo name.
  4. Splash page evidence — Checkpoint #2: your splash page rendered at the public URL (URL bar visible).
  5. Peer feedback log — Checkpoint #3: the full text of the 3 pieces of feedback your partner gave you, followed by a short paragraph (3–4 sentences) describing which two you acted on and what you actually changed.
  6. Iteration history — Checkpoint #4: git log --oneline screenshot showing your initial commit plus your peer-feedback commits.
  7. Discard experiment — Checkpoint #5: before/after screenshots from Block 4, plus your one-sentence caption.
  8. History surgery — Checkpoints #6 and #7: git log screenshots after the revert and after the cherry-pick, plus your mini-reflection comparing git restore and git revert.
  9. Experiments — Checkpoint #8: at least two experiments from Block 6's menu (or your own). For each: which letter (or "self-proposed"), screenshot / terminal block of what you did, and 2–3 sentences on what happened and what you'd use it for in real work.
  10. Final reflection — one well-developed paragraph (6–8 sentences). Address all of:
    • Which of the Git operations you practiced (restore, revert, cherry-pick, plus the plain commit/push cycle, plus whatever you tried in Block 6) felt most useful and why?
    • What surprised you about getting public peer feedback on your code?
    • Where outside of programming might the "version everything, never overwrite" mindset matter to your future career?

Rubric (100 points)

CriterionPointsWhat full credit looks like
Engagement & on-task behavior (both days) 15 Worked through both class periods. Asked specific questions when stuck. Helped or got help respectfully.
Warm-up + Day 1 closeout reflections 5 Both reflections (Block 0 and Class 1 wrap-up) answered in complete sentences; honest and specific.
Gitea account + public repo correctly named 5 Repo named my_first_repo_lastname exactly, public, visible on the server.
Splash page (HTML + CSS + JS) live at public URL 10 Page loads at http://10.12.6.236/sites/your-username/my_first_repo_lastname/. Includes HTML structure, at least some CSS, and at least one piece of JS.
Peer feedback exchange 10 Three specific, actionable pieces of feedback given to a partner. Three pieces of feedback received and recorded verbatim. At least two acted on in commits.
Iteration commits & quality of commit messages 10 At least 3 commits total on index.html. Messages are specific, imperative, and reflect what actually changed.
Discard demo (git restore) 10 Before/after screenshots clearly show the mangled and recovered states. Caption explains what command undid it.
History surgery (revert + cherry-pick) 20 practice.html created with commits A–D. Revert and cherry-pick performed and visible in git log --oneline. Mini-reflection clearly distinguishes restore from revert.
Open Experimentation Lab 10 At least two experiments from Block 6's menu (or self-proposed) documented with a screenshot/terminal block and a 2–3 sentence write-up explaining what happened and a real-world use.
Final reflection 5 Full paragraph that addresses all three prompts with thought and specificity.
Total100
Submission rules: Single PDF. Professional formatting (headings, complete sentences, captioned screenshots). No screenshots-of-screenshots. No upside-down phone photos of your monitor. Honest documented failures (with exact error text) are worth full credit on the affected section — pretending something worked when it didn't is academic dishonesty.

Quick Command Reference

# --- Everyday loop ---
git status                          # what is staged / modified / untracked
git diff                            # what changed since last commit
git add <file>                       # stage one file
git add .                           # stage everything (use after reading git status!)
git commit -m "Imperative message"  # snapshot the staged changes
git push                            # send commits to the remote

# --- Get a remote onto your machine ---
git clone <url>                     # copy a remote repo locally
git remote -v                       # show where origin points

# --- History surgery ---
git log --oneline                   # short history
git restore <file>                  # throw away uncommitted edits to file
git revert <hash> --no-edit         # undo a past commit by adding a new "undo" commit
git cherry-pick <hash>              # apply a specific past commit on top of HEAD

If Something Doesn't Work

  • "fatal: not a git repository" — you're not inside the repo folder. cd my_first_repo_lastname first.
  • "Permission denied" / "authentication failed" — your Git identity email doesn't match your Gitea account, or you cancelled the browser authorize step. Re-run git push and complete the browser prompt.
  • "index.lock" / "unable to write" errors — you're inside OneDrive. Move the repo to a non-synced location (e.g. C:\Users\you\pit-projects) and clone again.
  • Cherry-pick or revert says "conflict" — two changes touched the same line. Open the file, look for the <<<<<<< markers, edit to the version you want, then git add <file> and git cherry-pick --continue (or git revert --continue).
  • Can't reach 10.12.6.236 — cellular or guest network. Connect to classroom Wi-Fi.
  • Public URL shows 404 — check that the file is named exactly index.html (lowercase, no hidden .txt extension) and that the repo is set to Public on Gitea.
  • Page loads but is blank — the AI may have given you incomplete HTML. View source; you should see <html>, <head>, <body>.

Document any error you hit — exact text, what you tried, what fixed it. That's the report you'd submit on the job.

Back to PIT Home