Skip to content

merge blockers

Why GitHub says a merge method is not allowed, and how to merge anyway

Othman Shareef · November 22, 2026 · 5 min read


If GitHub says “Merge method squash is not allowed for this base branch” or “Merge commits are not allowed on this repository”, the method you picked is switched off somewhere. Pick another one from the merge button, usually Squash and merge or Rebase and merge. If none of them work, the repository settings and the branch rules disagree, and an admin has to make them share at least one method.

Why does GitHub say the merge method is not allowed?

Each of GitHub’s three merge methods can be switched off in any of these places:

  • Repository settings. Under Settings, General, Pull Requests, the checkboxes Allow merge commits, Allow squash merging and Allow rebase merging set which methods the repository offers. A method with its box cleared never shows up in the merge button.
  • Require linear history. A branch protection rule or ruleset with this setting stops merge commits from reaching the branch. Per GitHub’s docs on protected branches, pull requests merged into that branch must use a squash merge or a rebase merge.
  • A ruleset’s merge methods. Rulesets can require a specific merge type under Require a pull request before merging. GitHub’s list of ruleset rules says that if the repository has disabled a method and the ruleset requires a different one, the merge is blocked.

The wording usually tells you which one: “for this base branch” points at a rule on the branch, and “on this repository” at the repository checkboxes.

How do I fix “merge commits are not allowed on this repository”?

  1. Open the dropdown next to the merge button and pick Squash and merge or Rebase and merge. No setting needs to change.
  2. If you need merge commits, ask an admin to select Allow merge commits under Settings, General, Pull Requests.
  3. If the box is already selected, check the base branch for Require linear history, in its branch protection rule or in a ruleset. While that is on, merge commits stay blocked on that branch.

The same rule applies to pushes. With linear history required, pushing a merge commit straight to the branch fails with a GH013 rule violation when a ruleset enforces it.

How do I fix “merge method squash is not allowed for this base branch”?

A rule on the base branch allows a set of methods, and squash is not in it. Pick one of the other methods from the merge button. To see which rules apply, add /rules to the repository URL. Anyone with read access can view them. If the only method the ruleset allows is one the repository has turned off, nothing can merge until an admin either enables that method in the repository or changes the ruleset.

If you own the repository: GitHub only lets you turn on Require linear history while squash merging or rebase merging is allowed, so keep at least one of them selected.

Does auto-merge use the same merge method rules?

Yes. When you enable auto-merge, you pick a merge method from the same dropdown, and GitHub merges with that method once the requirements pass, so pick one the branch allows. A branch that requires a merge queue is different: the queue merges with the method set in its own rule. The merge queue explainer covers how that works.

What does the merge method error look like in the API?

The REST endpoint PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge takes merge_method, one of merge, squash or rebase. The endpoint docs list a 405 Method Not Allowed when the merge cannot be performed. A script that always sends merge fails on a repository with merge commits off, while people clicking the button never notice. The repository’s allow_merge_commit, allow_squash_merge and allow_rebase_merge fields say which methods it can send, and a ruleset’s pull request rule lists its own allowed_merge_methods.

Which merge method should a team allow?

I’d allow one method per repository, so nobody has to guess. GitHub’s merge methods page says the same: to enforce a method, enable only that one. Squash suits teams that want one commit per pull request. Rebase keeps every commit, which is worth it when commits are small and get reviewed one by one. Pyor’s merge box only offers the methods the repository allows. For the review rules next to these settings, see our guide to required reviews.

Frequently asked questions

Why can't I create a merge commit on GitHub?

Either the repository has Allow merge commits turned off, or the base branch requires a linear history. Linear history means every pull request merged into that branch must use a squash merge or a rebase merge. Pick Squash and merge or Rebase and merge from the merge button instead.

Where do I change which merge methods a GitHub repository allows?

In the repository, open Settings. The General tab opens by default. Scroll to Pull Requests, where Allow merge commits, Allow squash merging and Allow rebase merging sit. If you allow more than one, collaborators choose the method when they merge.

Can a ruleset block a merge method the repository allows?

Yes. A ruleset with Require a pull request before merging can limit the merge methods for its branches. GitHub says that if the repository has disabled a method and the ruleset requires a different one, the merge is blocked, so the two settings must share at least one method.

Review your next PR in Pyor.

Pyor’s merge box updates the branch, merges with any method the repo allows, turns on auto-merge, or joins the merge queue, in the same window you review in. Free for individuals, and it talks to GitHub straight from your machine.