Restricting push access to master branch


(Jason Gaudette) #1

I have started to have my students use a pull-request to confirm when they have completed an assignment. This allows students to work on their own branch and get familiar with the branching workflow for group projects.

Although I am able to add a ‘student’ branch to the template in GitHub classroom, the branch restrictions I place on ‘master’ do not carry when students accept the assignment and import their repositories.

Question: Is it possible to modify the GitHub Classroom starter template repository so that student repos will only allow TAs and instructors push to the ‘master’ branch?

Thanks!

Jason


(Mark Michon) #2

A recent change has made it so the protected master settings don’t carry over, but there’s an active issue on the GitHub classroom repo about it. I’ve been manually setting it on each student repo for now. I believe there’s still API access to set branch protection, so you could set up a web hook that does it. (this is what I’ll eventually get around to for my workflow).


(Brian Simpson) #3

Any updates on your problem? I’m having the exact same issue at the moment. I have not tried editing the settings of each student’s repo, but that is next on my idea list.