Project113

Auto-Merge

Auto-merge lets the platform merge a change request automatically once it meets all of its requirements, so you do not have to merge it by hand.

How It Works

A background service periodically checks every open change request. When a change request with auto-merge enabled satisfies all of its requirements, the platform merges it using the change request's configured merge strategy (merge, squash, or rebase).

The result is posted as an automated thread on the change request, so the discussion history always shows what happened:

  • Auto-merge succeeded. — The change request was merged successfully.
  • Auto-merge failed: <reason>. — The merge could not be completed (for example, because of a conflict).

Requirements

A change request is only auto-merged when all of the following are true:

  • The change request is Open (not draft or locked).
  • Auto-merge is enabled on the change request.
  • There are no merge conflicts between the source and target branches.
  • If Require CI to pass is enabled, the change request's pipeline succeeded.
  • The minimum number of approvals has been reached.
  • If Require all threads resolved is enabled, there are no unresolved discussion threads.
  • All dependencies have been merged.

If the requirements are not met (for example, approvals are still pending), the change request stays open and waits. If you need to merge anyway, use force merge.

Scheduled Merge

You can also schedule a merge for a specific date and time. When you set a Schedule merge time when editing a change request, the change request will not be merged before that time. Once the scheduled time passes, the platform merges it as soon as all of the requirements above are satisfied.

Scheduled merge is a companion to auto-merge: the change request still waits for approvals, CI, resolved threads, and merged dependencies. If Auto-merge is disabled, the scheduled time alone will not merge the change request.

Enabling Auto-Merge

Auto-merge can be turned on in three places:

  • Repository default — In repository settings under Change Request Defaults. This applies to new change requests.
  • Per change request — Toggle Auto Merge when editing a change request. This overrides the repository default.
  • CR policiesCR policies can set the auto-merge setting based on branch patterns, title patterns, and other conditions.