doc/administration/settings/instance_template_repository.md
{{< details >}}
{{< /details >}}
In hosted systems, enterprises often have a need to share their own templates across teams. This feature allows an administrator to pick a project to be the instance-wide collection of file templates. These templates are then exposed to all users through the Web Editor while the project remains secure.
To select a project to serve as the custom template repository:
After you add templates, you can use them for the entire instance. They are available in the Web Editor and through the API settings.
These templates cannot be used as a value of the
include:template key in .gitlab-ci.yml.
GitLab supports Markdown files for issue and merge request templates and other file type templates.
The following Markdown description templates are supported:
| Type | Directory | Extension |
|---|---|---|
| Issue | .gitlab/issue_templates | .md |
| Merge request | .gitlab/merge_request_templates | .md |
For more information, see description templates.
Other supported file type templates include:
| Type | Directory | Extension |
|---|---|---|
Dockerfile | Dockerfile | .dockerfile |
.gitignore | gitignore | .gitignore |
.gitlab-ci.yml | gitlab-ci | .yml |
LICENSE | LICENSE | .txt |
Each template must be in its respective subdirectory, have the correct extension, and not be empty. The hierarchy should look like this:
|-- README.md
|-- issue_templates
|-- feature_request.md
|-- merge_request_templates
|-- default.md
|-- Dockerfile
|-- custom_dockerfile.dockerfile
|-- another_dockerfile.dockerfile
|-- gitignore
|-- custom_gitignore.gitignore
|-- another_gitignore.gitignore
|-- gitlab-ci
|-- custom_gitlab-ci.yml
|-- another_gitlab-ci.yml
|-- LICENSE
|-- custom_license.txt
|-- another_license.txt
Your custom templates are displayed in the dropdown list when a new file is added through the GitLab UI:
If this feature is disabled or no templates are present, no Custom section displays in the selection dropdown list.