Setting Up a Merge Queue

Implement your first merge queue.


Mergify’s Merge Queue automates and secures your PR merging process. It ensures each PR meets all conditions (status checks, branch rules, reviews, etc.) before merging, so your main branch stays stable — without manual tracking or coordination.

Every repo connected to Mergify gets a queue automatically. By default, it respects your GitHub branch protection settings and rulesets.

Adding a Pull Request to the Merge Queue

Section titled Adding a Pull Request to the Merge Queue

To add a pull request to the merge queue, use the queue command. This adds your PR to the merge queue as long as it matches the queue conditions.

Mergify queue command

Remember, the PR will only be merged once the conditions defined in the merge_conditions field are met.

You can also configure Mergify to automatically queue pull requests that are ready.

Configuring the Merge Queue Rules

Section titled Configuring the Merge Queue Rules

To have a more refined control over the PRs entering the merge queue and when they get merged, you can configure multiple queue rules in your Mergify configuration file. This allows to define custom conditions that should be met before a PR is added to the queue (queue_conditions) and when it can be merged (merge_conditions).

See queue rules.

After you’ve added pull requests to your merge queue, you want to monitor its status to understand the progression of your PRs. This can be done directly from the Mergify dashboard.

Mergify Queue Status

Here, you can view all the PRs in the queue and their current statuses. PRs that are waiting for their merge_conditions to be met are marked as pending, while those that have met all their queue_conditions are displayed in the queue and will be merged when they reach the top of the queue.

Remember, the PRs in the queue are ordered based on their addition time. The PR added first will be merged first after all its conditions are met. You can modify the order of the pull request inside a queue using priorities.

Congratulations, you’ve just set up your first Merge Queue with Mergify! You’re now armed with a powerful tool to automate and streamline your PR merging process, reducing the potential for conflicts and ensuring your main branch is always in a consistent, deployable state.

However, setting up a basic merge queue is just the beginning. Mergify’s powerful and flexible configuration system enables you to tailor your merge queue to your specific needs.

For further exploration and inspiration, here are some additional resources and use cases that you might find useful:

Remember, the possibilities with a merge queue are limited only by your imagination. Happy merging!