Merge Request Template Setup in GitLab and GitHub
GitHub and GitLab need different file paths and selection rules.

Merge request template setup in GitLab and GitHub depends on more than adding Markdown to a repository. Both platforms require the right file on the default branch, but their selection and inheritance rules differ. A working setup matches those rules to the contribution workflow, then checks that contributors receive the intended prompts.
What merge request templates are and what they actually do
A merge request template supplies reusable Markdown for a new request’s description. GitHub calls the request a pull request, and GitLab calls it a merge request. The file location is part of the mechanism. The platform looks for templates at designated paths on the default branch, so a file on a feature branch is unavailable until it reaches that branch. For an automatically applied default, contributors do not need to opt in.
Contributors may have to choose a named template, and each platform has its own way to make that choice. A template also gives authors prompts that they can leave blank. Its presence establishes the description’s starting structure.
File placement and naming rules for GitHub pull request templates
GitHub accepts a single pull request template at .github/PULL_REQUEST_TEMPLATE.md, PULL_REQUEST_TEMPLATE.md in the repository root, or docs/PULL_REQUEST_TEMPLATE.md. The recommended location is the .github directory. The filename must match the recognized name, but capitalization is not significant, so pull_request_template.md also works.
Enter .github/PULL_REQUEST_TEMPLATE.md as the filename and add the template content. Commit it straight to the repository’s default branch, which is usually main. The branch requirement is independent of the path. Even with the right name, a file committed to another branch is unavailable to contributors until it is merged into the default branch.
With a single template, the description is filled in automatically at the start. Multiple templates go in a directory instead of that single file, which changes how contributors get the content. That distinction makes the configuration a choice about workflow and Markdown file organization.
How GitHub handles multiple templates — and why the behavior is non-obvious
GitHub supports named files such as .github/PULL_REQUEST_TEMPLATE/feature.md, .github/PULL_REQUEST_TEMPLATE/bugfix.md, .github/PULL_REQUEST_TEMPLATE/hotfix.md, and .github/PULL_REQUEST_TEMPLATE/docs.md. It does not provide a template-selection dropdown. Contributors choose a file with a ?template=filename.md URL parameter, and if they leave it out, a multiple-template directory leaves the description blank because no file is chosen automatically. A single template is therefore the better choice for most projects, while multiple templates are worth the extra work to coordinate them when the types of contributions need different sections that do not overlap. At the organization level, a specially named public repository, .github, can supply a default for repositories without their own template. A repository’s own .github/PULL_REQUEST_TEMPLATE.md overrides that organization default.
File placement and naming rules for GitLab merge request templates
GitLab requires Markdown files in .gitlab/merge_request_templates/ on the project’s default branch. GitLab’s documentation specifies the .md extension and that directory, while GitHub offers a choice of three locations. Here, the filename serves a different purpose. Its name without the extension becomes the label in the Choose a template dropdown, so names such as Feature.md, Bug Fix.md, and Hotfix.md identify the choices contributors see.
To create a template, select Code → Repository in the left sidebar. Next to the default branch, select the plus icon and then New file. Enter .gitlab/merge_request_templates/mytemplate.md in the File name box, replacing mytemplate with the desired name, and add the content. Commit the file to the default branch. Then create a new merge request and check whether its name appears in Choose a template.
Contributors can choose the appropriate description without constructing a parameterized link.
GitLab's template variables — what auto-populates and what doesn't
GitLab description templates can substitute merge request context for variables when the MR is first saved. The restriction is decisive for template design. Substitution works only in the default template. GitHub has no equivalent native variable substitution in its description templates.
For example, %{source_branch} and %{target_branch} supply branch names, while %{first_commit} supplies the full message of the first commit in the MR diff. %{closes_issue} supplies a reference to the issue inferred from the source branch name. When automatic issue closing is off, it replaces “Closes” with “Related to”. These variables can provide context without asking the author to retype it.
Commit-derived variables also have defined boundaries. %{all_commits} includes messages from the 100 most recent commits, and %{co_authored_by} is limited to authors of those commits. %{first_multiline_commit} uses the first non-merge commit with more than one line, falling back to the MR title when all commits are single-line. A team that needs this dynamic context in a named template must promote it to the default or use static placeholder text instead.
GitLab's title templates and commit message templates — the adjacent settings teams miss
GitLab title templates configure another part of the same MR record. GitLab’s documentation says the setting is at Settings → Merge requests → Merge request title template, needs at least the Maintainer role, and has a limit of 100 characters. The feature was introduced behind a feature flag in GitLab 18.11 and became generally available in GitLab 19.0. Supported variables include branch names, %{first_commit_title}, %{issue_id}, and %{issue_title}. %{title_from_branch} converts the branch name into readable text by replacing hyphens and underscores with spaces. A manually supplied title takes precedence over the expanded template, which takes precedence over GitLab’s default title behavior.
Commit message templates complete the record when changes merge. Maintainers or Owners configure them under Settings → Merge requests, using Merge commit message template or Squash commit message template. These settings are separate from the description template. The default merge message includes the source and target branches, followed on separate lines by %{title}, %{issues}, and See merge request %{reference}, while the default squash message is %{title}. Variables such as %{description} let content from the description go into the commit message. Each template has a character limit, although the rendered message can be longer after substitution, and users can override the defaults when merging.
Group-level and instance-level template inheritance in GitLab
GitLab extends description templates across project, group, and instance scopes. Projects inherit templates from their group and instance, but a project-level template overrides both.
Group-level description templates need a repository set as the group’s template source under group settings. Instance-level templates similarly use an instance template repository. GitLab’s documentation identifies instance-level templates as a Premium and Ultimate feature for GitLab Self-Managed and GitLab Dedicated. The distinction is relevant when a shared template must serve more than one group.
Side-by-side comparison of key setup differences between GitHub and GitLab
This reverses what naming accomplishes on each platform. A GitHub filename identifies the automatic default. A GitLab filename identifies an option contributors can select.
GitHub descriptions remain static Markdown, while GitLab’s default description template can expand variables on first save. For shared defaults, GitHub offers an organization repository fallback, while GitLab adds group and instance scopes beneath project overrides. A migration between the platforms therefore requires changing a directory name and adapting the selection workflow and shared-default structure.
What to put in the template — the sections that actually get filled out
Once the template loads correctly, its usefulness depends on the questions it asks. The design goal is the minimum context a reviewer needs to approve without unnecessary back-and-forth. Excessive prompts encourage boilerplate. A description should explain what changed and why, rather than repeating the ticket title, while a type-of-change section distinguishes a bug fix, new feature, breaking change, refactor, or documentation update.
Testing context deserves its own prompt because reviewers need to know the approach and which commands to run. That shifts QA information from Slack to the MR record. A human checklist should cover judgment calls. Style guidelines, self-review, and documentation updates belong there, while checks that CI can verify, such as lint results and passing tests, belong in automation instead.
Release-specific obligations can justify separate templates. Boldare created staging and production PR templates after it forgot to check translations before a merge-to-master that deployed to production automatically. That example shows how a template can record release sign-off and QA approval as well as code review. Sections useful to a mobile app can be dead weight in a Terraform repository, so repository-specific or contribution-specific templates are preferable where the needs differ.
Why a well-structured MR description is the upstream source for changelogs and release content
The description records the context while the author is already explaining the change, making it an upstream source for changelogs and release content as well as a review aid. The author has the most context at that moment. Asking what changed, why, and what broke preserves information that might otherwise require a follow-up interview or disappear.
A GitHub Actions and Claude pipeline can read the PR title, description, and changed files to produce a structured CHANGELOG.md entry. GitLab release summaries can assemble titles, labels, and MR URLs into Markdown sections for new features, bug fixes, and breaking changes, assigning categories through type:: labels.
For teams that produce release content, a Release Note field, Breaking Changes flag, and Audience tag give tools clear places to pull content from. Templates should ask authors to describe how users benefit, because engineering descriptions do not automatically explain a change in a way that helps users. Signal-driven publishing tools likewise depend on the upstream description’s quality, so blank or boilerplate input yields generic output regardless of the pipeline’s sophistication.
Common setup failures and how to verify a template is actually firing
After setup, the practical verification starts with the branch, path, and filename. Check that the file created on the feature branch has reached the default branch. Then open a new PR or MR. A correctly placed template is available to new requests after it reaches the default branch.
Without that parameter, the description stays blank because no template was chosen, even if the file is there. Share parameterized links in the contributing guide. For GitLab, check that the filename appears in Choose a template. If it does not, inspect the directory, .md extension, and default branch.
Variable substitution needs a separate GitLab test. Check the default template after the MR’s first save, rather than expecting a named dropdown template to expand its placeholders. Literal variables in a named template require either promoting it to the default or replacing them with static prompts.
Finally, distinguish successful loading from successful completion. Neither platform requires contributors to fill out the supplied sections. Teams that need to enforce this can add a CI job or status check that fails when required sections are empty or a checklist is left unchecked, then use branch protection to block merging until it passes.


