Using github to distribute class materials


(Kristen Thyng) #1

I’m teaching Python for Geosciences for graduate students and higher level undergrads. I taught this last class last semester using github to distribute the materials (Jupyter notebooks) and it worked ok but not great. The biggest issue that came up all semester was that students would clone the repo, use the materials, and make their own changes and notes in their versions of the notebooks. Then when they git-cloned again, their notebooks needed to be merged with the class notebooks. Since the point of the class was Python and not git, I didn’t want to go into details about them learning how to merge, I just wanted them to use git and github as a tool. I ended up having students either lose their changes or save their notebooks with a different name, but I wasn’t happy with either solution. I’d love ideas for a way around this issue if anyone has them.


(John Britton) #2

@kthyng It sounds like you are having all of your students clone from one repository, is that correct?

If so, why do they need to clone a second time? Do you update the repository with new material?

If they’re public, would you mind linking to the repositories you used? It’d be helpful to get a better idea of how you’re organizing your class.


(Kristen Thyng) #3

@johndbritton Oops sorry I thought I’d be notified if someone responded! Yes, they are all cloning from one repository, and yes, I continue to update the materials. Last semester a lot of development was happening so there were more updates than there will be in the future, but I don’t think relying on me not needing to change stuff would be good since I’ll always want to update and change stuff.

Here is the repo from last semester (when I was co-teaching): https://github.com/hetland/python4geosciences
I haven’t set up the new repo for this upcoming term yet.


(Jens Buysse) #4

@kthyng Why would you create a new repo for the upcoming term?

Kind regards
Jens


(Kristen Thyng) #5

Ah yes generally I will not need to, but I have significant reorganization to do this term.


(John Britton) #6

I took a look at your repository and it seems like you’re putting all of the assignments into one big repository. If you use GitHub Classroom you could consider creating one repository for each assignment and then distributing the invitations to your students throughout your course.

This way you could update the code up until the point when you distribute it.

We’ve had a lot of requests for a way to update student repositories after the fact, but we haven’t settled on a single recommended way to do that.

Generally speaking, it works best if you let the students pull the updates from your main repository. The important thing is that you have to make sure the changes you’d push won’t cause conflicts.

An example of how some teachers do this is providing some library classes / code and a designated interface that the students can use to complete the assignment with your helper code. That way you can easily update your helper library and your students can update it without worry of conflicts.


(Mario Liebisch) #7

An alternative approach to John’s suggestion:

Create only one repository, but create one branch per assignment. This way it’s very easy for students to switch between assignments (branches), everything is tracked in one unified place, and still everything is nice and separated. They can even rebase your new changes onto their own, hopefully without having to worry too much about merge conflicts.

You could also start with a very first initial commit in the master branch that adds a readme file telling the students how they’re able to switch between branches and other elementary instructions (or script files to automate this), which would also be the branching point for all future branches.