<!-- Batching | Merget Docs · https://merget.ai/docs/batching -->

# Batching

Test several ready pull requests together and land them as one sequence to spend less time waiting on CI.

Batching lets your CI test several prepared pull requests together before they land. Each pull request still has its own checks, reviews and preparation, and keeps its own commit in the target branch's history.

## What batching does

Merget combines ready pull requests from the front of the queue and puts the result on a temporary `merget/queue/**` branch. Your workflows test that result. The queue reports what CI ran and whether required checks passed.

Ready in sequence means the changes are prepared to follow one another. It does not by itself mean CI tested their combination. Read Batch CI for that evidence.

Illustration: a three-member batch. Forks never join a batch of two or more; a stacked pull request joins one only behind its own parent.

What to look for

- Each member is prepared first and passes its other required checks and reviews. The batch takes ready pull requests from the front of the queue.
- Merget publishes the combined commit on a temporary merget/queue/** branch. Your required CI must run on pushes there.
- A green batch lands in order. Queue mode requires a person to act; Autonomous mode lands it automatically. Failed batch CI is investigated before members land.

## Which modes use batching

| Mode | What happens |
| --- | --- |
| Advisory | No batching; Merget reports findings and an order. |
| Queue | You merge ready members in GitHub in order, or confirm an offered Merge N PRs action. |
| Autonomous | Ready batches land automatically under the configured landing and CI policy. |

## Configure batching

Open Repositories › Configure, and under Advanced open Queue behavior.

Set Land certified sequences as batches. It is on by default for Queue and Autonomous modes.

Optionally set Batch size; empty means no size limit.

Set any additional Required CI checks under CI integration.

In Autonomous mode, review Landing, and the policy for failed CI under Finding and merge policies.

Click Save.

This requires Maintain or Admin access to the repository on GitHub. Ensure your workflows run on queue branches before relying on batch CI.

Batching settings are in Queue behavior, under Advanced.

What to look for

- The batching switch enables combined CI for eligible prepared pull requests.
- In Autonomous mode, Landing chooses Automatic, Merge API or Fast-forward; Queue mode requires your approval.

## Make CI run on batch branches

Add `merget/queue/**` to the push branches for every workflow that produces a check you require. Keep your other branches and triggers:

```
on:
  push:
    branches:
      - main
      - "merget/queue/**"
  pull_request:
    branches:
      - main
```

Check path filters and job conditions too: a push to a queue branch must actually run the required jobs. The same pattern covers [verification of published fixes](https://merget.ai/docs/validation#ci).

Older configurations may still use `sema/queue/**`. Replace that pattern with `merget/queue/**`.

If required checks never report on a batch, Merget can abandon it and temporarily fall back to one pull request at a time. The queue states this limitation. Fix the workflow trigger rather than repeatedly retrying the same missing CI.

Queue branches are temporary and are removed after use. Fork pull requests are not put on these branches, where repository workflows could have access to secrets. Leftover branches under either prefix are deleted too; see [Troubleshooting](https://merget.ai/docs/troubleshooting#batching).

## Required CI checks

The required checks of the branch a batch lands into apply to it. A batch of a stack set to fold is held to those of its root's branch and of the branch the root lands into (see [Stacks that fold](https://merget.ai/docs/branch-queues#fold)). Required CI checks adds more names, one per line or separated by commas. Use the names exactly as GitHub shows them.

If only Merget's own check is required and this field is empty, a batch can become ready without a successful build or test. It reports no CI ran on it when applicable. Require the checks whose failures should stop landing.

With nothing required, Merget still waits for CI that starts on the batch commit, and up to three minutes for some to start. It doesn't wait when nothing could start: the batch commit holds no CI configuration (no GitHub Actions workflow, and no configuration file of another CI service), and nothing but Merget reports on its pull requests. The batch is then ready right after Merget pushes it, and its pull requests' Merget checks say why no CI ran.

## What a batch reports about CI

Open the Queue status control in the header, then read Batch CI under Queue controls › Plan status. Select a batch's name to open its full CI details. The summary distinguishes:

checks that passed;

checks still running;

required checks that have not reported;

required checks cancelled before they started, which judged nothing: inspect the cancellation on GitHub and re-run them when appropriate;

failing required checks;

failing optional checks, including whether they also fail on the target branch;

no CI recorded on the batch commit.

A failing optional check does not stop a batch. A green or ready batch therefore does not necessarily mean every check passed. Follow the failing-check links and read the qualification beside readiness. When CI regressions appears in the header, open it for the affected batches and their check failures; each batch name opens its details and Open run opens its CI run on GitHub. In Queue mode, the merge confirmation names those checks again on each pull request they failed on before you confirm, and says so when checks are still running on a batch it lands or no CI ran on it; see [What "ready" means for each pull request](#what-ready-means).

## Advanced options

These sit beside the batching switch under Queue behavior, and under CI integration, in the drawer's Advanced section. Each field shows its allowed range in the help text.

| Option | What it controls |
| --- | --- |
| Maximum wait (seconds) | How long Merget may wait for nearby preparation to finish before forming a batch. A larger value can combine more changes; a smaller value can start CI sooner. Other queue requirements can still keep a pull request waiting. |
| CI timeout (seconds) | How long required checks may run before Merget stops waiting. The page distinguishes checks that are running from jobs waiting for a runner or approval. If batches repeatedly time out, check runner capacity, approvals, workflow triggers and check names before increasing it. |
| Batches in CI at once | How many of Merget's batch runs can hold your CI runners at the same time, each batch tested on top of the one ahead. Default: 4. Green batches whose checks have concluded don't count. Each is a CI run; see [Several batches in CI at once](#several-batches-in-ci-at-once) for how to size it and what a deeper chain costs. The drawer names the range Merget allows. |
| Cancel CI Merget no longer needs | Whether Merget cancels remaining workflows on its own temporary branches when their result is no longer needed. |
| Cut batches when expected green drops below | Whether a low estimated chance of passing should start a new batch. |
| Check paths (JSON) | Which paths each check exercises, to help identify the change behind a failed batch. |

For example, Check paths can be `{"unit-tests":["src/**","tests/**"],"docs":["docs/**"]}`.

See [Repository settings](https://merget.ai/docs/repository-settings) for passing-lane and other queue options.

## Landing risk

A landing risk · low, medium or high chip estimates how likely the change is to contribute to a batch CI failure. Hover or open the pull request's details for its explanation. The estimate is about the change, not its author, and does not itself block a merge.

With Cut batches when expected green drops below enabled, Merget can end a batch before a higher-risk change, which then waits for the next batch. The queue explains when this affects a batch.

## Several batches in CI at once

Batches in CI at once controls how many batch runs can use CI at the same time. It defaults to 4. Size it for the runners available to this repository and the number of jobs each batch runs in parallel; the settings drawer shows the allowed range.

When available, the drawer summarizes recent batch usage and estimated runner demand, for example "4 batches ≈ 12 runners". Treat this as an estimate, not your account's full runner capacity. Jobs may also wait for an environment approval or a concurrency limit.

### Speculative batch CI

Later batches are tested on top of earlier ones and land after them. A green batch whose checks have finished can wait for a merge while other batches continue testing. Waiting for a batch explains when a prepared pull request must wait for room or for earlier work to move.

More concurrent batches can reduce waiting when CI is usually green. They can also cost more CI time: if an earlier batch fails, a member changes or the target moves, later batches may need to be tested again. Lower the setting when runner demand is high or repeated failures cause costly retests. Your CI provider's usage charges still apply.

Read each batch's status and its CI qualifications. Green · awaiting Merge waits for a person in Queue mode. CI failed (not required), Ready · CI still running and Ready · no CI ran explicitly identify evidence that is incomplete or not entirely passing.

A later batch never lands before the earlier one. A dashboard merge request can cover several batches, including ones that are still testing; the confirmation explains what lands now and what waits for CI. See [What the button covers](#what-the-button-covers).

## Cancelled CI

Cancel CI Merget no longer needs cancels obsolete queued or running workflows on Merget's temporary branches. It does not cancel the pull request's own workflows or target-branch CI. The queue and GitHub explain the cancellation.

This requires Actions: write on the App installation. The settings show an approval link if that permission is missing.

## How a batch lands

A batch keeps one commit per pull request. A fast-forward push lands the tested chain with one merge commit per member. Merging through GitHub uses the configured Merge method for each pull request. Before each merge through GitHub, and before GitHub's stack merge, Merget checks that git's merge of the pull request with the target branch as it is then is exactly what the batch tested; when it is not, Merget merges nothing more and composes the batch again.

## Landing options

In Autonomous mode, Landing offers:

| Option | Behavior |
| --- | --- |
| Automatic | Uses a fast-forward push when compatible with repository settings and branch rules; otherwise merges through GitHub. |
| Fast-forward push | Requests one push of the batch's merge commits to the target branch, together with those of every green batch tested on top of it. |
| Merge API | Merges members in order through GitHub's pull request merge. |

A direct batch push does not squash or rebase, even when a separate Merge method setting selects one of those methods. Queue-mode dashboard sequence requests use a fast-forward push; while native landing is on for the repository, a GitHub stack's layers land in a batch of their own through GitHub's stack merge, under the same request. While it is off, Merget lands no GitHub stack: its layers wait as Waiting — native landing is off (see [Readiness labels](https://merget.ai/docs/states#readiness)), and you merge the stack on GitHub.

If someone re-runs CI on a green batch's commit, the batch goes back under CI: Merget doesn't land it until the re-run passes, and a re-run that fails is handled like any batch whose CI fails. In Queue mode a merge request already standing lands the batch when the re-run passes; with none standing, Merge N PRs is offered meanwhile, as it is while the batch's first CI runs, and a request made then lands the batch when the re-run passes. When Merget lands a green batch on its own, by either path, it also reads the batch commit's required checks again right before landing, and doesn't land a batch whose required check no longer passes.

### Prerequisites for fast-forward landing

The App needs Contents: write, and the target branch's rules must permit its push. Restrictions on pushes, required pull requests, reviews, checks, signed commits or linear history can prevent it. The queue explains a refused action and links to the relevant GitHub rules.

Review any bypass permission in the context of your team's branch policy. Use GitHub merging if you want the pull request merge requirements applied through that path. For a push, GitHub does not evaluate the pull request rules; see [When Merget lands by push](https://merget.ai/docs/security#push-landing) for what Merget checks itself and what it does not. See [Branch protection](https://merget.ai/docs/branch-protection).

## Merge this sequence in Queue mode

When a ready sequence is available, the header offers a filled Merge N PRs action, for example Merge 3 PRs. When the sequence reaches beyond what one push lands now (the green batch, and every green batch tested on top of it), the button's secondary line says what lands now and what next, for example 2 now + 1 next, and its accessible name spells it out ("Merge 3 PRs: 2 now and 1 next for" the repository). It remains available across workspace views, on the page of the queue that holds the start of the merge order. Using it requires Write access on GitHub; coding agents can't.

The action is offered while the queue is landing through a green batch, or through a batch your CI is still testing, and no request is standing. When someone merged a member of that batch by hand or held one back, Merget re-cuts a batch without it, and the action returns once that batch's CI is running.

You don't have to wait for CI to pass. While the batch is still testing, the button's secondary line reads when CI passes: nothing merges on Merget's next pass, and the batch merges by one push as soon as its CI passes, with no second click. The request is made for the batch commit the page shows. If CI fails on the batch, nothing merges and the request stops; the timeline then reads "Merget stopped the merge request (… not merged): CI failed on the batch carrying …". If a required check runs past the CI timeout, or no CI reports on the batch at all, the request stops too. Everything else stops or keeps the request as it does on a green batch. When you asked before the batch's CI passed and a check your target branch doesn't require failed on the batch, each pull request's merge on the timeline says both, for example "requested before its batch passed CI; lint failed (not required)". While Merget is still composing the batch or checking its combined result, there is no commit to ask for yet, and the action isn't offered. Nor is it while a batch in CI holds more pull requests than the loaded page of the queue: it is offered once that batch is green. When a reviewer with Write access requests changes on a member of the green batch, the action is not offered while the request stands, because Merget would not merge that pull request and a batch merges whole or not at all. The batch stays green, and the action returns once the request is approved or dismissed. To merge the rest first, hold that pull request back.

While Merget updates the plan after a pull request opens, or another one is pushed, closed without merging or merged into a branch other than the target, the action stays for the batch at the head, green or still in CI, and the batches tested on top of it; pull requests ready in sequence behind them return with the new plan. A push to a pull request in one of those batches takes that batch, and every batch tested on top of it, off the action at once, and Merget tests them again. After a merge into the target branch, a push to it or a change to the repository's settings, or a push to a pull request in the batch at the head itself, the action is not offered while Merget updates the plan, which can take a few minutes on a long queue, and neither is Merge the passing lane while Merget updates the plan for any reason. A note stands where the action was: "Merget is updating the plan, so Merge is not offered until the new order is ready." The action returns with the new plan when what it covers still stands, counted as that plan has it. See [Stale plans](https://merget.ai/docs/merge-queue#stale-plans).

A green passing lane has its own Merge the passing lane action and request; neither request cancels or blocks the other. See [When the first pull request is not ready](https://merget.ai/docs/merge-queue#when-the-first-pull-request-is-not-ready).

### What the button covers

The action covers the displayed ready sequence, which can be longer than the currently green batch: a batch's members are fixed when it is cut, and the sequence keeps growing behind it. The pull requests behind it may already be in batches tested on top of it. One request covers all of it:

| Pull requests | When they land |
| --- | --- |
| The green batch's members, and those of each green batch tested on top of it that the request covers whole (now) | On Merget's next pass, together, by one fast-forward push to the commit of the last of those batches. CI already ran on each batch's commit, so a chain of green batches lands by one push. Asked while that batch is still testing, they land as soon as its CI passes instead, and the button's secondary line reads when CI passes. |
| Those of each batch tested behind that green chain, still in CI, that the request covers whole (next, already tested) | As soon as that batch's CI passes, by the push that lands it then. A green batch tested behind one still in CI lands with that one. |
| The covered pull requests in no batch yet (next; not while Merget is updating the plan) | Merget puts them in a batch of their own, runs CI on it and lands it when CI passes. |

Nothing after the confirmation needs a second click. The button's secondary line counts the first row as now and the other two as next, for example 4 now + 2 next.

A GitHub stack in the covered sequence lands as a batch of its own, through GitHub's stack merge: Merget never puts a stack's layers and other pull requests in one batch. GitHub merges the layers that batch lands in one merge commit, the topmost layer's. The pull requests ordered ahead of the stack land first, by one push, in a batch of their own; the stack's batch lands when its CI passes, under the same request, and so does a batch of the pull requests behind it.

When a batch already holds the lower layers of a GitHub stack, the offer ends before that stack's layers above them. GitHub's stack merge rebases those layers onto the target branch when it merges the batch, so Merget certifies them again at their new heads and offers them in the next batch, for your next click.

A request that stops inside a batch still in CI covers only that batch's first pull requests: Merget ends that batch at once, before its CI finishes, and cuts a batch of exactly those, which lands after its own CI passes. CI failing on the batch Merget ended doesn't stop your request. A pull request someone holds back in a batch still in CI has the same effect: the pull requests ahead of it in that batch are offered as ready in sequence, and nothing behind the hold is. When a pull request in a batch still in CI only stops reading ready for now, for example because a review was requested or a check is running again, the offer ends before that batch and leaves it whole, so it lands at your next click without running CI again. When a batch behind the green chain has failed CI, the offer ends before it, because what that batch holds is settled first; see [When a batch fails](#when-a-batch-fails).

Merget lands only what the request covers, in the stated order. Read the confirmation's CI evidence and qualifications: a merge being offered does not guarantee that every check ran or passed. See [What stops a request](#what-stops-a-request).

The request applies to the changes you reviewed. A new author push, a reordered queue or changed settings can stop it. The confirmation does not list the conflict resolutions Merget holds in the queue's combined result for these pull requests; open their runs to review them before you confirm. Such a resolution lands with the batch without having been on a reviewed pull request head.

### What "ready" means for each pull request

The confirmation lists every covered pull request in merge order, and each row says which kind of ready it is:

| Row | What it means |
| --- | --- |
| "Tested in batch b-0f3c9a2e — merges now" | In the green batch; CI ran on the commit the push lands. |
| "Tested in batch b-9e8d7c6b on top of b-0f3c9a2e — merges now, by the same push" | In a green batch tested on top of the green one; CI ran on its commit, and the one push lands both. |
| "Tested in batch b-7a6b5c4d on top of b-9e8d7c6b — merges when its CI passes (~8 min)" | In a batch tested behind the green chain whose CI is still running. It lands when that CI passes, under this request. |
| "Tested in batch b-5e4d3c2b on top of b-7a6b5c4d — merges with b-7a6b5c4d, once its CI passes" | In a green batch tested behind one still in CI: the push that lands that one lands this one too. |
| "Ready in sequence, not yet tested with the batch — merges in a follow-up batch after its own CI (~8 min)" | Certified on top of the pull requests ahead of it, but no CI has run on a commit that holds it yet. Not offered while Merget is updating the plan. |
| "Testing in batch b-0f3c9a2e — merges when its CI passes (~8 min)" | Asked for while the batch the queue lands through is still in CI. It lands when that CI passes, under this request; if CI fails, nothing merges and the request stops. |
| "Held back by you — not merged by this request" | A person held it back. See [Hold a pull request back](#hold-back). |
| "Moved to the front by you — tested alone in batch b-7a6b5c4d on top of b-0f3c9a2e — merges when its CI passes (~8 min)" | A person moved it to the front, so it is tested in a batch of its own, never with a pull request that was not moved. It can share that batch with the other pull requests moved there and those they brought, and its row then names them: "Moved to the front by you — tested with #420 in batch b-7a6b5c4d on top of b-0f3c9a2e — …". The row's chip reads Front · by you, or the login of whoever moved it. See [Move a pull request to the front](#move-to-front). |

The time in brackets is the median CI time of this repository's last green batches; without that history, none is shown. A row names the failed checks the target branch doesn't require, for example "· failing, not required: lint": a row in a batch those that failed on that batch's commit, any other row those that failed on the pull request's own head. Merget never blocks on those checks; it names them so you decide with them in view. The pull request's details say the same, for example "Tested in batch b-7a6b5c4d behind the green chain · lands when its CI passes (~8 min)", behind a batch still in CI "Tested in batch b-7a6b5c4d behind b-0f3c9a2e, still in CI · lands once its CI and b-0f3c9a2e's pass (~8 min)", or "Lands next, after its batch CI (~8 min)", and its row in the queue list carries a short tag at any width: "tested in b-0f3c9a2e", "lands next · tested" or "lands next · ~8 min".

### Merge one pull request

When one eligible change is ready, the action can read Merge 1 PR. Review its CI evidence and confirm to request its merge. If the action is unavailable, follow the queue's instructions for merging it in GitHub.

When the sequence has grown behind it, the action counts all of them, for example Merge 2 PRs with 1 now + 1 next. Enter 1 in Pull requests to merge to land the one pull request alone.

### Request the merge

Click Merge N PRs.

Read the repository and target branch, the ordered list and the timing sentence, for example "The first 2 PRs, #412 and #413, merge together on Merget's next pass. The remaining PR, #418, merges automatically when its batch passes CI (~8 min); no second confirmation is needed." How merging works and what can stop it holds the mechanics: the fast-forward push, one merge commit per pull request, stacked pull requests and a refused push.

Optionally enter a smaller count, or tick Hold back #N on a row.

Confirm. The action keeps the header's words and counts what the request merges, for example Merge 3 PRs. With a hold it reads Hold back #418 and merge 2 PRs, or Hold back #413 when the hold is all the click does. The dialog's title and the list's heading count the same request, for example "Merge 2 PRs into main?" over "3 PRs in merge order · 2 merge by this request", or "Hold back #413?" when nothing merges.

Progress then stays above the workspace on every tab. The request survives reloads and is visible to other readers; Activity records who asked.

| Where | What you see |
| --- | --- |
| Progress line | "Merging 3 PRs…" with "2 now · #418 next, after its batch CI (~8 min)", then "2 of 3 merged · #418 next: batch CI running", then "3 PRs merged". "Now" counts every green batch the one push lands, so a chain of two green batches of two reads "4 now". A re-cut reads "Re-cutting a batch of #412 · CI to run (~8 min)". A stopped request reads Merge stopped, the reason and "Merge again when the button returns." |
| Queue status control in the header | Merging while the request stands, whatever else Merget is doing for the queue meanwhile. Open it for Queue controls. |
| Queue controls › Plan status | Batch ends its line with the request, for example "Batch b-9e8d7c6b · 1 PR · CI running on abcdef0 · landing requested by octocat · 2 now + 1 next · 2 landed"; between batches Landing says it with what lands next, for example "Landing requested by octocat · 2 now + 1 next · 2 landed · #418 next". |

### Choose how many

Pull requests to merge is shown when the offer contains more than one loaded pull request. Empty merges all of them. A number N merges through the Nth pull request in merge order: only a prefix can land, because each pull request is prepared on top of the ones before it. To leave out one in the middle, [hold it back](#hold-back) instead.

A number inside the batch, green or still in CI, re-cuts it: nothing merges until the new batch passes CI. The field says so, for example "Through #412 stops inside tested batch b-0f3c9a2e, which re-cuts it: nothing merges until the new batch passes CI (~8 min).", and the old batch reads "abandoned: re-cut to the first pull request at octocat's request". Unchosen pull requests remain queued for a new request.

A value that is not a whole number from 1 to the size of the offer disables the confirmation and says why.

### Hold a pull request back

To merge only some of the ready sequence, hold back the others: a subset is a prefix plus holds. A held pull request moves behind every pull request that is not held, and nothing merges it until a person releases it or a new commit is pushed to it.

Holding one back changes the base of the pull requests behind it, so Merget prepares them again; only those ahead of the first hold keep their certification. Wherever you hold one back, you are told what that costs before you confirm:

| You hold back | What you are told |
| --- | --- |
| A pull request beyond the batch | "Holding back #418 re-prepares #420 and #421 (their base changes) and runs batch CI again: ~8 min. #412, #413 still merge now." While the batch is still in CI, the last sentence reads "#412, #413 still merge when their batch passes CI." |
| A member of the green batch, or of the batch still in CI from the confirmation | "Holding back #413 abandons batch b-0f3c9a2e: nothing merges now. It re-prepares #418 (its base changes). Merget re-cuts a batch of #412 and runs CI on it (~8 min). Ask again when the button returns." A batch merges whole or not at all. |
| A member of a batch still in CI, from its details | "Holding back #413 abandons batch b-0f3c9a2e before it lands. It re-prepares #418 (its base changes). Merget re-cuts a batch of #412 and runs CI on it again (~8 min)." A member of the passing lane abandons the lane the same way, and Merget composes the lane again from the rest. |

Hold back from a row of the confirmation, or with Hold back in the pull request's details, which asks first in a Hold back #N? dialog with the same sentence. Release with Release on its row in the queue list, in its details, or on its row in the confirmation. Anyone with Write access can hold back or release; Merget never releases a person's hold on its own. The queue row reads "Held back by you" (or the login of whoever held it), and Activity records "Held back by octocat" and "Back in order: released by octocat".

Released, a pull request goes back to where it stood when it was held back: right behind the pull request that was ahead of it then, or first if it was first. If that pull request has left the queue, it goes behind the one that was ahead of that one. If Merget has since moved that pull request behind every pull request that can land (it needs its author, Merge what's ready or the Skip what cannot land after setting held it back, or its commit awaits a maintainer's approval), it goes where that one stood, and once Merget puts that one back in order, right behind it again. Two pull requests held back one after the other come back in the order they stood, whichever is released first. It never moves ahead of a batch Merget has already cut without it, one in CI, green or merging, nor ahead of a pull request a standing merge request still has to merge: it goes right behind them instead, the batch is kept, and the request still stands. Moving it back changes the base of the pull requests behind it, so Merget prepares them again. Released before Merget has moved it behind the others, nothing moves: the order stays as it was and a batch it is in is kept, with the CI it already passed. The same holds when the release comes right after Merget moved it, before the batch it was in has been abandoned: it goes back into that batch, which is kept.

When a hold in the confirmation falls inside the batch, green or still in CI, nothing is requested: the confirmation closes and a note stands where Merge was, for example "#413 is held back, so batch b-0f3c9a2e is abandoned and nothing merges now. Merget re-cuts a batch of #412 and runs CI on it (~8 min); Merge is offered again once that CI is running. #418 is prepared again: its base changes." It goes away when Merge returns, or when you dismiss it.

Holding back a pull request a standing request covers stops that request for whatever has not landed; the Hold back #N? dialog says so first, for example "It also stops the merge request octocat made for #412, #413 and #418: what it has not merged stays in the queue until someone asks again." Once its batch is being merged under a request, it can no longer be held back: its details say so where Hold back was, for example "Merget is merging #413 now, under a request that covers it, so it can no longer be held back. Cancel that request first." The same holds for a green batch tested on top of the one being merged when the request covers it whole, since the same push lands it.

Holding back a pull request someone [moved to the front](#move-to-front) ends that move, and the dialog or the confirmation says so first, for example "It also ends #418's move to the front (octocat moved it there)." Released later, it goes back to where it stood before it was moved, not to the front.

### Move a pull request to the front

To land one pull request ahead of the rest, such as a hotfix, move it to the front. Once it is ready, Merget plans it ahead of every pull request not yet in a batch and tests it in a batch of its own: behind the batches Merget has already cut, which land as they are, and behind the pull requests a standing merge request still has to merge. It works in Queue and Autonomous modes. It changes the order only: its preparation, required checks and reviews still decide whether it can land, and Merge anyway stays a separate action. [Move a pull request to the front](https://merget.ai/docs/merge-queue#move-to-front) has the rules in short.

Select the pull request and choose Move to front in its details, beside Hold back. To move several at once, select their rows in the queue list and choose Move N to front above it; see [Select several to move to the front](https://merget.ai/docs/repository-queue#select-to-move). The command menu offers "Move #418 to the front" too.

Read what it costs in the Move #418 to the front? dialog; see [What the confirmation says](#move-to-front-cost).

Say why it goes first under Why does it go first? (required), in at most 500 characters, with no control characters other than tabs and line breaks. The reason is shown on the Activity timeline and on the pull request's Merget check on GitHub, which everyone who can read the repository can see.

Tick what applies: Urgent: don't wait for batches still being composed or in CI, where the repository allows urgent moves (see [Urgent](#move-to-front-urgent)); Also merge when its CI passes, in Queue mode with batching on (see [Merging it in Queue mode](#move-to-front-queue-mode)); and Release the hold octocat put on #418 first, which you must tick when a person holds it back.

Confirm Move #418 to the front: Move 3 to the front for several, Release #418 and move it to the front with the release box, Move #418 to the front now when it is urgent.

Cancel, Esc or a click outside the dialog sends nothing. A refusal keeps the dialog open with your reason in it. Merget refuses a move while it is turned off for the repository, a move of a pull request that has become a draft, even while the queue, planned before that, still lists it, and a move of a layer of a GitHub stack, or of a pull request stacked on one: a GitHub stack's layers land in the stack's order. Once accepted, the details say "Moving #418 to the front: Merget places it once it plans again.", "#418 moves to the front once ready (waiting for missing review)." when it isn't ready yet, or "#418 is already in a batch, or in a merge request, that lands first: nothing moves, and it keeps its place." when Merget takes it in place, as the dialog said: it is in a batch already, a standing merge request covers it, or it rides the passing lane. Several move in merge order, all or none.

#### What the confirmation says

The dialog says what the move does to the queue as it stands, in sentences such as these:

| When | What you are told |
| --- | --- |
| It passes pull requests not yet in a batch | "#418 moves ahead of 7 pull requests not yet in a batch." Behind a pull request someone moved there first: "#418 moves ahead of 7 pull requests not yet in a batch, right behind #420, moved to the front first." |
| It is first among them already | "#418 is already first among the pull requests not yet in a batch." |
| Where it is tested and when it merges | In Autonomous mode behind a batch in flight, "It's tested alone on top of b-0f3c9a2e (~8 min) and merges right after it."; with no batch in flight, "It merges next on its own checks, as soon as it is placed: Merget cuts no batch for a pull request alone at the front in Autonomous mode, so nothing tests it with the target commits its branch doesn't contain." (see [Where it is tested](#move-to-front-batch)). Behind a pull request moved there first that is not in a batch yet, or with one it brings, it shares their batch: "It's tested together with #420, in their own batch, on top of b-0f3c9a2e …". In Queue mode, "… and is ready to merge right after it; tick Also merge when its CI passes, or use Merge.", or with that box ticked "… and merges right after it: Merget files a merge request through #418 that also merges b-0f3c9a2e." Several: "They're tested together, in their own batch, on top of b-0f3c9a2e …" |
| Queue mode with batching off | "It's tested alone on main and is next to merge once its checks pass." Also merge when its CI passes is not offered: Merget asks for no merge there, and the pull request is merged on GitHub. In Autonomous mode with batching off, "It merges next on its own checks, as soon as it is placed: Merget does not batch here, so nothing tests it with the target commits its branch doesn't contain." |
| A passing lane is in flight, and no batch | "It's tested once the passing lane ahead of it lands, alone on main (~8 min), and merges next." In Queue mode it also says who lands the lane: "Nothing is tested for #418 until the passing lane b-4c1d2e3f lands or ends, and only a person lands it: once its CI passes, Merge the passing lane, or merge #415 then #416 by hand, in that order." |
| A standing merge request has pull requests left to merge | "It stays behind #412 and #413, which octocat's merge request still has to merge." |
| No CI slot is free | "It's tested as soon as a CI slot frees (4 batches are in CI, the most this repository runs at once)." |
| It passes pull requests that were prepared already | "Re-prepares #420 and #421 (their base changes)." Each re-preparation is a run like any other; the pull request's receipt lists it as After the queue reordered (see [Plan and billing](https://merget.ai/docs/billing)). |
| It is stacked | "Brings #416, which it is stacked on, to the front with it." A pull request stacked on it: "#419, stacked on it, follows right behind it." Another one stacked on the same parent: "#417, also stacked on #416, keeps its place behind them." |
| It is not ready yet | "#418 isn't ready yet (waiting for missing review): it keeps its place and moves to the front the first pass it is ready. If it is not ready within 24 h, it goes back in order." |
| A person holds it back | "Releases the hold octocat put on #418." |
| Merges are paused | Nothing is composed for the move until merges resume: "Merges are paused: nothing is tested for it meanwhile. Once they resume, it's tested alone on top of b-0f3c9a2e (~8 min) and merges right after it.", or, alone at the front with no batch in flight, "Merges are paused: nothing is tested for it meanwhile, and it merges first on its own checks once they resume. …". An urgent move is tested during the pause (see [Urgent](#move-to-front-urgent)): "… and merges once merges resume." with "Merges are paused: it is tested now and merges first once they resume." |

Every confirmation ends with how long the move lasts ("It stays at the front until it merges, until someone puts it back in order or holds it back, or until it leaves the queue. New commits keep it there.") and "This is what Merget expects from the queue as it reads now; it places the move when it plans again." The figures are an expectation, not a promise: a batch Merget is cutting at that moment can still take a pull request the move was expected to pass.

Move to front is disabled, with the reason under it, where there is nothing to move past or no room: "#418 is already in batch b-0f3c9a2e, which Merget lands as it is; there is nothing ahead of it to move past.", "#418 is covered by octocat's merge request already; it merges with it.", "Merget is merging #418 now, so there is nothing to move it ahead of.", or "#420 and #421 stand at the front already, the most this repository allows (2). Put one back in order first."

#### When it is ready

Merget moves it to the front once it is ready where it stands: prepared, every required check and review passing but Merget's own, no hold on it, and for a fork or bot pull request a commit a maintainer approved. Every pull request it is stacked on that is not in a batch yet must be ready too. A preparation still running counts as not ready. One blocked only waiting on pull requests ahead of it, for example for an interaction found only over them, counts as ready when the move passes every one of them: Merget prepares it again at the front, where they are no longer under it, and that preparation decides whether it can land; the authors of the pull requests it passes deal with the interaction instead. Its own reviews and required checks still count beside that wait: when a change request, a missing approval or a failed required check sends it back from the front, or a required check still running there after 30 minutes, it waits in those words until that clears. Merget reads its reviews and checks on that commit again after every review submitted or dismissed and every check that finishes there, one that finishes while Merget is reading them included: once nothing it was sent back for still stands, it moves to the front again at once, and while something does, it keeps waiting in the words of what still stands. A check that never finishes keeps it waiting until the move expires. A moved target branch does not lift that wait; a push does, and so does its preparation where it stands settling, once the pull requests it waits on land or leave the queue. When one of them stays ahead of the move, because it is in a batch, in a merge request, or was moved to the front first, it is not ready, and its details read "waiting for its preparation, which waits on #412 ahead of it", or, once a review or a check sent it back from the front at this commit, that review's or check's words. Until then it keeps its place, its row reads Moves to the front once ready, and its details say what it waits for, for example "waiting for missing review". The first time Merget finds it ready, it is placed, with no second click.

If it is not ready within the repository's limit, a day by default, it goes back in order, and the timeline reads "Back in order: not ready within 24 h of its move to the front". Once at the front, it never goes back in order for time.

At the front, it goes back to waiting at its own place only for a definite reason: a hold Merget took on it, new commits, its preparation at the front blocked, its batch's CI failed on it, its batch ended without a CI result, a reviewer requested changes or an approval is missing, a required check failed, or a pull request it is stacked on can no longer come with it. A required check still running, or GitHub still working out whether it can merge, keeps it at the front for up to 30 minutes. A preparation that is running never sends it back, and neither does one blocked only waiting on pull requests still ahead of it, for example for an interaction found only over them: that wait is theirs while they are ahead. The timeline then reads "Back at its place until it is ready again: waiting for …", and it moves to the front again once it is ready, but for a commit that already failed at the front. When its preparation at the front was blocked, for example because it conflicts with the pull requests ahead of it, or its batch's CI failed on it, it waits for a push, and its details read "waiting for a push: this commit already failed at the front". A moved target branch does not lift that wait, and neither does a clean preparation at its own place. A fix you submit to Merget for its batch, or a conflict resolution you submit for merge time, counts as a push once Merget accepts it: it then moves to the front again when it is ready, and carries what you submitted. When the one that failed at the front is a pull request it is stacked on, it waits for a push to that one ("waiting for #418, which it is stacked on: a push: this commit already failed at the front"). When the conflicts are its author's to resolve, it also moves behind every pull request that can land, as any pull request that needs its author does. When its batch at the front ended without a CI result, because a required check ran past the CI timeout, no CI reported on the batch, or Merget's check of the batch's combined result was interrupted, it waits for the target branch to move, and its details read "waiting for the target branch to move: its batch at the front ended without a CI result". Meanwhile it is an ordinary pull request at its own place, and the queue behind it carries on as it would without the move. Once the target branch moves it moves to the front again when it is ready, and Also merge when its CI passes asks for its merge again once its new batch's CI is running. The repository's limit for a waiting move applies.

In Queue mode a fork pull request can be moved but never reaches the front: a fork is never tested on Merget's queue branches, so it waits for a merge on GitHub and goes back in order at the limit. A moved pull request that becomes a layer of a GitHub stack, or is stacked on one, never reaches the front either: it waits where it stands, as "a merge in its stack's order", until it leaves the stack, and goes back in order at the limit.

#### Where it is tested

A pull request moved to the front is tested in a batch of its own, together with the other pull requests moved there and those they brought, never with pull requests that were not moved, and its batch never waits for Maximum wait. It takes the next free CI slot: Batches in CI at once still applies, and nothing is abandoned to make room for it unless it is urgent. Its batch is tested on top of the last batch already in flight, or on the target branch when there is none, so a batch ahead of it that fails still delays it: its own batch is tested again.

In Autonomous mode a pull request alone at the front with no batch in flight is no batch: Merget cuts none for it and merges it through GitHub's merge API on its own checks as soon as it is placed, or first once merges resume when the queue is paused, so nothing tests it with the target commits its branch doesn't contain. Behind a batch in flight it is tested alone on top of that batch, in a batch of its own; with other pull requests moved to the front, or those they brought, it shares theirs. While merges are paused, nothing is composed for a pull request moved to the front until they resume, unless the move is urgent.

An ordinary move never abandons a passing lane. When the moved pull request would be tested at the head of the queue while a lane is in flight, it waits for that lane to land or end, and so does a move that would bring a pull request riding the lane. In Queue mode the lane lands only when someone uses Merge the passing lane or merges its pull requests by hand, and Also merge when its CI passes asks for the moved pull request's merge once its own batch's CI is running, after the lane.

#### Merging it in Queue mode

In Queue mode nothing merges without a person's request. Tick Also merge when its CI passes, and Merget asks for the merge in your name once its batch's CI is running, through it and every batch ahead of it, so it lands when its CI passes with no second click. If a person's merge request already covers it, nothing more is asked; if one stands that does not, Merget asks once that one has ended. Without the box, use Merge N PRs when it is offered. The confirmation of a standing request names it, for example "Merget's request through #418 (moved to the front by octocat)", and the timeline reads "Merget asked to merge through #418, moved to the front by octocat: it merges when its CI passes". A pull request already riding the passing lane when it is moved keeps its place there, and the box has Merget ask for Merge the passing lane in your name once the lane's CI has passed: the lane members' checks and details say so while its CI runs, "Merget asks for the passing lane's merge in octocat's name (#418 was moved to the front with Also merge when its CI passes) and moves main to the batch commit by one fast-forward push", and add "Do not merge members by hand meanwhile." once it has passed; the lane lands by one push, the pull request it passes stays where it is, and the timeline reads "Merget asked to merge the passing lane ahead of #412 as one push: it carries #418, moved to the front by octocat — #415, #418".

Merget keeps at most one such request standing for a move. It asks again after a request the queue stopped, such as for new commits, a failed batch or a changed order. It doesn't after someone cancels the request, after you lose Write access or leave the organization, after the request expires, after the repository's settings or target branch change, or after Merget declines the push the request asked for, for example because the target branch requires reviews the Merget GitHub App cannot bypass: the move stays, and the timeline reads "No longer merges on its own when its CI passes:" and why, for example "Merget's push was declined (the target would refuse a direct push: …)". After a declined push its batch stays green; see [When the push is declined](#when-the-push-is-declined). A person's Merge N PRs replaces the request Merget made, unless its batch is being merged already, and the timeline reads "octocat's merge request replaced the one Merget made for #418's move to the front".

The box is offered only in Queue mode with batching on. Autonomous mode merges it on its own; with batching off, it is next to merge on GitHub once its checks pass.

#### Urgent

An urgent move does not wait for the batches ahead of it. It is offered only where the repository's Urgent moves to the front setting allows it (off by default), to people with the access that setting names. When the move is placed, Merget abandons every batch still being composed or in CI ahead of it, failed ones included, and any green batch tested on top of one it abandons, and re-cuts them behind it. Their CI is cancelled where Cancel CI Merget no longer needs is on and the App has Actions: write; otherwise it keeps running and is not used. Merget keeps the green and merging batches at the front of the chain, a batch a standing merge request covers, the batch a standing Merge anyway names, and the batches of pull requests moved to the front before it, whether they were moved ahead of others or were already in a batch. It abandons a passing lane still in CI too, unless the lane carries a pull request moved to the front before it or one a standing merge request covers. The urgent pull request is tested on top of the last batch kept, or on the target branch, and lands as soon as its CI passes: in Autonomous mode on its own, first once merges resume when the queue is paused; in Queue mode by the same push as the green batches kept, under Also merge when its CI passes or a person's Merge N PRs. In Autonomous mode with nothing kept ahead of it and nothing moved to the front with it, it is no batch (see [Where it is tested](#move-to-front-batch)): it merges on its own checks as soon as it is placed, or first once merges resume, and nothing is tested during the pause.

The dialog names what it abandons and what it keeps, for example "Urgent: abandons b-1a2b3c4d and b-5e6f7a8b, still being composed or in CI, and cancels their CI; Merget re-cuts them behind #418. b-0f3c9a2e (green) is kept, and #418 is tested on top of it and lands by the same merge.", or "Urgent changes nothing here: no batch is being composed or in CI ahead of it." A batch or passing lane still in CI that it keeps is named with the reason, for example "It still waits for b-5e6f7a8b: #420, moved to the front first, rides it." Each batch it abandons reads "abandoned: #418 was moved to the front by octocat (urgent); Merget tests it first and re-cuts this batch behind it".

Merget abandons them without waiting for the pull request's preparation at the front. If that preparation then blocks or needs its author, the pull request goes back to waiting, and the CI of the batches it abandoned was spent for nothing; the dialog says so: "If its preparation at the front then needs its author, that CI is spent for nothing."

Urgency acts when the move is placed, and again only when it is placed afresh, for example after new commits are ready. A batch composed behind it is never abandoned for it, and neither is a batch that turns green, or starts merging, before Merget abandons it: Merget places the move afresh and keeps that batch. A pull request already in a batch, or covered by a standing request, abandons nothing: it is in place. If the repository turns urgent moves off, a standing urgent move becomes an ordinary one ("No longer urgent: this repository turned urgent moves off"); what it abandoned stays abandoned.

#### How it ends

Back in order, beside the pull request's row in the queue list or in its details, ends the move without asking first. Merget puts it back where it stood when it was moved, right behind the pull request that was ahead of it then, walking back as a [release](#hold-back) does when that one has left the queue or Merget has moved it behind every pull request that can land, and to where that one stood when its author restacked it onto another pull request since, so it never lands ahead of a pull request it stood behind, and never ahead of a batch Merget has already cut or of a pull request a standing merge request still has to merge. The details say "Back in order: Merget puts it back where it stood once it plans again." It also withdraws the merge request Merget made for the move, if one stands. A move still waiting moves nothing.

Back in order never takes a pull request out of a batch. In a batch already, whether the move put it there or it was in one when it was moved, it keeps its place in that batch and still lands with it: first, when its batch is the next to land. Its details say so before you press it ("It lands with that batch: putting it back in order ends the move but leaves it there, and holding it back takes it out.") and after, for example "Back in order: the move ends, but #418 keeps its place in batch b-0f3c9a2e and lands with it. Hold it back to take it out.", or "… stays in batch b-0f3c9a2e, which Merget is merging now." while Merget merges that batch. A pull request a person's standing merge request covers stays in it too: "Back in order: the move ends, but #418 stays in octocat's merge request and merges with it. Holding it back stops that request." To keep it from landing with them, [hold it back](#hold-back) instead. A pull request whose own stacked child was moved to the front too stays there as that child's parent, since a child is never tested ahead of its parent: "Back in order: #418's own move ends, but it stays at the front as #419's parent while #419's move stands." Activity says the same; Back in order on #419 takes both back.

A move also ends when the pull request merges, closes, becomes a draft or leaves the queue, when a person holds it back, when it waits past the repository's limit, when the repository is switched to Advisory mode, and when Merget is turned off for it. Reopening the pull request, or turning Merget back on, does not bring the move back. New commits keep it, and so do Merget's retarget of a stacked pull request after its parent merges and a restack onto another queued pull request. Holding back a pull request a move brought with it ends nothing: the move waits until that hold is released.

#### Who can move pull requests to the front

Anyone with the access the repository's Who can move a pull request to the front names, Maintain on GitHub by default, can move one to the front and put it back in order; an urgent move needs the access Urgent moves to the front names. At most Pull requests at the front at once stand there, two by default. A coding agent can do it with your access unless the repository's Agents may move pull requests to the front is off; the timeline then says "via an agent". See [Queue behavior](https://merget.ai/docs/repository-settings#queue-behavior).

The queue list marks each move: Front · by you, or the login of whoever moved it (Front · urgent · by … for an urgent one, Front · with #418 on a pull request it brought), or Moves to the front once ready while it waits. Activity records "Moved to the front by octocat: “hotfix for checkout”", "Placed at the front: ahead of 7 pull requests not yet in a batch, behind b-0f3c9a2e" and "Back in order: octocat put it back in order", and the pull request's Merget check says who moved it and why; a pull request a move brought with it says so on its own check too: "Moved to the front of the merge queue with #419, which is stacked on it, by octocat". A pull request a move passed says so in what it waits for: "#418 was moved to the front by octocat."

### What stops a request

A request can stop when an author pushes new commits, a person holds back a covered pull request, the order or target changes, a covered pull request leaves the queue, settings change, required CI fails, a push is refused, the repository leaves the organization (its GitHub account is removed, moved to another organization or uninstalled), or the request expires. The progress line states the reason and "Merge again when the button returns." (for the passing lane, "Merge again when green.")

Moving a pull request to the front never stops a request, urgent or not: it goes behind the pull requests the request still has to merge.

Merget's own necessary update to a covered branch can be followed by the request; Activity records that. A commit on the target branch that Merget did not land does not stop a request either: Merget certifies the rest again on top of it and lands them with no second click, and a passing lane that merges covered pull requests counts as progress. Whatever already merged stays merged. Waiting for a review or CI does not itself cancel a request, and neither does a covered pull request waiting on one ahead of it for an interaction found only over it.

### Cancel a request

Click Cancel beside progress. Anyone with Write access can cancel. This stops merges not yet underway; it cannot reverse a completed merge or a push already in progress. A GitHub stack merge Merget has already requested continues too: GitHub is merging the stack, and Merget records what it merges.

### When the push is declined

Read the reason, correct the permission or branch rule if appropriate, and request the merge again when offered. You can also merge in GitHub in the stated order. A declined sequence push does not silently switch to another merge method.

A reason that says "GitHub refused the push of Merget's queue branch" quotes GitHub's own error: a rule of the repository, its organization or its enterprise covers the temporary `merget/queue/**` branches, for example a ruleset that restricts creations or requires signed commits. An admin can exempt `merget/queue/**` from the rule or add the Merget GitHub App to its bypass list. Merget does not cut a batch of the same pull requests over the same target branch again by itself for a day, even once the rule is lifted, so Merge comes back for them once the target branch moves, one of them gets new commits or the day has passed. Until then, merge them in GitHub in the stated order.

### Merge by hand instead

You can merge in GitHub in the order the checks give. Where the target branch requires branches to be up to date and only Merget's push lifted the limit of one (see [Strict protection limits batches to one pull request](#strict-protection-limits-batches-to-one-pull-request)), the checks offer the dashboard's Merge N PRs first instead (see [Merge this sequence in Queue mode](#merge-this-sequence-in-queue-mode)): a member merged in GitHub leaves the next one out of date, and the update that brings it up to date ends the batch. If a member lands manually, Merget may rebuild and retest the rest before offering a new sequence action; a member merged out of order moves the target under every batch, and Merget re-validates the rest in new batches rather than preparing them again (see [When the target moves under a batch](#target-moved)). A standing dashboard request survives a covered pull request merged by hand at the commit it covers, even out of order: the rest are re-validated over the new target and still land under it. New commits on a covered pull request, or one merged at another commit, still cancel it.

### If the button is refused

The dialog remains open and explains why, for example a changed sequence, insufficient access, a batch that is no longer ready or a request someone else already made. Read the refreshed offer before confirming again.

A member of the batch, green or still in CI, held back after the page read it is refused with, for example, "#413 is held back; a batch lands whole or not at all, so Merget is re-cutting it without #413 — the button returns once the new batch's CI is running." Wait for the re-cut batch, or release #413 first.

A member of the green batch a reviewer requested changes on is refused with, for example, "#413 has changes requested by a reviewer; a batch lands whole or not at all, so nothing of it merges while the request stands — the batch stays green, and the button returns once the request is approved or dismissed." Until then the queue page says why on each member's row and on its badge's hover, ending "#413 has changes requested by a reviewer, so no Merge lands the batch until the request is approved or dismissed."

## When the target moves under a batch

When a hotfix or another merge changes the target branch, a batch tested against the earlier target can be abandoned. Batches tested on top of it are rebuilt too. Abandoned does not mean those pull requests were closed or that their code failed.

Merget checks the remaining pull requests on the new target and tests the updated batches before they land. Pull requests can show Re-validating or Preparing during this work. Read the replacement batch's CI rather than relying on the old batch's green result.

A standing merge request can continue across this target update; its progress line shows what remains. If the request stops for another reason, the queue explains why and asks you to merge again when the action returns. See [What stops a request](#what-stops-a-request).

The pull request's Merget check and Activity record the new result. See [After the target moved](https://merget.ai/docs/pr-check#revalidated) and [When the target moves under the queue](https://merget.ai/docs/merge-queue#target-moved).

## When a batch fails

To see what a batch tested and why it failed, press its name, such as b-f9c97304, wherever the queue page offers it as a button. Its [details](https://merget.ai/docs/repository-queue#batch-details) link the CI run, list each failing check against the commit the batch was built on, and show the error lines from the job's log when Merget read them. A check that fails on the batch's commit and passes on that base is named inside Now as soon as it fails, while the batch is still in CI. Open Now in the header to read it, and Next batches inside that panel when offered for work following the current batch. While the batch is in the queue, Fix with your agent in the details, and under Breaks in the queue in Needs you, copies a prompt for your coding agent that reproduces the failure on the exact commit and fixes it on the pull request's branch.

### Isolate the failing change

By default, Merget uses batch bisection to isolate the failure. It tests smaller groups of pull requests on temporary `merget/queue/**` branches to find the change that broke the batch. The queue reads CI failed; isolating the cause. Pull requests that pass together can continue; the one identified as the cause needs a fix and a new push.

If Merget cannot single one out, the remaining pull requests are tested again separately.

If every failing check also fails on the target-branch commit the batch was built on, there is nothing to isolate and no member is blamed. The batch reads "abandoned: required check ci also fails on `main` at abc1234; nothing to isolate: the pull requests are batched again, judged on the other required checks", and the next batch's checks name the other checks that judge it. When that is the only required check, nothing can judge a batch: it reads "… nothing to isolate, and this composition is not retried while the trunk stands", and the pull requests land one at a time. Fixing the target branch remains necessary; a failure excluded from batch judgment has not become a pass.

Instead of pushing a fix, anyone with Write access can submit the fix to Merget from the batch's details or through an agent: Merget tests the batch again with it and lands it with the pull request, without changing the branch. See [Submit a fix to Merget](https://merget.ai/docs/batching#submit-a-fix).

## Submit a fix to Merget

When a batch's CI fails, the first way to fix it stays as it is: fix the pull request's branch and push it, as Fix with your agent describes. The second way leaves the branch untouched. You, or your coding agent, hand Merget the fix itself; Merget keeps it beside the pull request, tests the batch again with it, and lands it together with the pull request. Use one way or the other for a batch, not both: a push to the pull request's branch sets a submitted fix aside.

It is offered in Queue and Autonomous mode, for a batch whose CI failed, once its CI has finished. Such a batch keeps its Fix with your agent prompt in its details while it takes a fix, also once the queue has moved on from it, and the prompt then also says how to submit the fix to Merget.

### How to submit one

Open the batch's [details](https://merget.ai/docs/repository-queue#batch-details): press its name, such as b-f9c97304, anywhere on the queue page, or its row in the [Batches](https://merget.ai/docs/repository-queue#batches) tab.

Reproduce the failure on the commit Reproduce on names, fix it there, and run the failing checks' commands again.

Write the fix as a patch against that commit, new files included. The prefixes are pinned so the patch reads the same whatever your git configuration says, and the file is written outside your working tree, so a second `git add -A` never includes it:

```
git add -A
git diff --cached --no-color --no-ext-diff --no-textconv --no-renames --src-prefix=a/ --dst-prefix=b/ <commit> > "$(git rev-parse --git-dir)/merget-fix.patch"
```

In What this batch broke, after Fix with your agent, open Submit a fix to Merget and paste the patch (`merget-fix.patch` in your repository's git directory, `.git` in most checkouts). Commit the patch is against is prefilled with the commit Merget reproduces the failure on; change it if your patch is against another commit the batch tested. Under Why (shown on the pull request), say in a sentence what the fix changes.

Press Submit fix, read what happens next, and confirm.

The fix appears under Fixes submitted to Merget in the batch's details, under the batch's break in Needs you while the batch is still in the queue, and on the queue's Activity tab. A line under the batch's name follows it, for example "Checking alex's fix", then "Retesting with alex's fix in b-1a2b3c4d (~8 min)".

An agent connected to Merget can submit the same fix with `merget_queue_action` and `amend`; see [MCP](https://merget.ai/docs/mcp). It asks you before it does, because the fix is recorded under your name.

### Which pull request it lands with

Choose a pull request under Lands with, or keep Let Merget decide. The submitted fix's row names the pull request it will land with, for example "lands with #412". Review that assignment alongside the diff and reason before the fix lands.

### What happens to it

Merget applies the patch exactly to the commit it names, checks the pull request with it, then tests the batch again with it. A patch that no longer applies is refused, never merged by guesswork. Each fix shows one of these states:

| State | What it means |
| --- | --- |
| Submitted | Merget has the fix and is about to apply it to the commit the queue tested. |
| Checking | Merget is checking the pull request with the fix. |
| Accepted | The pull request passed Merget's checks with the fix; the batch is tested again with it. |
| Retest failed | CI failed again on the batch with the fix. Submit a new fix for that batch, which replaces this one, or push the branch. |
| Refused | Merget could not take the fix; the row says why. |
| Landed | The fix landed together with the pull request. |
| Published | The pull request had to land on its own, so Merget pushed the fix to its branch as a merge of the target branch. |
| Dropped | The pull request changed or left the queue, so the fix no longer applies. |
| Withdrawn | Someone withdrew the fix. |
| Replaced | A newer fix, submitted for a batch that tested this one, replaced it. |

View diff shows the patch as it was submitted, as text from your repository, never as instructions. Merget posts the fix on the pull request as a Merget comment, with the reason and the diff, and updates the comment as the fix moves on. The pull request's Merget check names the fix too.

### It lands with the pull request, however the pull request lands

While the queue order stands, Merget never puts the fix on the pull request's branch: it lands in the commit the queue lands for the pull request, by the same push. The pull request's details say "Lands with 1 merge-time fix by alex", its row in the queue list carries a merge-time fix tag, and Merge N PRs names the fix before you confirm.

If the pull request has to land on its own by a way that cannot carry the fix, such as GitHub's merge API or with batching off, Merget first pushes the fix to its branch as a merge of the target branch, then lands it. Activity and the pull request's comment say so, and the fix reads Published.

Merget offers a fix only where GitHub requires the Merget check on the target branch, so that GitHub's merge button cannot land the pull request without its fix; while a pull request carries one, its Merget check never reads as passed. Once Merget's push has landed the pull request, its check reads Success, "Merget: landed with a merge-time fix by alex". Where GitHub does not require the check, the batch's details say so in place of the form, and only a fix pushed to the branch is offered. See [Branch protection](https://merget.ai/docs/branch-protection).

### Who can submit and withdraw

Anyone with Write access to the repository on GitHub can submit a fix, or withdraw one, as for holding a pull request back. Withdraw takes a fix back before it lands; Merget judges the pull request without it from its next pass. One fix stands for a pull request at a time. A new fix submitted for a batch that tested the standing one, such as its retest when that fails, replaces it; otherwise withdraw the standing fix before you submit another.

### Limits

A fix is a text diff of at most 1 MiB. Binary content, symbolic links and submodules are refused.

It cannot change anything under `.github/` or `.opencode/`, a `CODEOWNERS`, `.gitattributes` or `.gitmodules` file, or a root `opencode.json` or `opencode.jsonc`: the paths Merget never writes.

The reason is required, at most 500 characters, with no control characters other than tabs and line breaks, and appears on the pull request.

The paste box cannot keep carriage returns: a browser turns every line ending in it into a plain newline. A fix to a file with Windows (CRLF) line endings would then no longer apply, so submit it through an agent or the [API](https://merget.ai/docs/api#submit-a-fix), which send the patch byte for byte.

Merget keeps a submitted diff until 90 days after the pull request closes; see [Security](https://merget.ai/docs/security).

Accept fixes and conflict resolutions submitted to Merget in the repository's [Queue behavior](https://merget.ai/docs/repository-settings#queue-behavior) settings turns this option off, and the [resolution of a pull request's conflicts for merge time](https://merget.ai/docs/conflict-resolution#resolve-for-merge-time) with it. Fixes already submitted carry on to their end and can still be withdrawn; fixing the branch works either way.

## When a batch cannot land

Needs you names a refused merge or failed batch and offers available actions. Review the consequences before confirming an exceptional merge.

### Land it now (Autonomous mode)

A ready batch that GitHub refused to merge may offer Land it now. This requests a direct push instead. The dialog names the refusal, affected pull requests and target branch. It works only where the App's permissions and branch rules allow that push. It pushes past the merge GitHub refused. Where GitHub's refusal names a code-owner review, an unresolved conversation or review threads, Land it now is not offered: a direct push would skip that requirement, so Merget lands the batch on its own once the requirement is met. Land it now is not offered for a GitHub stack: GitHub merges its layers itself. While native landing is on, Merget lands it once GitHub reads it mergeable; otherwise, merge it on GitHub. It requires Write access: any member of your organization with Write access to the repository can request it.

### Merge anyway

Merge anyway can request landing a certified batch despite failed required CI. The dialog names the failures, what Merget verified, and the possibility of leaving the target branch red. The action requires Write access and is recorded as landing over failing CI. Any member of your organization with Write access to the repository can request it. Merge anyway is not offered for a batch holding a GitHub stack's layers: GitHub merges them itself, so fix the failing check, or merge the stack on GitHub.

It does not remove other eligibility requirements. A paused queue or a branch rule the App cannot bypass can refuse it, and so can a ruleset GitHub does not tell Merget the App may bypass: GitHub shows a ruleset's bypass list only to readers that may edit the ruleset, so Merget relies on GitHub's answer for the App itself. The refusal names the rule and the way out.

### Land on Merget's verdict without asking (Autonomous mode)

When CI fails on a certified batch defaults to Find the failing pull request. The alternative Land it anyway on Merget's verdict allows automatic landing after required checks conclude, despite a failure, where the branch allows it.

Only when Merget built and tested it itself limits this option to verified work and is on by default. Read the setting and the recorded verification before enabling it. Such a landing is recorded as made by Merget on its own verdict; no person confirms it. Queue mode still requires a person's merge request.

## Strict protection limits batches to one pull request

GitHub's Require branches to be up to date before merging can limit batching to one member, because landing a member leaves the next branch behind. A fast-forward push lands a whole batch at once, so it lifts that limit wherever the target branch allows Merget's push (see [Prerequisites for fast-forward landing](#prerequisites-for-fast-forward-landing)):

In Queue mode, Merge N PRs always lands by that push, a GitHub stack's layers excepted (while native landing is on, they land in a batch of their own through GitHub's stack merge; while it is off, Merget lands none of them), so two or more ready pull requests are batched as on any branch. Where a ruleset on the branch requires pull requests or restricts updates, the push needs the Merget GitHub App to bypass that ruleset (Always allow), and GitHub to say so: it shows a ruleset's bypass list only to readers that may edit the ruleset, so Merget reads GitHub's answer for the App itself. Where GitHub does not say the App may bypass the rule, members are merged one at a time through GitHub, and the queue says why. A pull request that is ready on its own is left for you to merge in GitHub on its own checks, since a batch of one would first wait for CI on its merge commit. A pull request moved to the front is not: it was asked for in exactly that batch, so Merget tests it alone in a batch of its own, which Merge N PRs, or Also merge when its CI passes with no second click, lands by the push (see [Where it is tested](#move-to-front-batch)). Where the branch lets Merget's push skip that CI (it requires no check but Merget's, or its ruleset always lets the Merget GitHub App bypass the required checks), the pull request is offered as Merge 1 PR at once instead. The queue says which applies.

In Autonomous mode, the push lifts the limit under Fast-forward push landing, and under Automatic landing when it uses the push. Under Merge API landing nothing lifts it.

Where the limit applies, the queue shows it and why. An organization owner with the needed GitHub permissions can use Turn off strict, or choose a compatible Autonomous landing configuration, or, where the queue names what blocks Merget's push, remove it. See [Branch protection](https://merget.ai/docs/branch-protection#turn-off-strict-from-merget).

## Pull requests that are never batched

Fork pull requests land separately, and only once a maintainer approved the commit. A stacked pull request joins a ready sequence only when its parent can land before it in that sequence and the landing method supports it. See [Stacked pull requests](https://merget.ai/docs/stacked-pull-requests#landing-with-the-parent).

A pull request that changes a GitHub Actions workflow file is batched like any other when the installation grants the Merget GitHub App the Workflows permission. Without it, GitHub refuses Merget's push of a merge that writes workflow content none of your branches has yet, for example when the pull request changes a workflow file that the target branch also changed after the pull request branched. Merget hands such a pull request to you before pushing it: the batch's reason, the pull request's entry in the queue and a comment on the pull request name the file, the pull requests ahead of it land without it, and Merget doesn't batch or merge it again while its commit stays the same. Grant the permission, or merge the pull request on GitHub. A fork's workflow change is never merged by Merget, with or without the permission. See [Security](https://merget.ai/docs/security#code-execution).

## Batch labels and states

The queue, selected pull request and GitHub check name the batch and its current state: preparing, CI running, ready, landing, landed, failed or abandoned. A passing lane names the pull request it moves ahead of. See [Statuses and outcomes](https://merget.ai/docs/states#batch-states).

### Why a batch is abandoned

Abandoned means that batch ended without landing. Its pull requests can still continue in a replacement batch. Common reasons include changed commits or order, a moved target (its members are then re-validated in a new batch: [When the target moves under a batch](#target-moved)), changed settings, a missing CI result, a failed combined check, a manual merge, a member held back, choosing a smaller sequence, or an [urgent move to the front](#move-to-front-urgent) ("#418 was moved to the front by octocat (urgent); Merget tests it first and re-cuts this batch behind it").

Read the reason before retrying. For repeated missing CI, check the queue-branch workflow trigger and required check names first.
