GitHub auto-merge lets you arm a pull request now and have it merge later, once its required reviews and required status checks pass. You switch it on once per repository, then per pull request from the merge box or with gh pr merge --auto. The steps are below, checked against GitHub’s auto-merge docs, followed by why the button sometimes isn’t there and the one setting to check before you trust it.
How to enable auto-merge on GitHub
1. Allow auto-merge for the repository
- Open the repository and click Settings.
- In the left sidebar, click General.
- Near the bottom, under “Pull Requests”, select Allow auto-merge.
It’s off by default. The allow_auto_merge field in the REST repos API starts as false. From the terminal:
gh repo edit --enable-auto-merge2. Enable auto-merge on a pull request
- Open the pull request. You need write access to the repository.
- Optionally, pick a merge method from the dropdown in the merge box.
- Click Enable auto-merge.
- For merge or squash and merge, edit the commit message and choose the author email.
- Click Confirm auto-merge.
With the GitHub CLI, from the pull request’s branch or with its number:
gh pr merge 123 --auto --squash
gh pr merge 123 --auto --rebase --delete-branch
gh pr merge 123 --disable-autoScripts and bots use the GraphQL enablePullRequestAutoMerge mutation, which takes a pullRequestId and an optional mergeMethod. Leave the method out and it uses MERGE.
What auto-merge waits for
Every required review and every required status check. That’s what people mean by “merge when checks pass”, with a catch in the word required. A check your branch protection or ruleset doesn’t list as required won’t hold the merge, even while it’s still running. Until both are satisfied the pull request sits armed and nothing happens. If the merge box stays on “Checking for ability to merge automatically”, GitHub hasn’t finished working out whether the branch merges cleanly; that has its own fixes. If it says merging is blocked, the merging is blocked guide walks through each rule that can cause it.
Why the Enable auto-merge button is missing
- The repository setting is off. Someone with access to Settings has to select Allow auto-merge first.
- The pull request can already merge. GitHub only shows the option on pull requests that can’t merge right away, for example when a rule requires reviews or status checks that aren’t met yet. No required checks and no required reviews means there is nothing to wait for, so you get the plain merge button.
- You don’t have write access. Only people with write permission can enable it.
- The branch uses a merge queue. There the repository setting doesn’t apply and the button reads Merge when ready, which arms auto-merge until the pull request can join the queue. See how the merge queue works.
When auto-merge turns itself off
GitHub disables auto-merge if someone without write access pushes to the head branch, or if the base branch is switched. So a drive-by commit from an outside contributor can’t ride an armed pull request into main. Pushes from people with write access don’t disarm it, and that matters for the trap below. To turn it off yourself, click Disable auto-merge in the merge box or run gh pr merge --disable-auto. The pull request author can do this too, even without write access.
When GitHub made stacked pull requests generally available in October 2026, it said auto-merge for stacks was still rolling out, so check the merge box on your stack before relying on it.
Auto-merge after approval: the good uses
The best case is approved and waiting on CI. Review is done, the reviewer signed off, and the only thing left is a forty-minute pipeline. Without auto-merge someone has to remember to come back, which usually means hours later or the next morning, and every hour it sits is another chance for a conflict. Arm it at approval time and it merges on green instead of whenever someone remembers. Dependency updates are the other good case, after a real look. A Renovate bump whose changelog and diff you actually read is fine to auto-merge behind CI. Auto-merging dependency PRs nobody opened is a different practice, and it isn’t review.
The trap: stale approvals plus new commits
A reviewer approves. The author enables auto-merge. CI fails on a flake or a lint error, so the author pushes a fix, or force-pushes a rebase with a change folded in. The author has write access, so auto-merge stays armed. If branch protection doesn’t dismiss stale approvals, the old approval still counts, and the moment checks go green the pull request merges with commits no reviewer saw. Whether this can happen to you comes down to one checkbox, Dismiss stale pull request approvals when new commits are pushed, part of the required review rules. Once auto-merge is on anywhere, that setting isn’t optional.
Auto-merge reviews nothing
Once merging is automatic, approval is the last human step, and it can’t tell a careful approval from a reflexive LGTM. When a team says auto-merge lowered its quality, the rubber stamps were usually there before; the pause before merging just hid them. A team whose approvals hold up loses nothing and gets hours of unblocked time back each week.
Checklist before you trust it
- Dismiss stale approvals is on for protected branches, or you have a written reason it isn’t.
- Required checks cover the risk. Auto-merge only waits on required checks, so an important suite that isn’t required won’t hold the merge.
- Approvals mean someone read the code. Automation amplifies whatever your approval habit already is.
- Busy repositories consider a merge queue on top, which tests and lands pull requests in order; see the GitHub merge queue setup guide.
Frequently asked questions
How do I enable auto-merge on GitHub?
First someone with access to the repository settings turns on Settings > General > Pull Requests > Allow auto-merge. Then anyone with write access opens a pull request that cannot merge yet, picks a merge method, clicks Enable auto-merge and confirms. From the terminal, run gh pr merge --auto with --squash, --merge or --rebase.
Why is the Enable auto-merge button missing?
Usually one of three reasons: Allow auto-merge is off for the repository, you do not have write access, or the pull request can already merge. GitHub only offers auto-merge on pull requests that cannot merge immediately, such as when required reviews or required status checks are not met yet. On a branch that requires a merge queue you see Merge when ready instead.
Does GitHub auto-merge wait for checks to pass?
It waits for required ones. Auto-merge merges the pull request after all required reviews and required status checks pass. A check that is not marked required in branch protection or a ruleset does not hold the merge, even if it is still running or failing.
Does auto-merge skip code review?
No. Required reviews still gate the merge. But auto-merge adds no scrutiny either: it fires as soon as the requirements read as met, whether the approval was careful or a rubber stamp, and whether it was given before or after the last push.
Why did auto-merge not merge my pull request?
A required review or required check is still missing, so the pull request stays armed. Look at the merge box for what is outstanding. If it sits on "Checking for ability to merge automatically", GitHub has not finished computing mergeability yet. Auto-merge also turns itself off when someone without write access pushes to the branch or the base branch changes.