2019-07-29 04:10:24 +00:00
---
2020-07-28 18:09:36 +00:00
stage: Create
group: Source Code
2020-11-26 06:09:20 +00:00
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments"
2019-07-29 04:10:24 +00:00
type: reference, howto
---
2020-06-16 18:09:01 +00:00
# Protected tags
2017-04-07 01:35:59 +00:00
2020-04-21 15:21:10 +00:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/10356) in GitLab 9.1.
2017-04-07 01:35:59 +00:00
2020-06-16 18:09:01 +00:00
Protected tags allow control over who has permission to create tags as well as preventing accidental update or deletion once created. Each rule allows you to match either an individual tag name, or use wildcards to control multiple tags at once.
2017-04-07 01:35:59 +00:00
2020-06-16 18:09:01 +00:00
This feature evolved out of [protected branches ](protected_branches.md )
2017-04-07 01:35:59 +00:00
## Overview
2020-06-19 18:08:39 +00:00
Protected tags will prevent anyone from updating or deleting the tag, and will prevent creation of matching tags based on the permissions you have selected. By default, anyone without Maintainer permission will be prevented from creating tags.
2017-04-07 01:35:59 +00:00
## Configuring protected tags
2018-05-22 10:16:06 +00:00
To protect a tag, you need to have at least Maintainer permission level.
2017-04-07 01:35:59 +00:00
2019-07-29 04:10:24 +00:00
1. Navigate to the project's **Settings > Repository** :
2017-04-07 01:35:59 +00:00
2019-08-12 09:54:30 +00:00
![Repository Settings ](img/project_repository_settings.png )
2017-04-07 01:35:59 +00:00
2019-07-29 04:10:24 +00:00
1. From the **Tag** dropdown menu, select the tag you want to protect or type and click **Create wildcard** . In the screenshot below, we chose to protect all tags matching `v*` :
2017-04-07 01:35:59 +00:00
2019-08-28 13:09:10 +00:00
![Protected tags page ](img/protected_tags_page_v12_3.png )
2017-04-07 01:35:59 +00:00
2019-07-29 04:10:24 +00:00
1. From the **Allowed to create** dropdown, select who will have permission to create matching tags and then click **Protect** :
2017-04-07 01:35:59 +00:00
2019-08-28 13:09:10 +00:00
![Allowed to create tags dropdown ](img/protected_tags_permissions_dropdown_v12_3.png )
2017-04-07 01:35:59 +00:00
2019-07-29 04:10:24 +00:00
1. Once done, the protected tag will appear in the **Protected tags** list:
2017-04-07 01:35:59 +00:00
2019-08-28 13:09:10 +00:00
![Protected tags list ](img/protected_tags_list_v12_3.png )
2017-04-07 01:35:59 +00:00
## Wildcard protected tags
You can specify a wildcard protected tag, which will protect all tags
matching the wildcard. For example:
| Wildcard Protected Tag | Matching Tags |
2018-09-06 16:52:18 +00:00
|------------------------|-------------------------------|
2017-04-07 01:35:59 +00:00
| `v*` | `v1.0.0` , `version-9.1` |
| `*-deploy` | `march-deploy` , `1.0-deploy` |
| `*gitlab*` | `gitlab` , `gitlab/v1` |
| `*` | `v1.0.1rc2` , `accidental-tag` |
Two different wildcards can potentially match the same tag. For example,
`*-stable` and `production-*` would both match a `production-stable` tag.
In that case, if _any_ of these protected tags have a setting like
2019-07-29 04:10:24 +00:00
**Allowed to create**, then `production-stable` will also inherit this setting.
2017-04-07 01:35:59 +00:00
If you click on a protected tag's name, you will be presented with a list of
all matching tags:
![Protected tag matches ](img/protected_tag_matches.png )
2019-07-29 04:10:24 +00:00
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X` .
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->