Skip to main content
The wit merge-queue command provides automated merge queue management for pull requests. The merge queue ensures PRs are tested against the latest base branch before merging, preventing broken builds.

Overview

Why Use a Merge Queue?

Without a merge queue, this can happen:
  1. PR #1 passes CI on main at commit A
  2. PR #2 passes CI on main at commit A
  3. PR #1 merges, main is now at commit B
  4. PR #2 merges without retesting against B
  5. main is now broken because #2 conflicts with #1’s changes
With a merge queue:
  1. PRs are queued for merging
  2. Each PR is rebased on the latest main and tested
  3. Only PRs that pass against the current main are merged
  4. Your main branch stays green

Commands

add

Add a pull request to the merge queue.

Options

Examples

This command requires the server-side merge queue API to be implemented.

remove

Remove a pull request from the merge queue.

Examples


status

Check the queue position and status of a pull request.

Examples

Example Output


list

List all pull requests in the merge queue.

Options

Examples

Example Output


stats

Show merge queue statistics.

Options

Example Output


config

View or update merge queue configuration.

Options

Strategies

Examples

Example Output


enable

Enable the merge queue for a branch.

Options

Examples


disable

Disable the merge queue for a branch.

Options

Examples


Queue States

PRs in the merge queue go through these states:

Workflow Examples

Basic Merge Queue Workflow

Priority Handling

Monitoring the Queue


Best Practices

Smaller PRs reduce queue time and are less likely to conflict:
  • Faster CI runs
  • Lower chance of conflicts with other PRs
  • Easier to review and merge
Reserve high priorities for urgent fixes:
  • 80-100: Critical hotfixes
  • 50-79: Important features
  • 20-49: Normal work
  • 0-19: Low priority cleanup
Regularly check queue statistics:
High wait times may indicate CI bottlenecks.
  • sequential: Best for small teams or repos with flaky tests
  • parallel: Best for large teams with reliable CI
  • adaptive: Best default choice for most teams

Troubleshooting

Check the status and CI logs:
The PR may be waiting for CI or have failing checks.
Check if CI is the bottleneck:
Consider:
  • Switching to parallel strategy
  • Increasing batch size
  • Optimizing CI pipeline
PRs may be conflicting with each other. Try:

Requirements

The merge queue requires:
  1. A running wit server with merge queue enabled
  2. CI integration configured for the repository
  3. Appropriate permissions to add/remove PRs