Managing Solutions alongside Starter Code

I have not really looked too deeply into this, but I have been looking for a way of managing starter code and solutions very easily without having to make changes in multiple projects. I wasn’t sure if Github Classroom already supports this in some way.

Ideally, I image there would be a way to mark particular blocks of code as solutions (our solution, though not necessarily the only), and that the solution blocks would not appear in the starter code but could be managed under version control. That way, if we would like to update the starter code, then that would not have to be done in two separate projects.

Is this possible? Thanks!

1 Like

Hi Sean,

This is a great feature suggestion. Since GitHub Classroom is an open source project would you mind opening an issue for this on the repo:

You can link back to this post for details.


Have you considered the use of multiple branches?..

  • A branch with the problem / incomplete code
  • Other branches with different solutions

Separate branches has the problem that individual branches cannot be assigned private access. Looking into it some more though, it looks like I could fork the solution code from the starter code (I’m doing that already except the reverse), add the starter repo as a remote and merge.

I can’t imagine there is any way around merging, and I’m not expecting one. But some sort of streamlined approach to this would be a nice feature. I’ll open an issue regardless in case that’s a possibility.


We have opted for the textbook and workbook model with workbook repos being practically empty except for dependencies (libs, etc.). The solution goes in the textbook repo that they refer to as they fill out their workbook repos. Eventually we hope to add a check command line tool that will pull down a given exercise check script that students can use as a sort-of tutor.

1 Like

Sorry to bump this thread up again. I’m currently facing a similar issue where I provide my students a repository with very slim template-code to start with whereas I maintain the fully developed solution.
Right now I’m using imports to add my piece of code into the starter code from a second, private repository but that has the drawback that it basically shows students where stuff has to happen and that it depends on where you clone both repositories.

Did you stick with the forking solution? Or did something else come up in the meantime that provides a more elegant solution?

Forking is the most elegant solution I’ve found and it’s still somewhat of a headache whenever I have to make changes to both the starter and solution code. At this point, I rarely need to make changes that there is no need anymore for a more elegant solution.

I would recommend doing the same or managing two repositories and importing code as needed.

1 Like