GitLab Merge Request Template
A merge request template for GitLab with sections tailored to GitLab-specific features like /label, /milestone, and /assign quick actions.
Detailed Explanation
GitLab Merge Request Template
GitLab's merge request (MR) templates work similarly to GitHub's PR templates but support additional features like Quick Actions — slash commands that automate label assignment, milestone setting, and reviewer assignment directly from the MR description.
Template Structure
## Description
<!-- Summarize the changes. -->
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Refactoring
- [ ] Documentation update
## Checklist
- [ ] Code follows the project's style guidelines
- [ ] Self-review completed
- [ ] Tests added and passing
- [ ] Documentation updated
## Testing
<!-- Describe how to test these changes. -->
## Related Issues
<!-- Closes #(issue number) -->
---
/label ~"needs review"
/milestone %current
Quick Actions
GitLab Quick Actions are commands prefixed with / that are processed when the MR is created. They don't appear in the rendered description.
| Quick Action | Effect |
|---|---|
/label ~"needs review" |
Adds the "needs review" label |
/milestone %current |
Sets the current milestone |
/assign @username |
Assigns the MR to a team member |
/reviewer @username |
Requests a review from someone |
/estimate 2h |
Sets a time estimate |
File Location
GitLab supports multiple MR templates. Save them in .gitlab/merge_request_templates/:
.gitlab/merge_request_templates/Default.md— used by default.gitlab/merge_request_templates/Bug.md— selectable for bug fixes.gitlab/merge_request_templates/Feature.md— selectable for features
Contributors select the template from a dropdown when creating a new MR.
Differences from GitHub Templates
- GitLab uses "Merge Request" terminology instead of "Pull Request"
- Quick Actions allow inline automation
- Multiple named templates are natively supported via a dropdown selector
- GitLab templates use the same Markdown syntax including checkboxes
Use Case
Teams using GitLab for source control and CI/CD who want consistent merge request descriptions with automated labeling and milestone assignment through Quick Actions.