GitLab: a merge request blocked by its title
A project can require merge request titles to match a regular expression. A merge request whose title does not match cannot merge; the API reports detailed_merge_status title_regex, the check's failure text is "The title must match the required pattern.", and the merge page says Title must match required pattern (GitLab docs: merge request title validation, checked November 19, 2026).
How it works
- A Maintainer or Owner sets Title pattern and Title example in Settings > Merge requests (Premium and Ultimate; both fields are required together; the project API has
merge_request_title_regex). Each is at most 255 characters. - GitLab checks the current title at merge time, so the author can fix the title at any point before merging. With auto-merge on, the merge request waits for a matching title.
- The Title example is shown to users whose title does not match. Use it as the model.
- Draft prefixes (
[Draft],Draft:,(Draft)) are removed before matching, so the pattern need not allow for them (changed in GitLab 19.5).
To see that the title is what blocks a merge request: Merge Request (MR) Review Inbox for GitLab, a plugin for JetBrains IDEs, lists the merge checks from detailed_merge_status with the blocking ones first.
When the title looks right and still fails
- The pattern is RE2, not PCRE: no backreferences and no lookahead or lookbehind. A pattern tested in a PCRE tester can behave differently, so test with an RE2 tester.
- Special characters must be escaped.
GitLab's example patterns, with a title each accepts:
^[A-Z]+-\d+ .+ PROJ-123 Fix login bug ^(feat|fix|docs|chore|refactor|test|style)(\(.+\))?: .+ feat(auth): add SSO support ^(FEATURE|BUGFIX|HOTFIX): .+ BUGFIX: resolve timeout error
What to do
- Read the check in the merge request, then change the title to match the pattern.
- If the pattern is wrong, a Maintainer edits or clears it: to remove the validation, clear both the pattern and the example, then Save changes.
GitLab merge requests in IntelliJ IDEA
Merge Request (MR) Review Inbox for GitLab, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a merge request's merge checks before you merge: approvals, requested changes, unresolved threads, the pipeline, conflicts, and GitLab's other reasons from detailed_merge_status, with the ones that block the merge first, and the head pipeline with a link. The title check is one of GitLab's other reasons it lists, so a title that does not match the pattern shows up before you merge. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab merge refused (405, 409, 422) · GitLab "To merge, a Jira issue key must be mentioned" · GitLab "Merge request must not be draft" · GitLab squash refused or failed