How to make Pull Requests Private?

Currently when one opens a pull request to a project repository its public and can be seen by anybody.
However this should not be the case when students submit their assignments, they can see other’s solutions too.
How to avoid that?

Thanks

2 Likes

Pull requests opened on private repositories remain private.

Therefore, if you aim to prevent students from copying others’ solutions, then you’d better consider making the assignments private. To do so, you could ask GitHub for an academic discount on your organization.

2 Likes

@prateekiiest, @pattacini is correct.

To apply for private repositories, follow the directions here: http://education.github.com/discount

Let us know if you have additional questions!

2 Likes

I think having student “submit” via pull request is a weird way of doing this. I don’t think it is the intended workflow and that’s why the mechanism will not work for you.

Why not just collect the student’s code from his repository? Is it so you can use the review features?

1 Like

@remram44 actually, the pull request mechanism is at the core of GitHub Education and students should always turn in their solutions by opening a PR. This is the intended behavior.

A useful resource on this: https://github.com/blog/2376-how-to-grade-programming-assignments-on-github.

1 Like

Thank you for sharing that tutorial, @pattacini :sparkles:

@prateekiiest pull requests are a pedagogical choice, but we definitely recommend them. Let us know if you have more questions.

Yeah , that’s something which can surely be done.
Thanks :slight_smile:

Thanks for the solution.
I checked the Github Student Pack recently.
Thanks :slight_smile:

Sure @mozzadrella

Thank you @everyone for your overwhelming response and helping me out !!

This is not true though?
I just tested this:

  • Create a private repo with account A
  • Give read access to account B and C
  • Sign in to account B
  • Accept invitation
  • Fork the repo (the fork is mandatorily private)
  • Commit a change
  • Submit a Pull Request
  • Sign in to account C
  • Accept invitation
  • Notice that I can see B’s Pull Request and its content

This is fully normal as the PR is located in the original repo where A, B, and C have all access.
However, GH Classroom does not rely on forks but rather on template repositories.

With templates, B and C won’t have access to A’s original repo; rather, each user will have his own private repository where spawning a confined PR.

1 Like