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:- PR #1 passes CI on
mainat commit A - PR #2 passes CI on
mainat commit A - PR #1 merges,
mainis now at commit B - PR #2 merges without retesting against B
mainis now broken because #2 conflicts with #1’s changes
- PRs are queued for merging
- Each PR is rebased on the latest
mainand tested - Only PRs that pass against the current
mainare merged - 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
Keep PRs small
Keep PRs small
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
Use priorities wisely
Use priorities wisely
Reserve high priorities for urgent fixes:
- 80-100: Critical hotfixes
- 50-79: Important features
- 20-49: Normal work
- 0-19: Low priority cleanup
Monitor queue health
Monitor queue health
Regularly check queue statistics:High wait times may indicate CI bottlenecks.
Choose the right strategy
Choose the right strategy
sequential: Best for small teams or repos with flaky testsparallel: Best for large teams with reliable CIadaptive: Best default choice for most teams
Troubleshooting
PR stuck in queue
PR stuck in queue
Check the status and CI logs:The PR may be waiting for CI or have failing checks.
Queue processing slowly
Queue processing slowly
Check if CI is the bottleneck:Consider:
- Switching to
parallelstrategy - Increasing batch size
- Optimizing CI pipeline
Frequent failures in parallel mode
Frequent failures in parallel mode
PRs may be conflicting with each other. Try:
Requirements
The merge queue requires:- A running wit server with merge queue enabled
- CI integration configured for the repository
- Appropriate permissions to add/remove PRs