How to disable pull requests in GitHub?

How to disable pull requests in GitHub?

Since Nov. 2021, this is now possible:

Allow bypassing required pull requests

This is a good practice, but you may want to make exceptions to this rule for specific people and teams.
For example, if you have an automated process that calls GitHub APIs to make changes in a repository, you may want to permit that automation to make changes without creating a pull request.

Now, when you require pull requests and their related protections for a branch, you can specify people and teams who should be free from those requirements.

As shown in the image below, select Allow specific actors to bypass pull request requirements. Then, search for and select the people and teams who should be allowed to bypass the requirements.

Screenshot of option to bypass PR requirements -- https://github.blog/wp-content/uploads/2021/11/bypass-pull-request-requirements.png?resize=715%2C375?w=715

For more information, visit Managing a branch protection rule.


Before 2021, that was not 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):

  • since Sept 2015, you can protect branches in a GitHub repo.
    https://help.github.com/assets/images/help/repository/protecting-branch-ui.png
    That means a protected branch:

  • Can't be force pushed

  • Can't be deleted

  • Can't have changes merged into it until required status checks pass

  • Can't have changes merged into it until required reviews are approved

  • Can't be edited or have files uploaded to it from the web

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!


It is not possible according to GitHub support

I asked support [email protected] 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:

  • https://github.com/isaacs/github/issues/1191
  • https://github.com/dear-github/dear-github/issues/84

Tags:

Git

Github