What happened to Merge when pipeline succeeds? GitLab auto-merge explained

By Melih Toksari, developer of MergeBell · Updated · 3 min read

Short answer

Merge when pipeline succeeds is now auto-merge. Select Set to auto-merge in the merge request's reports section and GitLab merges as soon as every merge check passes. Since GitLab 17.7 that means approvals, resolved threads, no conflicts and not a draft, as well as a successful pipeline, which auto-merge always needs. A new commit to the merge request cancels it, and Cancel auto-merge stops it by hand. From a terminal, glab mr merge sets it while a pipeline runs, and git push -o merge_request.auto_merge sets it as you push.

If you’re looking for the Merge when pipeline succeeds button, it’s now Set to auto-merge, and it does more than the old one did. Here is what auto-merge waits for in 2026, what cancels it, and how to set it from the browser, the command line or the API.

What changed

The old button waited for one thing: the pipeline. Auto-merge waits for every merge check the project has, and merges the moment the last one passes. That behaviour, first called merge when checks pass, has been generally available since GitLab 17.7.

The old name hasn’t quite gone. The API still accepts merge_when_pipeline_succeeds, deprecated since GitLab 17.11 in favour of auto_merge, and there is a matching deprecated push option.

What auto-merge waits for

GitLab merges once all of these are true:

  • every required approval has been given,
  • all threads are resolved,
  • there are no merge conflicts,
  • the merge request isn’t a draft, is open and isn’t blocked by another merge request,
  • a CI/CD pipeline has completed successfully, whatever the project’s pipeline setting,
  • external status checks have passed and no security policy denies it,
  • the title matches any title validation pattern, and any required Jira issue link is there,
  • any Merge after date has passed.

So you can set auto-merge while checks, approvals included, are still pending, and walk away: GitLab merges when the last one passes, with no action from you. If one of these checks is what’s blocking you, why can’t I merge my GitLab merge request? goes through each.

Set it in the browser

  1. Open the merge request and scroll to the merge request reports section.
  2. Optionally choose merge options: Delete source branch, Squash commits or Edit commit message.
  3. If the description closes an issue, check that the issue should close on merge. You can’t change which issues auto-close after auto-merge is set.
  4. Select Set to auto-merge.

You need the Developer, Maintainer or Owner role. A comment with /merge works too: depending on the project, it merges when the pipeline succeeds or adds the merge request to a merge train.

GitLab’s docs add one catch: if you comment after setting auto-merge but before the pipeline finishes, the merge is blocked until all threads are resolved.

What cancels it

  • A new commit to the merge request. GitLab cancels auto-merge so the new changes get a review first. Set it again after you push.
  • New commits on the target branch, on projects that use the merge commit with semi-linear history or fast-forward merge method without automatic rebase before merge. With automatic rebase on, auto-merge can stay active and GitLab rebases at merge time. That change arrived in GitLab 19.3 behind a feature flag that is off by default.
  • You. Select Cancel auto-merge in the reports section while the pipeline is still running. The author can, and so can anyone with the Developer role or higher.

A failed pipeline doesn’t cancel it. Retry the failed jobs, and if they pass, the merge request merges.

From the command line and the API

  • GitLab CLI: glab mr merge turns on auto-merge by default while a pipeline is running. --auto-merge=false merges at once, and --squash, --rebase and --remove-source-branch set the merge options.
  • Git push options: git push -o merge_request.create -o merge_request.auto_merge opens the merge request and sets it to auto-merge in one push. (merge_request.merge_when_pipeline_succeeds is the deprecated name.)
  • API: PUT /projects/:id/merge_requests/:merge_request_iid/merge with auto_merge=true. To cancel, POST /projects/:id/merge_requests/:merge_request_iid/cancel_auto_merge (GitLab 19.5 and later); earlier versions use cancel_merge_when_pipeline_succeeds, which 19.5 deprecated.

Settings that change the picture

  • Pipelines must succeed. In Settings › Merge requests, under Merge checks, a Maintainer or Owner can require a successful pipeline for every merge, auto or not. A merge request with no pipeline at all then can’t merge, and Skipped pipelines are considered successful decides how skipped ones count.
  • Merge can start. On a merge request’s edit page, Merge can start › After scheduled date holds the merge until a date and time you choose (GitLab 17.6 and later).
  • Merge trains. On projects that use them, auto-merge works with the merge train as well, generally available since GitLab 17.7.

Auto-merge from your phone

Setting auto-merge is the step that most often waits until you’re back at a desk. MergeBell’s merge sheet can set a merge request to auto-merge, with squash and delete branch, on the free tier, and it lists every check still failing, so you can see what the merge is waiting for. On Pro, a pipeline watch sends a push if the pipeline fails, with Retry on the notification.

Frequently asked questions

What happened to Merge when pipeline succeeds in GitLab?

It became auto-merge. The button is now Set to auto-merge, and since GitLab 17.7 it waits for every merge check (approvals, resolved threads, no conflicts, not a draft), not only the pipeline. The old name survives in the API's deprecated merge_when_pipeline_succeeds parameter and in a deprecated push option.

How do I set a GitLab merge request to auto-merge?

Open the merge request, scroll to the merge request reports section, choose any merge options such as Squash commits or Delete source branch, and select Set to auto-merge. You need the Developer, Maintainer or Owner role.

Why did GitLab cancel my auto-merge?

Most often a new commit was pushed to the merge request: GitLab cancels auto-merge so the new changes get reviewed. On projects using fast-forward or semi-linear merges, new commits on the target branch cancel it too, unless automatic rebase before merge is on and the retain_auto_merge_with_automatic_rebase feature flag (GitLab 19.3, off by default) is enabled.

Does auto-merge need a pipeline?

Yes. Auto-merge requires a CI/CD pipeline that completes successfully, whatever the project's settings. If the pipeline fails, retrying the failed jobs keeps auto-merge waiting: when they pass, the merge request merges.

How do I set auto-merge from the command line?

With the GitLab CLI, glab mr merge sets auto-merge by default while a pipeline is running; add --auto-merge=false to merge now. With Git, push with -o merge_request.auto_merge. Through the API, call the merge endpoint with auto_merge set to true.

Sources

Checked against these pages on 20 October 2026. GitLab changes quickly — if something here no longer matches, tell us and we will fix it.

Do this from your phone with MergeBell

Free for the whole review loop: the To-Do inbox, diffs and line comments, approve and merge, pipelines with retry, and push alerts for your To-Dos. Works with gitlab.com and self-managed GitLab 16.0+.

Get MergeBell for AndroidiPhone: email me at launch

On Google Play for Android 12 or later. The iPhone app is coming soon to the App Store. An independent app, not affiliated with GitLab Inc.