Blocking all merges to a branch


I was looking through the branch restrictions for repositories in an organization to see whether it was possible to block merges to a certain branch.

Right now, it seems like it’s possible to do one of the following:

  1. Block pushes to a branch (this only affects pushing from a local copy of the repository to the branch on GitHub)
  2. Block merges to a branch if there are not enough reviews or if a status check has not passed, but at least one of these qualifiers is required

For some context, we’re building a small merge queue to manage our growing team and want to ensure all merges go through that (essentially, block pushes and merges from everyone except a GitHub App). Am I missing an option to entirely protect a branch from any changes, or is this not something that’s possible today?


Hi @kylekthompson - welcome to the GitHub Community.

You are correct in that it’s not possible to entirely prevent all merges on a specified branch.

It’s only possible to restrict the conditions in which a merge can take place using the existing branch protection settings within GitHub.

Sorry this isn’t the answer you are looking for!

No worries, thanks for taking the time to respond!