Single template and student repos for multiple assignments possible?

I’m just getting started with GHC for teaching. Ideally, I’d have a single template repo (with test code for different assignments - i.e. different lectures) from which different assignments will be “spawned” during the term. And ideally, students will create new repos only on accepting the first assignment, but not for the following assignments. My understanding of the mechanics of the GHC and how assignments work is that I will have to split the contents of the course (assignments) into multiple repos and likewise, students will have to deal with multiple repos of their own to work through the course.

Does anyone have a workflow to achieve this? Or can this be solved with git branches?

Hi @MatusGasparik

This is a somewhat debated topic. Here’s a couple of related discussions:

Git branches are indeed a possible solution.

Thanks @pattacini for your reply. The solutions in the discussions you provided aren’t really that attractive to me. I needs to be dead simple and if there’s currently no other way I will just create a separate repo for each assignment.

Btw. you mention in the other discussion thread (Single Organization) that you have your course materials and starter codes on in “main” organisation and the students’ repos reside in the separate organisation given {course} and {year}. Can you do this if the aforementioned resources repos are private or do they need to be public to be reachable from within the {course} and {year} specific organisation?

This is indeed the most preferred pattern recommended by GH.

Unfortunately, this is no longer possible as per the most recent updates GH did to the Classroom. Template repos need to be public if you aim to generate copies into different orgs.

So basically, if we want to keep the materials and assignments repos private, we will need to place their copies in every new organisation… :thinking:

Or generate the students’ copies into the same organization containing the private resources. This can become rapidly unwieldy with the number of generated repos. However, one can think of archiving past courses’ repos for the record. There are tools for that: see for example at master · vvv-school/ · GitHub.

At any rate, also copying out private resources into new organizations can be automatized with some effort.

Actually, you can keep it private.

Let org “forever” be your master org that you use to keep your assignments. Let “per-term” be your per-term org.

When create a lab/assignment, clone the repo from “forever” to “per-term” and change it to a template. Then, GHC will be able to clone per-term/assignment just fine.

Students will only ever be contributors to their per-term/assignment. Each student’s per-term repo will be private – only you, your TA’s and the student will have access.

Students would not have access to your “forever” org.

Here’s an example of that for one class over three years:


oh, I forgot that I had done a video about the process I was advocating our faculty use

Thanks, @dirkcgrunwald. Yes, that is a viable option and I am sure that with some effort you can automate the mirroring of the repos with shell scripts.

I just wish there was a possibility to create a hierarchy of organisations where you could grant access to private repos of the parent org to the child orgs…

Many thanks @dirkcgrunwald for the very informative video. Seems like integration with LMS (Moodle) works seamlessly…

My solution for keeping my resources private:

  1. use github classroom to create a group assignment with a 1 team maximum with private repos, no admin access
  2. accept the assignment as myself (usually I name the assignment after the course code and the group name I use semester). This will create a repo name of coursecode-semester in your organization.
  3. go to the repo this creates and change the teams access permission to READ (as owner you will be able to write so this won’t affect you)
  4. give classroom link to student and tell them to join that one team.

this will create a private repo that your students can access and read. it also creates a team with every student in it which is sort of nice.

© 2017 GitHub, Inc.
with by
GitHub Education