28

I am trying to understand how will I be able to disable "pull requests" in github.

Question 1: We are trying to use the rebase workflow and that means using pull requests can be harmful if that isn't a fast forward push. One Solution: Setup branch permissions for the branches where I want to disable pull request. Or add me as the reviewer to anything that goes into master.

Question 2: So that begs the question, can I setup branch permissions in github ?? Can I add myself as a reviewer for any change that wants to get into master ?

Question 3: Github has definitely removed pre-receive hooks, so how can I do any enforcements before the source hits the server ? pre-commit hooks can be done, but at the same time can be pain.

I had asked a similar question here: Commit message hook on github

It seems github could be useful for the merge workflow or even git-flow, but it can be hard to maintain for the rebase workflow, is that a fair assumption ?

Can I consider atlassian Stash as a better tool for the rebase workflow ?

6

How to disable pull requests in GitHub?

So far (Q2 2020): not possible.

Update Sept. 2020, this "dear-github" issue point out in the comments to the GitHub Action "Repo Lockdown": it can help prevent any new PR on a GitHub repository.

Oct. 2020: "GitHub Actions: Fine-tune access to external actions" means that you can disable external GitHub Action that would create PR (or have any other effect on your repository)


Armin Sebastian suggests in GitHub issue 1191

I've made a new app that immediately closes and locks new and existing issues or pull requests and also supports posting a comment and labeling.
It is perfect for forks and mirrors, and you can configure it to your liking

dessant/repo-lockdown, with a .github/lockdown.yml including

# Lock issues and pull requests
lock: true

# Limit to only `issues` or `pulls`
# only: pull

Other workaround:

Note that (considering the OP dates from January 2015):

And Since October 2016, you can dismiss a review

https://cloud.githubusercontent.com/assets/98681/19321785/3ad41962-906b-11e6-9320-f24bf164e17e.png

However, this requirement can sometimes block your team’s progress without good reason.
If someone leaves a review that requests changes and then goes on vacation or runs into computer problems, your pull request could be blocked for days, even after you’ve addressed the reviewer’s concerns.

This will unblock your pull request, freeing you up to merge it!

1
  • Thanks @VonC, we have already implemented all of those changes. The only one remaining now is the Single Single On or LDAP :) – Jason Oct 13 '16 at 16:37
16

It is not possible according to GitHub support

I asked support support@github.com on February 2018 if it was possible to remove the Pull Requests tab, and the reply from @nickcannariato was:

Thanks for writing in! We've definitely heard some users requesting this feature over the last couple of years, and it's currently on our feature request list. I can't make any promises about if or when we may add this ability in the future, but I'll add your +1 to that feature request so the team can see it.

confirming that it is not possible.

Request on the de-facto trackers:

11

I made a tool to automatically close pull requests as they are opened.

https://nopullrequests.appspot.com

2

You can't setup branch permissions with Github. However, if you're the only one with push permissions, you don't have to forbid the creation of pull requests: you could just rebase and push them manually.

A tool which my fit your needs is Gerrit. It's an open source software which act like a kind of wrapper around Git. It's mostly a code review software. But it will also allow you to define permissions per branches.

However, a difference with Github, is that you'll likely have to host it yourself.

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.