13

I have one collaborator in my private github repository. After she sent me a pull request, she could actually go to the pull request screen and executed a merge i.e. she had the privilege to merge her changes into my branch.

Is there some kind of setting that I need to set in order to make sure only I can do the merge? And, I don't think this is because my repo is private, right?

Thanks.

0

3 Answers 3

3

From 'https://help.github.com/articles/defining-the-mergeability-of-pull-requests/':

You can require pull requests to pass a set of checks before they can be merged. For example, you can block pull requests that don't pass status checks. You can also require that pull requests have at least one approved review before they can be merged.

By default, any pull request can be merged at any time, unless the head branch is in conflict with the base branch. But as your project matures and stabilizes, you can choose to enforce restrictions on how a pull request is merged into your repository.

Protected branches ensure that collaborators on your repository cannot make irrevocable changes to branches. These branches can also be protected by requiring pull requests to have at least one approved review before they can be merged.

3

You could use a service like PullApprove or required code reviews to ensure that you have to give permission first.

1
  • 1
    I haven't found a good solution so far. What if there are multiple collaborators? The other collaborator can be assigned as the reviewer and the branch could still be merged without the permission from the repository owner right?
    – IgNite
    Oct 21, 2019 at 19:41
2

The "Manage multiple clients" GitHub help page mentions:

This approach lets you retain control over the repos, but still gives your clients access to them.
In many cases it is the cheapest route overall, though you will be stuck paying the bill yourself (unless you bill it to the client).

To use this strategy, upgrade your personal or org account to a paid plan.
Now you can add private repos for the client directly to this account.
If the client wishes to access the repos directly, they can create a free personal account and you can add that user as a collaborator (if the repos are on your personal account) or to a team (if the repos are on an org account).
With an org account you can also give them admin access to the repo if you wish.

So if your project was part of an org account instead of a personal account, you could have the choice the the admin access for the users you add as collaborator.

2
  • The Organization allows us to grant pull / push / administrative privilege to each member. However, do you know whether it has an ability to allow / prevent my private collaborator to merge their changes to my branch?
    – moey
    Dec 24, 2011 at 18:33
  • @Siku-Siku.Com: not sure, but one solution would be to have to one but two private repos, one for the private collaborators, one for your branch.
    – VonC
    Dec 25, 2011 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.