Mechanisms for updating an assignment?

Is there a mechanism to update an assignment? I can imagine two:

  1. students add a remote for the template, and pull & merge on their own
  2. a mechanism for instructors to submit a pull request updating an individual student from the commit at which they forked to another specified commit (defaulting to the tip of the default branch). Ideally, there would be a button, “Update all students to a commit,” that would do this for every student who has accepted the assignment.

Are either of these supported? I’m sure I can do #2 manually, but automating it would be nice. Or is there another way to do this? I know there are likely merge conflicts, but since part of the point of my course is to teach students how to use git, this is more of a “teachable moment” than a problem.

Related question: Github classroom assignment

EDIT: since others have asked before, let me at least show how to do #2. I’ll assume the default branch is called main (yours might be called master):

  • clone the student’s repo to your machine
  • add a remote to your (private) template: git remote add template <url from the "Code" dropdown> (you have access to this, but the student doesn’t)
  • git remote update
  • create a branch for making this update. If the student has already committed changes, it’s probably best to start this branch from the very first commit rather than main
  • because there isn’t any shared git history, we need to make changes manually: git diff --binary HEAD..template/main | git apply
  • inspect the changes, make any necessary modifications, add & commit
  • submit the pull request:
    • directly, if you want the student to manage any merge conflicts
    • after merging the student’s main branch into this one, if you want to manage the conflicts yourself