Github Classroom

We’ll be using Github Classroom to share all resources for class. This is the primary way you should be downloading and working with course materials. Each week, we’ll create a new Github Classroom assignment link (prefixed with 📚). Clicking it will automatically create a github repository for you containing all the materials you need.

You’ll then be able to clone this repository to your computer, working through files interactively, make edits/updates, and commit and submit your assignment for review. Each time you push your work to Github, your instructors will be able to provide review, feedback, and discussions that directly reference your code.

You’ll always be able to access your assignment repositories, history, and instructor feedback after the course is over. So the more effort you put into assignments, the more you engage with instructors, the more you’ll learn, and the higher quality resources you’ll have for your own future reference!

Getting Assignments

  1. Open any course link that starts with 📚
  2. Accept the assignment in your browser
  3. Click the URL to go the auto-created github repo (this will always be named assignment-name-YOUR-GITHUB-USERNAME)
  4. Clone it to your local computer using git clone
  5. Open and work on any notebook files using VSCode
  6. Commit your changes locally using git add & git commit
  7. Push your changes to github using git push
  8. Respond to any feedback discussions under the “Pull Requests” tab on the github repo

Updating Assignments

Occasionally, we’ll update assignments that you’ve already accepted and git clone-d to your local computer with additional files, solutions, or package updates. When this happens, a Pull Request titled “GitHub Classroom: Sync Assignment” will automatically appear on your repository.

Quick way

We’ve included a script in each assignment repo that handles the entire update process for you:

uv run poe update-assignment

This will check for updates, merge them in, open VS Code if there are any conflicts to resolve, push your changes, and re-setup your environment. We recommend understanding the manual steps below so you know what’s happening under the hood.

Manual steps

Open a terminal and cd into your assignment folder.

1. Save and push any uncommitted work

git add .
git commit -m "Save work"
git push

2. Check for the update

gh pr list

If you see a PR titled “GitHub Classroom: Sync Assignment”, note the number (e.g. 3) and continue.

3. Checkout the update

gh pr checkout --detach <NUMBER>

This puts you on the instructor’s latest code in a “detached HEAD” state. We use --detach because the PR’s branch is also called main, which would collide with your local main.

4. Merge your work into the update

git fetch origin main
git merge origin/main

If the merge completes with no errors, skip to Step 5.

If you see CONFLICT, you’ll need to resolve them. First, make sure VS Code is configured as your merge tool (you only need to do this once):

VSCODE="/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"
git config merge.tool vscode
git config mergetool.vscode.cmd "$VSCODE --wait --merge \$REMOTE \$LOCAL \$BASE \$MERGED"
git config mergetool.keepBackup false

Then run:

git mergetool

For each file, VS Code will open a 3-panel merge editor. The key terms to know:

  • Current (also called “ours” or “local”) = the instructor’s update
  • Incoming (also called “theirs” or “remote”) = your work

For each conflicting section, click Accept Current to take the instructor’s version or Accept Incoming to keep yours. The bottom panel shows the result of your choices. When you’re happy with it, click Complete Merge (bottom-right) to finish that file.

git mergetool will automatically move to the next conflicted file. When all are resolved:

git commit -m "Merge instructor updates"

5. Push and switch back to main

git push origin HEAD:main
git checkout main
git pull --no-rebase

The PR on GitHub will automatically close. Now re-setup your environment:

uv sync
uv run poe setup

If everything worked you should see the new/updated files in your local folder, and you can hack on them as you normally would.