Skip to content

Add feature to disable pull requests on a repository #84

Open

Description

@alibitek

Like disabling Wiki and Issues in the project's Settings view I would like to be able to disable pull requests on a repository.

This will be very useful for projects which have only a mirror on GitHub and they DON'T want to use GitHub's pull request mechanism for accepting contributions.
Or a project open sourced by a company is in the process of accepting GitHub pull requests but not yet, they still have some work to do internally before they are ready. (e.g. Google's TensorFlow project used to not accept pull requests through GitHub at the very beginning, but now they do)

Mirror examples:

  • Linux kernel - 92 people wasted their time sending pull requests because they haven't read how to contribute to the Linux kernel guide
  • Qt project - GitHub is only used as a mirror and not accepting contributions through it, they use their own Gerrit instance
  • kdeconnect-kde - GitHub is only used as a mirror and not accepting contributions through it
  • kdeconnect-android - GitHub is only used as a mirror and not accepting contributions through it

And many others... the maintainer(s) of the project have to tell people every time that submitting pull requests through GitHub is NOT the way to contribute to the project, and to keep telling them to read the contributing guidelines and close their pull request:

Having the option to disable pull requests on a project would solve this problem.

Activity

  1. changed the title [-]Add feature to be able to disable pull requests on a repository[/-] [+]Add feature to disable pull requests on a repository[/+] on Jan 17, 2016
  2. aeneasr commented on Jan 18, 2016

    @aeneasr

    Wouldn't this be covered by this?

    Issues and pull requests are often created without any adherence to the CONTRIBUTING.md contribution guidelines, due to the inconspicuous nature of the “guidelines for contributing” link when creating an issue and the fact that it often contains a lot of information that isn’t relevant to opening issues

  3. cvrebert commented on Jan 19, 2016

    @cvrebert
    Contributor

    Surprisingly, https://github.com/isaacs/github/issues doesn't seem to have an issue for this yet (or my search-fu is failing me).

  4. albfan commented on Dec 5, 2016

    @albfan
  5. Flimm commented on Jan 12, 2017

    @Flimm

    I feel dear-github is talking about the concerns of open source maintainers. But this one is a huge concern for drive-by contributors like myself. My profile is full of repos that are forks for one-off contributions, and I can't clearly indicate their second-class nature, nor can I highlight the repos that I do want to welcome contributions to. Being able to disable accepting pull requests would help for this purpose.

  6. CAFxX commented on Mar 3, 2017

    @CAFxX

    My profile is full of repos that are forks for one-off contributions, and I can't clearly indicate their second-class nature, nor can I highlight the repos that I do want to welcome contributions to. Being able to disable accepting pull requests would help for this purpose.

    Agreed. Ideally, in this case, an option that redirects PRs to the upstream fork would be the best possible outcome.

  7. yihui commented on Jun 21, 2017

    @yihui

    I'm tired of asking users not to submit pull requests to a repo I forked, too, e.g., https://github.com/yihui/roxygen2/pulls

  8. aliqasemzadeh commented on Dec 25, 2017

    @aliqasemzadeh

    I need this feature too.
    I think it is good.

  9. clarkbw commented on Dec 25, 2017

    @clarkbw

    Forked repos should likely be handled differently than the original. If you just want to contribute forking seems too heavy weight.

  10. ehamiter commented on Jan 8, 2018

    @ehamiter

    This would be also extremely helpful for a repo set up for a company's coding challenge. I've had issues with candidates in the past putting up a PR to our repo instead of forking ours and putting the PR on their repo. Once a PR is created, our repo is effectively spoiled, since any future candidates simply have to look at the closed PRs and see all the solutions people have written in the past. There's no way (that I've found) to remove them. Preventing them would be great.

  11. ShalokShalom commented on Jan 18, 2018

    @ShalokShalom

    👍 +1

  12. ShalokShalom commented on Jan 18, 2018

    @ShalokShalom

    @ehamiter The only way that I know is that you simply mirror here and host somewhere else.
    Gitea lets you hide the status and mirrored Github instances cant accept Pull-Requests.

  13. ve3 commented on Jan 23, 2018

    @ve3

    I want this too.

  14. TomasVotruba commented on Jan 29, 2018

    @TomasVotruba

    This would be awesome for all monorepos that are on the rise in PHP world in last 2 years

  15. 54 remaining items

  16. whitespacecode commented on Dec 22, 2022

    @whitespacecode

    Is there a way to disable pull requests on a particular branch to the main/master branch? If so, please help me how to configure this, thanks in advance.

    Looking for this to. We want to have the development branch to be without pr

  17. ugreg commented on Feb 6, 2023

    @ugreg

    This workaround could be useful until there support in the repo settings to disable PRs.

    https://github.com/marketplace/actions/close-pull-request

    This Action subscribes to pull_request_target events. When receiving a pull_request_target event, this action closes the pull request triggered by the event immediately.

  18. kennyma-eplus commented on Mar 2, 2023

    @kennyma-eplus

    This workaround could be useful until there support in the repo settings to disable PRs.

    https://github.com/marketplace/actions/close-pull-request

    This Action subscribes to pull_request_target events. When receiving a pull_request_target event, this action closes the pull request triggered by the event immediately.

    But if the repo is a code challenge, the "answer" will keep in "closed pull request"

  19. ngdangtu-vn commented on Oct 19, 2023

    @ngdangtu-vn

    Wake me up when the feature arrives.

  20. ADTC commented on Oct 20, 2023

    @ADTC

    code challenge

    In this case, it's not enough to disable pull requests. You'd have to disable forking entirely.

    Use a private repo, and disable forking on it. Invite only the challenged to view the repo. Publish the repo only after the challenge is complete. Or IDK, maybe you have something else in mind. Is this a challenge that's open to the whole world?

    Other services might suit this use case better actually.

    PS: Dear GitHub, please add feature to disable pull requests on a repository. You can literally just put a checkbox in Settings > Features and hide the tab if checked...

  21. ljharb commented on Oct 20, 2023

    @ljharb

    In that case, you'd have to disable cloning also, which is impossible. However, there's tons of other valid use cases to disable PRs on a repo, so it doesn't really matter that that single use case doesn't really work.

  22. quanah commented on Jan 9, 2024

    @quanah

    The OpenLDAP project mirror is another case where we do not want PR's to be made via GitHub.

  23. a-n-d-a-i commented on Feb 24, 2024

    @a-n-d-a-i

    bump

  24. ryubal-sh commented on Apr 12, 2024

    @ryubal-sh

    It's only been 8 years, c'mon we can do this guys

  25. fatso83 commented on Aug 21, 2024

    @fatso83

    Screenshot_20240821-085901.png

    From isaacs/GitHub

    Just use the official channel

  26. fatso83 commented on Aug 21, 2024

    @fatso83
  27. PaulNewton commented on Feb 7, 2026

    @PaulNewton

    Currently relevant "Exploring Solutions to Tackle Low-Quality Contributions on GitHub"
    https://github.com/orgs/community/discussions/185387

  28. younsl commented on Feb 14, 2026

    @younsl

    Hi, this feature has finally arrived! GitHub has introduced new repository settings for configuring pull request access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions