I am trying to understand how will I be able to disable “pull requests” in github.
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.
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 ?
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 ?
How to disable pull requests in GitHub?
Since Nov. 2021, this is now possible:
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.
For more information, visit Managing a branch protection rule.
Before 2021, that was not not possible:
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)
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
# Lock issues and pull requests lock: true # Limit to only `issues` or `pulls` # only: pull
Note that (considering the OP dates from January 2015):
since Sept 2015, you can protect branches in a GitHub repo.
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
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!
Answered By – VonC