Hi. I’m Chelsea Troy. I’m a computer science educator at the University of Chicago. I’m writing about the techniques I use to teach my distributed course, Mobile Software Development. You can visit the teaching category to see them all.
Here’s one of the big mismatches between traditional computer science education and professional software engineering: students work alone on most of their programming assignments for school, but professional programmers work in teams on most of the software you’ve heard of. So computer science students graduate without much (if any) practice with the technical and interpersonal skills they’ll need to work on teams.
In an effort to provide them with some of that practice, I work with them on an Android app called Canary. I provide them with an existing app and ask them to add features to it, just as they might do when they join a professional team working on an existing application. I do that by creating an assignment for them in GitHub Education with a template repository containing the starter code.
The students add features to this code. Meanwhile, I also have additional features written for this code. When they finish their features, I have them incorporate my updates into their versions of the app, then write more features on top of the combined result.
This is straightforward with repositories that are forks of other repositories. However, GitHub Education template repositories are not forks of the original repository.
No worries! Git itself does allow a student to incorporate updates to a template repo into their assignment version of the repo. It takes a couple of extra commands, which I will show you below.
The steps for you:
1. Push your changes to your template repo on a branch.
2. Make sure your repo is public (I think this is required to make it a template repo anyway).
The steps for your students:
- They should
cdinto their repo on the command line.
- They should make sure they are on the branch that you want them to merge your changes into. Let’s say it’s called
- They should add a new remote to their repo that points to your template repo with the command
git remote add teacher https://github.com/TEACHERS-REPO.git
- They should use
git fetch teacherto see the branches on your version of the repo. Suppose there’s one that contains the changes you want them to add. We’ll call it
git checkout teacher-updates
- Now they are on your branch,
teacher-updates. They should switch back to their branch,
- From here, they can either:
- merge your changes:
git merge teacher-updates --allow-unrelated-histories
- rebase their changes on top of yours:
git rebase teacher-updates
- merge your changes:
From 2:20 to 6:55 to in this video, I explain the commands in detail. For the rest of it, I am literally showing every single step of resolving merge conflicts. Useful if you want to learn strategies for addressing merge conflicts. Not germane to the specific topic of pushing updates to students’ assignment repos.
Here is a follow-up video where I show you the final step: the merge commit.
This is how you can use an assignment to keep your students’ code private from each other, while still allowing you easy access to grade it, and still having the ability to push them updates after you have given them the assignment template code.
DISCLAIMER: GitHub has a contract to provide their software services to ICE, an organization that runs concentration camps for Latinx immigrants and other immigrants at the U.S. border. After several resignations and public outcry, Nat (GitHub’s CEO) doubled down on the decision.
As a direct descendant of immigrants who were held in concentration camps Buchenwald and Auschwitz by the Nazis, I cannot endorse GitHub’s decision. Though the sale was made through a reseller and not by GitHub itself, it became GitHub’s official position the moment Nat doubled down and defended that contract. I have written to Nat myself to express my concerns and delineate what GitHub would have to do to get back on the right side of history. Obviously I’m no one, but I like to believe that every little bit helps.
This blog post delineates how I operate in the context of a preexisting arrangement between my class and a GitHub product. It is not an endorsement of Nat’s actions, and I encourage everyone who uses a GitHub product, on purpose or by accident, to use their influence to exert pressure on Nat to make systemic changes to the values upheld by the business and the way those values are effected. Please reach out if you would like help or encouragement with this: chelsea at this blog’s address.
If you liked this piece, you might also like:
The Philosophy of Software Design series
Techtivism! About how to wield your role as a technologist in accordance with your values.
The series on Bob Nystrom’s…book? Open education project? Anyway, it’s called Crafting Interpreters, and by the time you read the existing pieces I’ll be updating it again with new posts.