doc/user/group/custom_project_templates.md
{{< details >}}
{{< /details >}}
{{< history >}}
constrain_group_project_templates. Disabled by default.constrain_group_project_templates removed.{{< /history >}}
When you create a project, you can choose from a list of templates. These templates, for things like GitLab Pages or Ruby, populate the new project with a copy of the files contained in the template. This information is identical to the information used by GitLab project import/export and can help you start a new project more quickly.
You can customize the list of available templates, so that all projects in your group have the same list. To do this, you populate a subgroup with the projects you want to use as templates.
You can also configure custom templates for the instance.
Prerequisites:
To set up custom project templates in a group, add the subgroup that contains the project templates to the group settings:
The next time a group member creates a project, they can select any of the projects in the subgroup.
Projects in nested subgroups are not included in the template list.
When you create a project outside of a group context, you must select a group from the dropdown list before you can browse its templates. Only groups you have access to are listed.
Here's a sample group and project structure for project templates, for myorganization:
# GitLab instance and group
gitlab.com/myorganization/
# Subgroups
internal
tools
# Subgroup for handling project templates
websites
templates
# Project templates
client-site-django
client-site-gatsby
client-site-html
# Other projects
client-site-a
client-site-b
client-site-c
...
When you create a project from a template, all exportable project items are copied from the template to the new project. These items include:
For a complete list of what is copied, see project items that are exported.
The copying behavior might differ based on your permissions:
When you use a template created by another user, any items that were assigned to a user in the template are reassigned to you. It's important to understand this reassignment when you configure security features like protected branches and tags. For example, if the template contains a protected branch:
Custom project templates for a group are available only to group members. If the administrator account you are using is not a member of a group, you can't access the templates.