url
stringlengths 24
122
| repo_url
stringlengths 60
156
| date_extracted
stringdate 2025-08-13 00:00:00
2025-08-13 00:00:00
| root
stringlengths 3
85
| breadcrumbs
listlengths 1
6
| filename
stringlengths 6
60
| stage
stringclasses 33
values | group
stringclasses 81
values | info
stringclasses 22
values | title
stringlengths 3
110
⌀ | description
stringlengths 11
359
⌀ | clean_text
stringlengths 47
3.32M
| rich_text
stringlengths 321
3.32M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://docs.gitlab.com/user/project/repository/files/jupyter_notebooks
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repository/files/_index.md
|
2025-08-13
|
doc/user/project/repository/files/jupyter_notebooks
|
[
"doc",
"user",
"project",
"repository",
"files",
"jupyter_notebooks"
] |
_index.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Jupyter Notebook files
|
GitLab projects display Jupyter Notebook files as clean, human-readable files instead of raw files.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[Jupyter Notebook](https://jupyter.org/) (previously, IPython Notebook) files are used for
interactive computing in many fields. They contain a complete record of the
user's sessions and include:
- Code.
- Narrative text.
- Equations.
- Rich output.
When you add a Jupyter Notebook (with `.ipynb` extension) to your repository,
it's rendered into HTML when you view it:

Interactive features, including JavaScript plots, don't work when viewed in
GitLab.
## Cleaner diffs and raw diffs
When commits include changes to Jupyter Notebook files, GitLab:
- Transforms the machine-readable `.ipynb` file into a human-readable Markdown file.
- Displays a cleaner version of the diff that includes syntax highlighting.
- Enables switching between raw and rendered diffs on the Commit and Compare pages. (Not available on merge request pages.)
- Renders images on the diffs.
Code Suggestions is not available on diffs and merge requests for `.ipynb` files.
Cleaner notebook diffs are not generated when the notebook is too large.
## Jupyter Git integration
Jupyter can be configured as an OAuth application with repository access, acting
on behalf of the authenticated user. See the
[Runbooks documentation](../../../clusters/runbooks/_index.md) for an
example configuration.
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: GitLab projects display Jupyter Notebook files as clean, human-readable
files instead of raw files.
title: Jupyter Notebook files
breadcrumbs:
- doc
- user
- project
- repository
- files
- jupyter_notebooks
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[Jupyter Notebook](https://jupyter.org/) (previously, IPython Notebook) files are used for
interactive computing in many fields. They contain a complete record of the
user's sessions and include:
- Code.
- Narrative text.
- Equations.
- Rich output.
When you add a Jupyter Notebook (with `.ipynb` extension) to your repository,
it's rendered into HTML when you view it:

Interactive features, including JavaScript plots, don't work when viewed in
GitLab.
## Cleaner diffs and raw diffs
When commits include changes to Jupyter Notebook files, GitLab:
- Transforms the machine-readable `.ipynb` file into a human-readable Markdown file.
- Displays a cleaner version of the diff that includes syntax highlighting.
- Enables switching between raw and rendered diffs on the Commit and Compare pages. (Not available on merge request pages.)
- Renders images on the diffs.
Code Suggestions is not available on diffs and merge requests for `.ipynb` files.
Cleaner notebook diffs are not generated when the notebook is too large.
## Jupyter Git integration
Jupyter can be configured as an OAuth application with repository access, acting
on behalf of the authenticated user. See the
[Runbooks documentation](../../../clusters/runbooks/_index.md) for an
example configuration.
|
https://docs.gitlab.com/user/project/repository/commits
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repository/_index.md
|
2025-08-13
|
doc/user/project/repository/commits
|
[
"doc",
"user",
"project",
"repository",
"commits"
] |
_index.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Commits
|
View information about a repository's commit history.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The **Commits** list displays the commit history for your repository. Use it to browse
code changes, view commit details, and verify commit signatures. You can filter the commit list by
Git revision to see the changes for a specific revision.
The list shows:
- Commit hash: Unique identifier (SHA) for each commit.
- Commit message: Title and description of the commit.
- Author: Name and avatar of the user who made the commit.
- Timestamp: When the commit was created.
- Pipeline status: CI/CD pipeline results, if configured.
- Signature verification: GPG, SSH, or X.509 signature status.
- Tags: Any tags pointing to this commit.

## View commits
To view your repository's commit history:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
To view a commit's summary, select the **Toggle commit description** icon ({{< icon name="ellipsis_h">}}).
This summary does not display file changes or statistics.
## View commit details
Examine the specific changes made in any commit, including file modifications, additions, and deletions.
To view a commit's details:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit to open the commit's details page.
The commit's details page shows:
- Commit information: Commit hash, author, committer, parent commits, and timestamp.
- Commit message: Title and description of the commit.
- File changes: All modified files with diff view.
- Statistics: Number of lines changed, added, and removed.
- Pipeline details: Associated CI/CD pipeline status and details.
- References: Branches and tags containing this commit.
- Related merge requests: Links to merge requests associated with the commit.
## Browse repository files by Git revision
To view all repository files and folders at a specific Git revision, such as a commit SHA,
branch name, or tag:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Choose one of the following options:
- Filter by Git revision:
1. At the top, select to open the **Select Git revision** dropdown list.
1. Select or search for a Git revision.
- Select a specific commit from the commits list.
1. At the top right, select **Browse files**.
You are directed to the [repository](../_index.md) page at that specific revision.
## Filter and search commits
Filter and search the commit history to find specific changes or track work by particular authors.
### Filter by author
To filter commits by a specific author:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. In the **Author** dropdown list, select or search for the author's name or username.
If author filtering doesn't work for names with special characters, use the URL parameter format.
For example, append `?author=Elliot%20Stevens` to the URL.
### Filter by Git revision
To filter commits by Git revision, such as branch, tag, or commit SHA:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. In the dropdown list, select or search for a Git revision.
For example, branch name, tag, or commit SHA.
1. Select the Git revision to view the list of filtered commits.
### Search by commit message
To search for commits by message content:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. In the **Search by message** field, enter your search terms.
You can also search by commit SHA, full or partial, to find a specific commit directly.
## Cherry-pick a commit
Apply changes from a specific commit to another.
Prerequisites:
- You must have at least the Developer role for the project.
- The target branch must exist.
To cherry-pick a commit:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit you want to cherry-pick.
1. In the upper-right corner, select **Options** and then **Cherry-pick**.
1. In the dialog:
- From the dropdown lists, select the target project and branch.
- Optional: Select **Start a new merge request** to create a merge request with the changes.
- Select **Cherry-pick**.
GitLab creates a new commit on the target branch with the cherry-picked changes.
If the branch is [protected](../branches/protected.md) or you don't have the correct permissions,
GitLab prompts you to [create a new merge request](../../merge_requests/_index.md#create-a-merge-request).
## Revert a commit
Create a new commit that undoes changes from a previous commit.
Prerequisites:
- You must have at least the Developer role for the project.
To revert a commit:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit you want to revert.
1. In the upper-right corner, select **Options** and then **Revert**.
1. In the dialog:
- Select the target branch for the revert commit.
- Optional: Select **Start a new merge request** to create a merge request.
- Select **Revert**.
GitLab creates a new commit that reverses the changes from the selected commit.
If the branch is [protected](../branches/protected.md) or you don't have the correct permissions,
GitLab prompts you to [create a new merge request](../../merge_requests/_index.md#create-a-merge-request).
## Download commit contents
To download a commit's diff contents:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit you want to download.
1. In the upper-right corner, select **Options**.
1. Under **Downloads**, select **Plain Diff**.
## Verify commit signatures
GitLab verifies GPG, SSH, and X.509 signatures to ensure commit authenticity.
Verified commits show a **Verified** badge.
For more information, see [signed commits](../signed_commits/_index.md).
### View signature details
To view signature information:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Find a commit with a **Verified** or **Unverified** badge.
1. Select the badge to view signature details including:
- Signature type (GPG, SSH, or X.509)
- Key fingerprint
- Verification status
- Signer identity
## View pipeline status and details
The commit list includes a CI/CD pipeline status icon next to each commit. To view the pipeline details:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the pipeline status icon next to any commit.
## Related topics
- [Signed commits](../signed_commits/_index.md)
- [Git file history](../files/git_history.md)
- [Tags](../tags/_index.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: View information about a repository's commit history.
title: Commits
breadcrumbs:
- doc
- user
- project
- repository
- commits
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The **Commits** list displays the commit history for your repository. Use it to browse
code changes, view commit details, and verify commit signatures. You can filter the commit list by
Git revision to see the changes for a specific revision.
The list shows:
- Commit hash: Unique identifier (SHA) for each commit.
- Commit message: Title and description of the commit.
- Author: Name and avatar of the user who made the commit.
- Timestamp: When the commit was created.
- Pipeline status: CI/CD pipeline results, if configured.
- Signature verification: GPG, SSH, or X.509 signature status.
- Tags: Any tags pointing to this commit.

## View commits
To view your repository's commit history:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
To view a commit's summary, select the **Toggle commit description** icon ({{< icon name="ellipsis_h">}}).
This summary does not display file changes or statistics.
## View commit details
Examine the specific changes made in any commit, including file modifications, additions, and deletions.
To view a commit's details:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit to open the commit's details page.
The commit's details page shows:
- Commit information: Commit hash, author, committer, parent commits, and timestamp.
- Commit message: Title and description of the commit.
- File changes: All modified files with diff view.
- Statistics: Number of lines changed, added, and removed.
- Pipeline details: Associated CI/CD pipeline status and details.
- References: Branches and tags containing this commit.
- Related merge requests: Links to merge requests associated with the commit.
## Browse repository files by Git revision
To view all repository files and folders at a specific Git revision, such as a commit SHA,
branch name, or tag:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Choose one of the following options:
- Filter by Git revision:
1. At the top, select to open the **Select Git revision** dropdown list.
1. Select or search for a Git revision.
- Select a specific commit from the commits list.
1. At the top right, select **Browse files**.
You are directed to the [repository](../_index.md) page at that specific revision.
## Filter and search commits
Filter and search the commit history to find specific changes or track work by particular authors.
### Filter by author
To filter commits by a specific author:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. In the **Author** dropdown list, select or search for the author's name or username.
If author filtering doesn't work for names with special characters, use the URL parameter format.
For example, append `?author=Elliot%20Stevens` to the URL.
### Filter by Git revision
To filter commits by Git revision, such as branch, tag, or commit SHA:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. In the dropdown list, select or search for a Git revision.
For example, branch name, tag, or commit SHA.
1. Select the Git revision to view the list of filtered commits.
### Search by commit message
To search for commits by message content:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. In the **Search by message** field, enter your search terms.
You can also search by commit SHA, full or partial, to find a specific commit directly.
## Cherry-pick a commit
Apply changes from a specific commit to another.
Prerequisites:
- You must have at least the Developer role for the project.
- The target branch must exist.
To cherry-pick a commit:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit you want to cherry-pick.
1. In the upper-right corner, select **Options** and then **Cherry-pick**.
1. In the dialog:
- From the dropdown lists, select the target project and branch.
- Optional: Select **Start a new merge request** to create a merge request with the changes.
- Select **Cherry-pick**.
GitLab creates a new commit on the target branch with the cherry-picked changes.
If the branch is [protected](../branches/protected.md) or you don't have the correct permissions,
GitLab prompts you to [create a new merge request](../../merge_requests/_index.md#create-a-merge-request).
## Revert a commit
Create a new commit that undoes changes from a previous commit.
Prerequisites:
- You must have at least the Developer role for the project.
To revert a commit:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit you want to revert.
1. In the upper-right corner, select **Options** and then **Revert**.
1. In the dialog:
- Select the target branch for the revert commit.
- Optional: Select **Start a new merge request** to create a merge request.
- Select **Revert**.
GitLab creates a new commit that reverses the changes from the selected commit.
If the branch is [protected](../branches/protected.md) or you don't have the correct permissions,
GitLab prompts you to [create a new merge request](../../merge_requests/_index.md#create-a-merge-request).
## Download commit contents
To download a commit's diff contents:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the commit you want to download.
1. In the upper-right corner, select **Options**.
1. Under **Downloads**, select **Plain Diff**.
## Verify commit signatures
GitLab verifies GPG, SSH, and X.509 signatures to ensure commit authenticity.
Verified commits show a **Verified** badge.
For more information, see [signed commits](../signed_commits/_index.md).
### View signature details
To view signature information:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Find a commit with a **Verified** or **Unverified** badge.
1. Select the badge to view signature details including:
- Signature type (GPG, SSH, or X.509)
- Key fingerprint
- Verification status
- Signer identity
## View pipeline status and details
The commit list includes a CI/CD pipeline status icon next to each commit. To view the pipeline details:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Commits**.
1. Select the pipeline status icon next to any commit.
## Related topics
- [Signed commits](../signed_commits/_index.md)
- [Git file history](../files/git_history.md)
- [Tags](../tags/_index.md)
|
https://docs.gitlab.com/user/project/repository/tags
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repository/_index.md
|
2025-08-13
|
doc/user/project/repository/tags
|
[
"doc",
"user",
"project",
"repository",
"tags"
] |
_index.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Tags
|
Use Git tags to mark important points in a repository's history, and trigger CI/CD pipelines.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In Git, a tag marks an important point in a repository's history.
Git supports two types of tags:
- Lightweight tags point to specific commits, and contain no other information.
Also known as soft tags. Create or remove them as needed.
- Annotated tags contain metadata, can be signed for verification purposes,
and can't be changed.
The creation or deletion of a tag can be used as a trigger for automation, including:
- Using a [webhook](../../integrations/webhook_events.md#tag-events) to automate actions
like Slack notifications.
- Signaling a [repository mirror](../mirror/_index.md) to update.
- Running a CI/CD pipeline with [`if: $CI_COMMIT_TAG`](../../../../ci/jobs/job_rules.md#common-if-clauses-with-predefined-variables).
When you [create a release](../../releases/_index.md),
GitLab also creates a tag to mark the release point.
Many projects combine an annotated release tag with a stable branch. Consider
setting deployment or release tags automatically.
In the GitLab UI, each tag displays:

- The tag name ({{< icon name="tag" >}})
- Copy the tag name ({{< icon name="copy-to-clipboard" >}}).
- Optional. If the tag is [protected](../../protected_tags.md), a **protected** badge.
- The commit SHA ({{< icon name="commit" >}}), linked to the commit's contents.
- The commit's title and creation date.
- Optional. A link to the release ({{< icon name="rocket" >}}).
- Optional. If a pipeline has been run, the current pipeline status.
- Download links to the source code and artifacts linked to the tag.
- A [**Create release**](../../releases/_index.md#create-a-release) ({{< icon name="pencil" >}}) link.
- A link to delete the tag.
## View tags for a project
To view all existing tags for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Tags**.
## View tagged commits in the commits list
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Commits**.
1. Commits with a tag are labeled with a tag icon ({{< icon name="tag" >}}) and the name of the tag.
This example shows a commit tagged `v1.26.0`:

To view the list of commits in this tag, select the tag name.
## Create a tag
Tags can be created from the command line, or the GitLab UI.
### From the command line
To create either a lightweight or annotated tag from the command line, and push it upstream:
1. To create a lightweight tag, run the command `git tag TAG_NAME`, changing
`TAG_NAME` to your desired tag name.
1. To create an annotated tag, run one of the versions of `git tag` from the command line:
```shell
# In this short version, the annotated tag's name is "v1.0",
# and the message is "Version 1.0".
git tag -a v1.0 -m "Version 1.0"
# Use this version to write a longer tag message
# for annotated tag "v1.0" in your text editor.
git tag -a v1.0
```
1. Push your tags upstream with `git push origin --tags`.
### From the UI
To create a tag from the GitLab UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Tags**.
1. Select **New tag**.
1. Provide a **Tag name**.
1. For **Create from**, select an existing branch name, tag, or commit SHA.
1. Optional. Add a **Message** to create an annotated tag, or leave blank to
create a lightweight tag.
1. Select **Create tag**.
## Name your tag
Git enforces [tag name rules](https://git-scm.com/docs/git-check-ref-format)
to help ensure tag names remain compatible with other tools. GitLab
adds extra requirements for tag names, and provides benefits for well-structured tag names.
GitLab enforces these additional rules on all tags:
- No spaces are allowed in tag names.
- Tag names starting with 40 or 64 hexadecimal characters are prohibited, because they are similar to Git commit hashes.
- Tag names cannot start with `-`, `refs/heads/`, `refs/tags/`, or `refs/remotes/`
- Tag names are case-sensitive.
## Copy a tag name
To copy a tag name to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Tags**.
1. Next to the tag name, select **Copy tag name** ({{< icon name="copy-to-clipboard" >}}).
## Prevent tag deletion
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To prevent users from removing a tag with `git push`, create a [push rule](../push_rules.md).
## Trigger pipelines from a tag
GitLab CI/CD provides a predefined variable, [`CI_COMMIT_TAG`](../../../../ci/variables/predefined_variables.md),
to identify tags in your pipeline configurations.
You can use this variable in job rules and workflow rules to test if a pipeline was triggered by a tag.
By default, if your CI/CD jobs don't have specific rules in place,
they are included in a tag pipeline for any newly created tag.
In your `.gitlab-ci.yml` file for the CI/CD pipeline configuration of your project,
you can use the `CI_COMMIT_TAG` variable to control pipelines for new tags:
- At the job level with [`rules:if`](../../../../ci/yaml/_index.md#rulesif).
- At the pipeline level with the [`workflow`](../../../../ci/yaml/workflow.md) keyword.
## Trigger security scans in tag pipelines
By default, scan execution policies only run on branches, not tags. However, you can
configure pipeline execution policies to run security scans on tags.
To run security scans on tags:
1. Create a CI/CD configuration YAML file with custom jobs that extend the security scanner
templates and include rules to run on tags.
1. Create a pipeline execution policy that injects this configuration into your pipelines.
### Example pipeline execution policy
This example shows how to create a pipeline execution policy that runs dependency scanning
and SAST scans on tags:
```yaml
pipeline_execution_policy:
- name: Pipeline Execution Policy
description: Run security scans on tags
enabled: true
pipeline_config_strategy: inject_policy
content:
include:
- project: <Project path to YAML>
file: tag-security-scans.yml
skip_ci:
allowed: false
```
### Example CI/CD configuration
This example shows how to extend security scanner jobs to run on tags:
```yaml
include:
- template: Jobs/Dependency-Scanning.gitlab-ci.yml
- template: Jobs/SAST.gitlab-ci.yml
# Extend dependency scanning to run on tags
gemnasium-python-dependency_scanning_tags:
extends: gemnasium-python-dependency_scanning
rules:
- if: $CI_COMMIT_TAG
# Extend SAST scanning to run on tags
semgrep-sast_tags:
extends: semgrep-sast
rules:
- if: $CI_COMMIT_TAG
# Example of a custom job that runs only on tags
policy_job_for_tags:
script:
- echo "This job runs only on tags"
rules:
- if: $CI_COMMIT_TAG
# Example of a job that runs on all pipelines
policy_job_always:
script:
- echo "This policy job runs always."
```
## Related topics
- [Tagging (Git reference page)](https://git-scm.com/book/en/v2/Git-Basics-Tagging)
- [Protected tags](../../protected_tags.md)
- [Tags API](../../../../api/tags.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use Git tags to mark important points in a repository's history, and
trigger CI/CD pipelines.
title: Tags
breadcrumbs:
- doc
- user
- project
- repository
- tags
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In Git, a tag marks an important point in a repository's history.
Git supports two types of tags:
- Lightweight tags point to specific commits, and contain no other information.
Also known as soft tags. Create or remove them as needed.
- Annotated tags contain metadata, can be signed for verification purposes,
and can't be changed.
The creation or deletion of a tag can be used as a trigger for automation, including:
- Using a [webhook](../../integrations/webhook_events.md#tag-events) to automate actions
like Slack notifications.
- Signaling a [repository mirror](../mirror/_index.md) to update.
- Running a CI/CD pipeline with [`if: $CI_COMMIT_TAG`](../../../../ci/jobs/job_rules.md#common-if-clauses-with-predefined-variables).
When you [create a release](../../releases/_index.md),
GitLab also creates a tag to mark the release point.
Many projects combine an annotated release tag with a stable branch. Consider
setting deployment or release tags automatically.
In the GitLab UI, each tag displays:

- The tag name ({{< icon name="tag" >}})
- Copy the tag name ({{< icon name="copy-to-clipboard" >}}).
- Optional. If the tag is [protected](../../protected_tags.md), a **protected** badge.
- The commit SHA ({{< icon name="commit" >}}), linked to the commit's contents.
- The commit's title and creation date.
- Optional. A link to the release ({{< icon name="rocket" >}}).
- Optional. If a pipeline has been run, the current pipeline status.
- Download links to the source code and artifacts linked to the tag.
- A [**Create release**](../../releases/_index.md#create-a-release) ({{< icon name="pencil" >}}) link.
- A link to delete the tag.
## View tags for a project
To view all existing tags for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Tags**.
## View tagged commits in the commits list
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Commits**.
1. Commits with a tag are labeled with a tag icon ({{< icon name="tag" >}}) and the name of the tag.
This example shows a commit tagged `v1.26.0`:

To view the list of commits in this tag, select the tag name.
## Create a tag
Tags can be created from the command line, or the GitLab UI.
### From the command line
To create either a lightweight or annotated tag from the command line, and push it upstream:
1. To create a lightweight tag, run the command `git tag TAG_NAME`, changing
`TAG_NAME` to your desired tag name.
1. To create an annotated tag, run one of the versions of `git tag` from the command line:
```shell
# In this short version, the annotated tag's name is "v1.0",
# and the message is "Version 1.0".
git tag -a v1.0 -m "Version 1.0"
# Use this version to write a longer tag message
# for annotated tag "v1.0" in your text editor.
git tag -a v1.0
```
1. Push your tags upstream with `git push origin --tags`.
### From the UI
To create a tag from the GitLab UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Tags**.
1. Select **New tag**.
1. Provide a **Tag name**.
1. For **Create from**, select an existing branch name, tag, or commit SHA.
1. Optional. Add a **Message** to create an annotated tag, or leave blank to
create a lightweight tag.
1. Select **Create tag**.
## Name your tag
Git enforces [tag name rules](https://git-scm.com/docs/git-check-ref-format)
to help ensure tag names remain compatible with other tools. GitLab
adds extra requirements for tag names, and provides benefits for well-structured tag names.
GitLab enforces these additional rules on all tags:
- No spaces are allowed in tag names.
- Tag names starting with 40 or 64 hexadecimal characters are prohibited, because they are similar to Git commit hashes.
- Tag names cannot start with `-`, `refs/heads/`, `refs/tags/`, or `refs/remotes/`
- Tag names are case-sensitive.
## Copy a tag name
To copy a tag name to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code** > **Tags**.
1. Next to the tag name, select **Copy tag name** ({{< icon name="copy-to-clipboard" >}}).
## Prevent tag deletion
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To prevent users from removing a tag with `git push`, create a [push rule](../push_rules.md).
## Trigger pipelines from a tag
GitLab CI/CD provides a predefined variable, [`CI_COMMIT_TAG`](../../../../ci/variables/predefined_variables.md),
to identify tags in your pipeline configurations.
You can use this variable in job rules and workflow rules to test if a pipeline was triggered by a tag.
By default, if your CI/CD jobs don't have specific rules in place,
they are included in a tag pipeline for any newly created tag.
In your `.gitlab-ci.yml` file for the CI/CD pipeline configuration of your project,
you can use the `CI_COMMIT_TAG` variable to control pipelines for new tags:
- At the job level with [`rules:if`](../../../../ci/yaml/_index.md#rulesif).
- At the pipeline level with the [`workflow`](../../../../ci/yaml/workflow.md) keyword.
## Trigger security scans in tag pipelines
By default, scan execution policies only run on branches, not tags. However, you can
configure pipeline execution policies to run security scans on tags.
To run security scans on tags:
1. Create a CI/CD configuration YAML file with custom jobs that extend the security scanner
templates and include rules to run on tags.
1. Create a pipeline execution policy that injects this configuration into your pipelines.
### Example pipeline execution policy
This example shows how to create a pipeline execution policy that runs dependency scanning
and SAST scans on tags:
```yaml
pipeline_execution_policy:
- name: Pipeline Execution Policy
description: Run security scans on tags
enabled: true
pipeline_config_strategy: inject_policy
content:
include:
- project: <Project path to YAML>
file: tag-security-scans.yml
skip_ci:
allowed: false
```
### Example CI/CD configuration
This example shows how to extend security scanner jobs to run on tags:
```yaml
include:
- template: Jobs/Dependency-Scanning.gitlab-ci.yml
- template: Jobs/SAST.gitlab-ci.yml
# Extend dependency scanning to run on tags
gemnasium-python-dependency_scanning_tags:
extends: gemnasium-python-dependency_scanning
rules:
- if: $CI_COMMIT_TAG
# Extend SAST scanning to run on tags
semgrep-sast_tags:
extends: semgrep-sast
rules:
- if: $CI_COMMIT_TAG
# Example of a custom job that runs only on tags
policy_job_for_tags:
script:
- echo "This job runs only on tags"
rules:
- if: $CI_COMMIT_TAG
# Example of a job that runs on all pipelines
policy_job_always:
script:
- echo "This policy job runs always."
```
## Related topics
- [Tagging (Git reference page)](https://git-scm.com/book/en/v2/Git-Basics-Tagging)
- [Protected tags](../../protected_tags.md)
- [Tags API](../../../../api/tags.md)
|
https://docs.gitlab.com/user/project/repository/troubleshooting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repository/troubleshooting.md
|
2025-08-13
|
doc/user/project/repository/monorepos
|
[
"doc",
"user",
"project",
"repository",
"monorepos"
] |
troubleshooting.md
|
Data Access
|
Gitaly
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting monorepo performance
| null |
Review these suggestions for performance problems with monorepos.
## Slowness during `git clone` or `git fetch`
There are a few key causes of slowness with clones and fetches.
### High CPU utilization
If the CPU utilization on your Gitaly nodes is high, you can also check
how much CPU is taken up from clones by [filtering on certain values](observability.md#cpu-and-memory).
In particular, the `command.cpu_time_ms` field can indicate how
much CPU is being taken up by clones and fetches.
In most cases, the bulk of server load is generated from `git-pack-objects`
processes, which is initiated during clones and fetches. Monorepos are often very busy
and CI/CD systems send a lot of clone and fetch commands to the server.
High CPU utilization is a common cause of slow performance.
The following non-mutually exclusive causes are possible:
- [Too many clones for Gitaly to handle](#cause-too-many-large-clones).
- [Poor read distribution on Gitaly Cluster (Praefect)](#cause-poor-read-distribution).
#### Cause: too many large clones
You might have too many large clones for Gitaly to handle. Gitaly can struggle to keep up
because of a number of factors:
- The size of a repository.
- The volume of clones and fetches.
- Lack of CPU capacity.
To help Gitaly process many large clones, you might need to reduce the burden on Gitaly servers through some optimization strategies
such as:
- Turn on [pack-objects-cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache)
to reduce the work that `git-pack-objects` has to do.
- Change [Git strategy](_index.md#use-git-fetch-in-cicd-operations)
in CI/CD settings from `clone` to `fetch` or `none`.
- [Stop fetching tags](_index.md#change-git-fetch-behavior-with-flags),
unless your tests require them.
- [Use shallow clones](_index.md#use-shallow-clones-in-cicd-processes)
whenever possible.
The other option is to increase CPU capacity on Gitaly servers.
#### Cause: poor read distribution
You might have poor read distribution on Gitaly Cluster (Praefect).
To observe if most read traffic is going to the primary Gitaly node instead of
getting distributed across the cluster, use the
[read distribution Prometheus metric](observability.md#read-distribution).
If the secondary Gitaly nodes aren't receiving much traffic, it might be that
the secondary nodes are perpetually out of sync. This problem is exacerbated in
a monorepo.
Monorepos are often both large and busy. This leads to two effects. Firstly,
monorepos are pushed to often and have lots of CI jobs running. There can be
times when write operations such as deleting a branch fails a proxy call to the
secondary nodes. This triggers a replication job in Gitaly Cluster (Praefect) so that
the secondary node will catch up eventually.
The replication job is essentially a `git fetch` from the secondary node to the
primary node, and because monorepos are often very large, this fetch can take a
long time.
If the next call fails before the previous replication job completes, and this
keeps happening, you can end up in a state where your monorepo is constantly
behind in its secondaries. This leads to all traffic going to the primary node.
One reason for these failed proxied writes is a known issue with the Git
`$GIT_DIR/packed-refs` file. The file must be locked to
remove an entry in the file, which can lead to a race condition that causes a
delete to fail when concurrent deletes happen.
Engineers at GitLab have developed mitigations to try to batch reference deletions.
Turn on the following [feature flags](../../../../administration/feature_flags/_index.md) to allow GitLab to batch ref deletions.
These feature flags do not need downtime to enable.
- `merge_request_cleanup_ref_worker_async`
- `pipeline_cleanup_ref_worker_async`
- `pipeline_delete_gitaly_refs_in_batches`
- `merge_request_delete_gitaly_refs_in_batches`
[Epic 4220](https://gitlab.com/groups/gitlab-org/-/epics/4220) proposes to add RefTable support in GitLab,
which is considered a long-term solution.
|
---
stage: Data Access
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Troubleshooting monorepo performance
breadcrumbs:
- doc
- user
- project
- repository
- monorepos
---
Review these suggestions for performance problems with monorepos.
## Slowness during `git clone` or `git fetch`
There are a few key causes of slowness with clones and fetches.
### High CPU utilization
If the CPU utilization on your Gitaly nodes is high, you can also check
how much CPU is taken up from clones by [filtering on certain values](observability.md#cpu-and-memory).
In particular, the `command.cpu_time_ms` field can indicate how
much CPU is being taken up by clones and fetches.
In most cases, the bulk of server load is generated from `git-pack-objects`
processes, which is initiated during clones and fetches. Monorepos are often very busy
and CI/CD systems send a lot of clone and fetch commands to the server.
High CPU utilization is a common cause of slow performance.
The following non-mutually exclusive causes are possible:
- [Too many clones for Gitaly to handle](#cause-too-many-large-clones).
- [Poor read distribution on Gitaly Cluster (Praefect)](#cause-poor-read-distribution).
#### Cause: too many large clones
You might have too many large clones for Gitaly to handle. Gitaly can struggle to keep up
because of a number of factors:
- The size of a repository.
- The volume of clones and fetches.
- Lack of CPU capacity.
To help Gitaly process many large clones, you might need to reduce the burden on Gitaly servers through some optimization strategies
such as:
- Turn on [pack-objects-cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache)
to reduce the work that `git-pack-objects` has to do.
- Change [Git strategy](_index.md#use-git-fetch-in-cicd-operations)
in CI/CD settings from `clone` to `fetch` or `none`.
- [Stop fetching tags](_index.md#change-git-fetch-behavior-with-flags),
unless your tests require them.
- [Use shallow clones](_index.md#use-shallow-clones-in-cicd-processes)
whenever possible.
The other option is to increase CPU capacity on Gitaly servers.
#### Cause: poor read distribution
You might have poor read distribution on Gitaly Cluster (Praefect).
To observe if most read traffic is going to the primary Gitaly node instead of
getting distributed across the cluster, use the
[read distribution Prometheus metric](observability.md#read-distribution).
If the secondary Gitaly nodes aren't receiving much traffic, it might be that
the secondary nodes are perpetually out of sync. This problem is exacerbated in
a monorepo.
Monorepos are often both large and busy. This leads to two effects. Firstly,
monorepos are pushed to often and have lots of CI jobs running. There can be
times when write operations such as deleting a branch fails a proxy call to the
secondary nodes. This triggers a replication job in Gitaly Cluster (Praefect) so that
the secondary node will catch up eventually.
The replication job is essentially a `git fetch` from the secondary node to the
primary node, and because monorepos are often very large, this fetch can take a
long time.
If the next call fails before the previous replication job completes, and this
keeps happening, you can end up in a state where your monorepo is constantly
behind in its secondaries. This leads to all traffic going to the primary node.
One reason for these failed proxied writes is a known issue with the Git
`$GIT_DIR/packed-refs` file. The file must be locked to
remove an entry in the file, which can lead to a race condition that causes a
delete to fail when concurrent deletes happen.
Engineers at GitLab have developed mitigations to try to batch reference deletions.
Turn on the following [feature flags](../../../../administration/feature_flags/_index.md) to allow GitLab to batch ref deletions.
These feature flags do not need downtime to enable.
- `merge_request_cleanup_ref_worker_async`
- `pipeline_cleanup_ref_worker_async`
- `pipeline_delete_gitaly_refs_in_batches`
- `merge_request_delete_gitaly_refs_in_batches`
[Epic 4220](https://gitlab.com/groups/gitlab-org/-/epics/4220) proposes to add RefTable support in GitLab,
which is considered a long-term solution.
|
https://docs.gitlab.com/user/project/repository/observability
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repository/observability.md
|
2025-08-13
|
doc/user/project/repository/monorepos
|
[
"doc",
"user",
"project",
"repository",
"monorepos"
] |
observability.md
|
Data Access
|
Gitaly
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Metrics for measuring monorepo performance
| null |
To measure server-side performance of your monorepo, use these metrics. While they are general metrics
to measure the performance of Gitaly, they are especially relevant to large repositories.
Clones and fetches are the most frequent expensive operations. When taken as a percentage of system resources
consumed, these operations often contribute to 90% or more of system resources on Gitaly nodes.
Your logs and metrics provide clues to the health of your repository.
## CPU and memory
Two main RPCs (remote procedure calls) handle clones and fetches. Use these fields in your Gitaly
logs to inspect how much repository clones and fetches are consuming system resources.
Filter your Gitaly logs by any of these fields to learn more:
| Log field | Values to filter on | Description |
|:----------------------------------|:---------------------------------------------------------------------------------------------|:------------|
| `json.grpc.method` | `PostReceivePack` | The RPC that handles HTTP clones and fetches. |
| `json.grpc.method` | `SSHReceivePack` | The RPC that handles SSH clones and fetches. |
| `json.grpc.code` | `OK` | Whether the RPC served its request successfully. |
| `json.grpc.code` | `Canceled` | Can show if the client killed the connection. Often due to a timeout. |
| `json.grpc.code` | `ResourceExhausted` | Indicates if the machine is spawning too many Git processes simultaneously. |
| `json.user_id` | The `user_id` initiating the clone or fetch, in the form `user-<user_id>`, like `user-22345` | Find excessive clone or fetch operations spawned by a single user. |
| `json.username` | The username who initiated the clone or fetch. | Find excessive clone or fetch operations spawned by a single user. |
| `json.grpc.request.glRepository` | A repository, in the form of `project-<project_id>`, like `project-214` | Find the total clones and fetches for a single repository. |
| `json.grpc.request.glProjectPath` | A repository, in the form of a project path, like `my-org/coolproject` | Find the total clones and fetches for a given repository. |
These log entry fields give information about CPU and memory:
| Log field to inspect | Description |
|:---------------------------|:------------|
| `json.command.cpu_time_ms` | CPU time used by subprocesses spawned from this RPC. |
| `json.command.maxrss` | Memory consumption from subprocesses spawned from this RPC. |
In this example, log message `json.command.cpu_time_ms` was `420`, and `json.command.maxrss` was `3342152`:
```json
{
"command.count":2,
"command.cpu_time_ms":420,
"command.inblock":0,
"command.majflt":0,
"command.maxrss":3342152,
"command.minflt":24316,
"command.oublock":56,
"command.real_time_ms":626,
"command.spawn_token_fork_ms":4,
"command.spawn_token_wait_ms":0,
"command.system_time_ms":172,
"command.user_time_ms":248,
"component":"gitaly.StreamServerInterceptor",
"correlation_id":"20HCB3DAEPLV08UGNIYT9HJ4JW",
"environment":"gprd",
"feature_flags":"",
"fqdn":"file-99-stor-gprd.c.gitlab-production.internal",
"grpc.code":"OK",
"grpc.meta.auth_version":"v2",
"grpc.meta.client_name":"gitlab-workhorse",
"grpc.meta.deadline_type":"none",
"grpc.meta.method_operation":"mutator",
"grpc.meta.method_scope":"repository",
"grpc.meta.method_type":"bidi_stream",
"grpc.method":"PostReceivePack",
"grpc.request.fullMethod":"/gitaly.SmartHTTPService/PostReceivePack",
"grpc.request.glProjectPath":"r2414/revenir/development/machinelearning/protein-ddg",
"grpc.request.glRepository":"project-47506374",
"grpc.request.payload_bytes":911,
"grpc.request.repoPath":"@hashed/db/ab/dbabf83f57affedc9a001dc6c6f6b47bb431bd47d7254edd1daf24f0c38793a9.git",
"grpc.request.repoStorage":"nfs-file99",
"grpc.response.payload_bytes":54,
"grpc.service":"gitaly.SmartHTTPService",
"grpc.start_time":"2023-10-16T20:40:08.836",
"grpc.time_ms":631.486,
"hostname":"file-99-stor-gprd",
"level":"info",
"msg":"finished streaming call with code OK",
"pid":1741362,
"remote_ip":"108.163.136.48",
"shard":"default",
"span.kind":"server",
"stage":"main",
"system":"grpc",
"tag":"gitaly",
"tier":"stor",
"time":"2023-10-16T20:40:09.467Z",
"trace.traceid":"AAB3QAeD8G+H9VNmzOi2CztMAcJv1+g4+l1cAgA=",
"type":"gitaly",
"user_id":"user-14857500",
"username":"ctx_ckottke",
}
```
## Read distribution
To check the number of reads to each Gitaly node, check `gitaly_praefect_read_distribution`.
This Prometheus metric is a [counter](https://prometheus.io/docs/concepts/metric_types/#counter),
and has two vectors:
| Metric name | Vector | Description |
|-------------------------------------|-------------------|-------------|
| `gitaly_praefect_read_distribution` | `virtual_storage` | The [virtual storage](../../../../administration/gitaly/praefect/_index.md) name. |
| `gitaly_praefect_read_distribution` | `storage` | The Gitaly storage name. |
## Pack objects cache
To check the [pack objects cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache),
check your logs and your Prometheus metrics:
| Log field name | Description |
|:--------------------------------------|:------------|
| `pack_objects_cache.hit` | Whether the current pack-objects cache was hit. (`true` or `false`) |
| `pack_objects_cache.key` | Cache key used for the pack-objects cache. |
| `pack_objects_cache.generated_bytes` | Size in bytes of the new cache being written. |
| `pack_objects_cache.served_bytes` | Size in bytes of the cache being served. |
| `pack_objects.compression_statistics` | Statistics for pack-objects generation. |
| `pack_objects.enumerate_objects_ms` | Total time, in ms, spent enumerating objects sent by clients. |
| `pack_objects.prepare_pack_ms` | Total time, in ms, spent preparing the packfile before sending it back to the client |
| `pack_objects.write_pack_file_ms` | Total time, in ms, spent sending the packfile back to the client. Highly dependent on the client's internet connection. |
| `pack_objects.written_object_count` | Total number of objects Gitaly sent back to the client. |
Example log message:
```json
{
"bytes":26186490,
"correlation_id":"01F1MY8JXC3FZN14JBG1H42G9F",
"grpc.meta.deadline_type":"none",
"grpc.method":"PackObjectsHook",
"grpc.request.fullMethod":"/gitaly.HookService/PackObjectsHook",
"grpc.request.glProjectPath":"root/gitlab-workhorse",
"grpc.request.glRepository":"project-2",
"grpc.request.repoPath":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git",
"grpc.request.repoStorage":"default",
"grpc.request.topLevelGroup":"@hashed",
"grpc.service":"gitaly.HookService",
"grpc.start_time":"2021-03-25T14:57:52.747Z",
"level":"info",
"msg":"finished unary call with code OK",
"peer.address":"@",
"pid":20961,
"span.kind":"server",
"system":"grpc",
"time":"2021-03-25T14:57:53.543Z",
"pack_objects.compression_statistics": "Total 145991 (delta 68), reused 6 (delta 2), pack-reused 145911",
"pack_objects.enumerate_objects_ms": 170,
"pack_objects.prepare_pack_ms": 7,
"pack_objects.write_pack_file_ms": 786,
"pack_objects.written_object_count": 145991,
"pack_objects_cache.generated_bytes": 49533030,
"pack_objects_cache.hit": "false",
"pack_objects_cache.key": "123456789",
"pack_objects_cache.served_bytes": 49533030,
"peer.address": "127.0.0.1",
"pid": 8813,
}
```
| Prometheus metric name | Vector | Description |
|:------------------------------------------|:---------|:------------|
| `gitaly_pack_objects_served_bytes_total` | | Size (in bytes) of the cache being served. |
| `gitaly_pack_objects_cache_lookups_total` | `result` | Whether a cache lookup resulted in a `hit` or `miss`. |
|
---
stage: Data Access
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Metrics for measuring monorepo performance
breadcrumbs:
- doc
- user
- project
- repository
- monorepos
---
To measure server-side performance of your monorepo, use these metrics. While they are general metrics
to measure the performance of Gitaly, they are especially relevant to large repositories.
Clones and fetches are the most frequent expensive operations. When taken as a percentage of system resources
consumed, these operations often contribute to 90% or more of system resources on Gitaly nodes.
Your logs and metrics provide clues to the health of your repository.
## CPU and memory
Two main RPCs (remote procedure calls) handle clones and fetches. Use these fields in your Gitaly
logs to inspect how much repository clones and fetches are consuming system resources.
Filter your Gitaly logs by any of these fields to learn more:
| Log field | Values to filter on | Description |
|:----------------------------------|:---------------------------------------------------------------------------------------------|:------------|
| `json.grpc.method` | `PostReceivePack` | The RPC that handles HTTP clones and fetches. |
| `json.grpc.method` | `SSHReceivePack` | The RPC that handles SSH clones and fetches. |
| `json.grpc.code` | `OK` | Whether the RPC served its request successfully. |
| `json.grpc.code` | `Canceled` | Can show if the client killed the connection. Often due to a timeout. |
| `json.grpc.code` | `ResourceExhausted` | Indicates if the machine is spawning too many Git processes simultaneously. |
| `json.user_id` | The `user_id` initiating the clone or fetch, in the form `user-<user_id>`, like `user-22345` | Find excessive clone or fetch operations spawned by a single user. |
| `json.username` | The username who initiated the clone or fetch. | Find excessive clone or fetch operations spawned by a single user. |
| `json.grpc.request.glRepository` | A repository, in the form of `project-<project_id>`, like `project-214` | Find the total clones and fetches for a single repository. |
| `json.grpc.request.glProjectPath` | A repository, in the form of a project path, like `my-org/coolproject` | Find the total clones and fetches for a given repository. |
These log entry fields give information about CPU and memory:
| Log field to inspect | Description |
|:---------------------------|:------------|
| `json.command.cpu_time_ms` | CPU time used by subprocesses spawned from this RPC. |
| `json.command.maxrss` | Memory consumption from subprocesses spawned from this RPC. |
In this example, log message `json.command.cpu_time_ms` was `420`, and `json.command.maxrss` was `3342152`:
```json
{
"command.count":2,
"command.cpu_time_ms":420,
"command.inblock":0,
"command.majflt":0,
"command.maxrss":3342152,
"command.minflt":24316,
"command.oublock":56,
"command.real_time_ms":626,
"command.spawn_token_fork_ms":4,
"command.spawn_token_wait_ms":0,
"command.system_time_ms":172,
"command.user_time_ms":248,
"component":"gitaly.StreamServerInterceptor",
"correlation_id":"20HCB3DAEPLV08UGNIYT9HJ4JW",
"environment":"gprd",
"feature_flags":"",
"fqdn":"file-99-stor-gprd.c.gitlab-production.internal",
"grpc.code":"OK",
"grpc.meta.auth_version":"v2",
"grpc.meta.client_name":"gitlab-workhorse",
"grpc.meta.deadline_type":"none",
"grpc.meta.method_operation":"mutator",
"grpc.meta.method_scope":"repository",
"grpc.meta.method_type":"bidi_stream",
"grpc.method":"PostReceivePack",
"grpc.request.fullMethod":"/gitaly.SmartHTTPService/PostReceivePack",
"grpc.request.glProjectPath":"r2414/revenir/development/machinelearning/protein-ddg",
"grpc.request.glRepository":"project-47506374",
"grpc.request.payload_bytes":911,
"grpc.request.repoPath":"@hashed/db/ab/dbabf83f57affedc9a001dc6c6f6b47bb431bd47d7254edd1daf24f0c38793a9.git",
"grpc.request.repoStorage":"nfs-file99",
"grpc.response.payload_bytes":54,
"grpc.service":"gitaly.SmartHTTPService",
"grpc.start_time":"2023-10-16T20:40:08.836",
"grpc.time_ms":631.486,
"hostname":"file-99-stor-gprd",
"level":"info",
"msg":"finished streaming call with code OK",
"pid":1741362,
"remote_ip":"108.163.136.48",
"shard":"default",
"span.kind":"server",
"stage":"main",
"system":"grpc",
"tag":"gitaly",
"tier":"stor",
"time":"2023-10-16T20:40:09.467Z",
"trace.traceid":"AAB3QAeD8G+H9VNmzOi2CztMAcJv1+g4+l1cAgA=",
"type":"gitaly",
"user_id":"user-14857500",
"username":"ctx_ckottke",
}
```
## Read distribution
To check the number of reads to each Gitaly node, check `gitaly_praefect_read_distribution`.
This Prometheus metric is a [counter](https://prometheus.io/docs/concepts/metric_types/#counter),
and has two vectors:
| Metric name | Vector | Description |
|-------------------------------------|-------------------|-------------|
| `gitaly_praefect_read_distribution` | `virtual_storage` | The [virtual storage](../../../../administration/gitaly/praefect/_index.md) name. |
| `gitaly_praefect_read_distribution` | `storage` | The Gitaly storage name. |
## Pack objects cache
To check the [pack objects cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache),
check your logs and your Prometheus metrics:
| Log field name | Description |
|:--------------------------------------|:------------|
| `pack_objects_cache.hit` | Whether the current pack-objects cache was hit. (`true` or `false`) |
| `pack_objects_cache.key` | Cache key used for the pack-objects cache. |
| `pack_objects_cache.generated_bytes` | Size in bytes of the new cache being written. |
| `pack_objects_cache.served_bytes` | Size in bytes of the cache being served. |
| `pack_objects.compression_statistics` | Statistics for pack-objects generation. |
| `pack_objects.enumerate_objects_ms` | Total time, in ms, spent enumerating objects sent by clients. |
| `pack_objects.prepare_pack_ms` | Total time, in ms, spent preparing the packfile before sending it back to the client |
| `pack_objects.write_pack_file_ms` | Total time, in ms, spent sending the packfile back to the client. Highly dependent on the client's internet connection. |
| `pack_objects.written_object_count` | Total number of objects Gitaly sent back to the client. |
Example log message:
```json
{
"bytes":26186490,
"correlation_id":"01F1MY8JXC3FZN14JBG1H42G9F",
"grpc.meta.deadline_type":"none",
"grpc.method":"PackObjectsHook",
"grpc.request.fullMethod":"/gitaly.HookService/PackObjectsHook",
"grpc.request.glProjectPath":"root/gitlab-workhorse",
"grpc.request.glRepository":"project-2",
"grpc.request.repoPath":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git",
"grpc.request.repoStorage":"default",
"grpc.request.topLevelGroup":"@hashed",
"grpc.service":"gitaly.HookService",
"grpc.start_time":"2021-03-25T14:57:52.747Z",
"level":"info",
"msg":"finished unary call with code OK",
"peer.address":"@",
"pid":20961,
"span.kind":"server",
"system":"grpc",
"time":"2021-03-25T14:57:53.543Z",
"pack_objects.compression_statistics": "Total 145991 (delta 68), reused 6 (delta 2), pack-reused 145911",
"pack_objects.enumerate_objects_ms": 170,
"pack_objects.prepare_pack_ms": 7,
"pack_objects.write_pack_file_ms": 786,
"pack_objects.written_object_count": 145991,
"pack_objects_cache.generated_bytes": 49533030,
"pack_objects_cache.hit": "false",
"pack_objects_cache.key": "123456789",
"pack_objects_cache.served_bytes": 49533030,
"peer.address": "127.0.0.1",
"pid": 8813,
}
```
| Prometheus metric name | Vector | Description |
|:------------------------------------------|:---------|:------------|
| `gitaly_pack_objects_served_bytes_total` | | Size (in bytes) of the cache being served. |
| `gitaly_pack_objects_cache_lookups_total` | `result` | Whether a cache lookup resulted in a `hit` or `miss`. |
|
https://docs.gitlab.com/user/project/repository/monorepos
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repository/_index.md
|
2025-08-13
|
doc/user/project/repository/monorepos
|
[
"doc",
"user",
"project",
"repository",
"monorepos"
] |
_index.md
|
Data Access
|
Gitaly
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Improving monorepo performance
| null |
A monorepo is a repository that contains sub-projects. A single application often
contains interdependent projects. For example, a backend, a web frontend, an iOS application, and an Android
application. Monorepos are common, but they can present performance risks. Some common problems:
- Large binary files.
- Many files with long histories.
- Many simultaneous clones and pushes.
- Vertical scaling limits.
- Network bandwidth limits.
- Disk bandwidth limits.
GitLab is itself based in Git. Its Git storage service, [Gitaly](https://gitlab.com/gitlab-org/gitaly),
experiences the performance constraints associated with monorepos. What we've learned can help
you manage your own monorepo better.
- What repository characteristics can impact performance.
- Some tools and steps to optimize monorepos.
## Optimize Gitaly for monorepos
Git compresses objects into [packfiles](https://git-scm.com/book/en/v2/Git-Internals-Packfiles)
to use less space. When you clone, fetch, or push, Git uses packfiles. They reduce disk space
and network bandwidth, but packfile creation requires much CPU and memory.
Massive monorepos have more commits, files, branches, and tags than smaller repositories. When the objects
become larger, and take longer to transfer, packfile creation becomes more expensive
and slower. In Git, the [`git-pack-objects`](https://git-scm.com/docs/git-pack-objects) process is
the most resource intensive operation, because it:
1. Analyzes the commit history and files.
1. Determines which files to send back to the client.
1. Creates packfiles.
Traffic from `git clone` and `git fetch` starts a `git-pack-objects` process on the server.
Automated continuous integration systems, like GitLab CI/CD, can cause much of this traffic.
High amounts of automated CI/CD traffic send many clone and fetch requests, and can strain your
Gitaly server.
Use these strategies to decrease load on your Gitaly server.
### Enable the Gitaly `pack-objects` cache
Enable the [Gitaly `pack-objects` cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache),
which reduces server load for clones and fetches.
When a Git client sends a clone or fetch request, the data produced by `git-pack-objects` can be
cached for reuse. If your monorepo is cloned frequently, enabling
[Gitaly `pack-objects` cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache),
reduces server load. When enabled, Gitaly maintains an in-memory cache instead of regenerating
response data for each clone or fetch call.
For more information, see
[Pack-objects cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache).
### Configure Git bundle URIs
Create and store [Git bundles](https://git-scm.com/docs/bundle-uri) on third-party storage with low
latency, like a CDN. Git downloads packages from your bundle first, then fetches any remaining objects
and references from your Git remote. This approach bootstraps your object database faster and reduces
load on Gitaly.
- It speeds up clones and fetches for users with a poor network connection to your GitLab server.
- It reduces the load on servers that run CI/CD jobs by pre-loading bundles.
To learn more, see [Bundle URIs](../../../../administration/gitaly/bundle_uris.md).
### Configure Gitaly negotiation timeouts
When attempting to fetch or archive repositories, `fatal: the remote end hung up unexpectedly` errors
can happen if you have:
- Large repositories.
- Many repositories in parallel.
- The same large repository in parallel.
To mitigate this issue, increase the
[default negotiation timeout values](../../../../administration/settings/gitaly_timeouts.md#configure-the-negotiation-timeouts).
### Size your hardware correctly
Monorepos are usually for larger organizations with many users. To support your monorepo,
your GitLab environment should match one of the
[reference architectures](../../../../administration/reference_architectures/_index.md)
provided by the GitLab Test Platform and Support teams. These architectures are the recommended
way to deploy GitLab at scale while maintaining performance.
### Reduce the number of Git references
In Git, [references](https://git-scm.com/book/en/v2/Git-Internals-Git-References)
are branch and tag names that point to specific commits. Git stores references as loose files in the
`.git/refs` folder of your repository. To see all references in your repository,
run `git for-each-ref`.
When the number of references in your repository grows, the seek time needed to
find a specific reference also grows. Each time Git parses a reference, the increased seek time
leads to increased latency.
To fix this problem, Git uses [pack-refs](https://git-scm.com/docs/git-pack-refs) to create a single
`.git/packed-refs` file containing all references for that repository. This method reduces the storage
space needed for refs. It also decreases seek time, because seeking in a single file is faster than seeking
through all files in a directory.
Git handles newly created or updated references with loose files. They are not cleaned up and added to the
`.git/packed-refs` file until you run `git pack-refs`. Gitaly runs `git pack-refs` during
[housekeeping](../../../../administration/housekeeping.md#heuristical-housekeeping). While this helps
many repositories, write-heavy repositories still have these performance problems:
- Creating or updating references creates new loose files.
- Deleting references requires editing the existing `packed-refs` file to remove the existing reference.
Git iterates through all references when you fetch or clone a repository. The server reviews ("walks")
the internal graph structure of each reference, finds any missing objects, and sends them to the client.
The iteration and walking processes are CPU-intensive, and increase latency. This latency can cause
a domino effect in repositories with a lot of activity. Each operation is slower, and each operation
stalls later operations.
To mitigate the effects of a large number of references in a monorepo:
- Create an automated process for cleaning up old branches.
- If certain references don't need to be visible to the client, hide them using the
[`transfer.hideRefs`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-transferhideRefs)
configuration setting. Gitaly ignores any on-server Git configuration, so you must change the Gitaly
configuration itself in `/etc/gitlab/gitlab.rb`:
```ruby
gitaly['configuration'] = {
# ...
git: {
# ...
config: [
# ...
{ key: "transfer.hideRefs", value: "refs/namespace_to_hide" },
],
},
}
```
In Git 2.42.0 and later, different Git operations can skip over hidden references
when doing an object graph walk.
## Optimize CI/CD for monorepos
To keep GitLab scalable with your monorepo, optimize how your CI/CD jobs interact with your
repository.
### Reduce concurrent clones in CI/CD
Reduce CI/CD pipeline concurrency by
[staggering your scheduled pipelines](../../../../ci/pipelines/schedules.md#view-and-optimize-pipeline-schedules)
to run at different times. Even a few minutes apart can help.
CI/CD loads are often concurrent, because pipelines are
[scheduled at specific times](../../../../ci/pipelines/pipeline_efficiency.md#reduce-how-often-jobs-run).
Git requests to your repository can spike during these times, and affect performance for CI/CD processes
and users.
### Use shallow clones in CI/CD processes
For `git clone` and `git fetch` calls in your CI/CD systems, set the
[`--depth`](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt)
option with a small number, like 10. A depth of 10 instructs Git to request only the last 10 changes
for a given branch. If your repository has a long backlog, or many large files, this change can
make Git fetches much faster. It reduces the amount of data transferred.
GitLab and GitLab Runner perform a
[shallow clone](../../../../ci/pipelines/settings.md#limit-the-number-of-changes-fetched-during-clone)
by default.
This GitLab CI/CD pipeline configuration example sets the `GIT_DEPTH`:
```yaml
variables:
GIT_DEPTH: 10
test:
script:
- ls -al
```
### Use `git fetch` in CI/CD operations
If it's possible to keep a working copy of the repository available, use `git fetch` instead of
`git clone` on CI/CD systems. `git fetch` requires less work from the server:
- `git clone` requests the entire repository from scratch. `git-pack-objects` must process and send
all branches and tags.
- `git fetch` requests only the Git references missing from the repository. `git-pack-objects`
processes only a subset of the total Git references. This strategy also reduces the total data transferred.
By default, GitLab uses the
[`fetch` Git strategy](../../../../ci/runners/configure_runners.md#git-strategy) recommended for large repositories.
### Set a `git clone` path
If your monorepo is used with a fork-based workflow, consider setting
[`GIT_CLONE_PATH`](../../../../ci/runners/configure_runners.md#custom-build-directories) to control
where you clone your repository.
Git stores forks as separate repositories with separate worktrees. GitLab Runner cannot optimize
the use of worktrees. Configure and use the GitLab Runner executor only for the given project.
To make the process more efficient, don't share it across different projects.
The [`GIT_CLONE_PATH`](../../../../ci/runners/configure_runners.md#custom-build-directories) must be
in the directory set in `$CI_BUILDS_DIR`. You can't pick any path from disk.
### Disable `git clean` on CI/CD jobs
The `git clean` command removes untracked files from the working tree. In large repositories, it uses
a lot of disk I/O. If you reuse existing machines, and can reuse an existing worktree, consider
disabling it on CI/CD jobs. For example, `GIT_CLEAN_FLAGS: -ffdx -e .build/` can avoid deleting directories
from the worktree between runs. This can speed up incremental builds.
To disable `git clean` on CI/CD jobs, set
[`GIT_CLEAN_FLAGS`](../../../../ci/runners/configure_runners.md#git-clean-flags) to `none` for them.
By default, GitLab ensures that:
- You have your worktree on the given SHA.
- Your repository is clean.
For exact parameters accepted by `GIT_CLEAN_FLAGS`, see the Git documentation for
[`git clean`](https://git-scm.com/docs/git-clean). The available parameters depend on your Git version.
### Change `git fetch` behavior with flags
Change the behavior of `git fetch` to exclude any data your CI/CD jobs do not need. If your project contains
many tags, and your CI/CD jobs do not need them, use `GIT_FETCH_EXTRA_FLAGS` to set
[`--no-tags`](https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---no-tags). This setting
can make your fetches faster and more compact.
Even if your repository does not contain many tags, `--no-tags` can improve performance in some cases.
For more information, see [issue 746](https://gitlab.com/gitlab-com/gl-infra/observability/team/-/issues/746)
and the [`GIT_FETCH_EXTRA_FLAGS` Git documentation](../../../../ci/runners/configure_runners.md#git-fetch-extra-flags).
## Optimize Git for monorepos
To keep GitLab scalable with your monorepo, optimize the repository itself.
### Avoid shallow clones for development
Avoid shallow clones for development. Shallow clones greatly increase the time needed to push changes.
Shallow clones work well with CI/CD jobs, because repository contents aren't changed after checkout.
For local development, use
[partial clones](https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---filterltfilter-specgt) instead, to:
- Filter out blobs, with `git clone --filter=blob:none`
- Filter out trees, with `git clone --filter=tree:0`
For more information, see [Reduce clone size](../../../../topics/git/clone.md#reduce-clone-size).
### Profile your repository to find problems
Large repositories generally experience performance issues in Git. The
[`git-sizer`](https://github.com/github/git-sizer) project profiles your repository, and helps you understand
potential problems. It can help you develop mitigation strategies to prevent performance problems.
Analyzing your repository requires a full Git mirror or bare clone, to ensure all Git references
are present.
To profile your repository with `git-sizer`:
1. [Install `git-sizer`](https://github.com/github/git-sizer?tab=readme-ov-file#getting-started).
1. Run this command to clone your repository in the bare Git format compatible with `git-sizer`:
```shell
git clone --mirror <git_repo_url>
```
1. In the directory of your Git repository, run `git-sizer` with all statistics:
```shell
git-sizer -v
```
After processing, the output of `git-sizer` should look like this example. Each row includes a
**Level of concern** for that aspect of the repository. Higher levels of concern are shown with more
asterisks. Items with extremely high levels of concern are shown with exclamation marks. In this example,
a few items have a high level of concern:
```shell
Processing blobs: 1652370
Processing trees: 3396199
Processing commits: 722647
Matching commits to trees: 722647
Processing annotated tags: 534
Processing references: 539
| Name | Value | Level of concern |
| ---------------------------- | --------- | ------------------------------ |
| Overall repository size | | |
| * Commits | | |
| * Count | 723 k | * |
| * Total size | 525 MiB | ** |
| * Trees | | |
| * Count | 3.40 M | ** |
| * Total size | 9.00 GiB | **** |
| * Total tree entries | 264 M | ***** |
| * Blobs | | |
| * Count | 1.65 M | * |
| * Total size | 55.8 GiB | ***** |
| * Annotated tags | | |
| * Count | 534 | |
| * References | | |
| * Count | 539 | |
| | | |
| Biggest objects | | |
| * Commits | | |
| * Maximum size [1] | 72.7 KiB | * |
| * Maximum parents [2] | 66 | ****** |
| * Trees | | |
| * Maximum entries [3] | 1.68 k | * |
| * Blobs | | |
| * Maximum size [4] | 13.5 MiB | * |
| | | |
| History structure | | |
| * Maximum history depth | 136 k | |
| * Maximum tag depth [5] | 1 | |
| | | |
| Biggest checkouts | | |
| * Number of directories [6] | 4.38 k | ** |
| * Maximum path depth [7] | 13 | * |
| * Maximum path length [8] | 134 B | * |
| * Number of files [9] | 62.3 k | * |
| * Total size of files [9] | 747 MiB | |
| * Number of symlinks [10] | 40 | |
| * Number of submodules | 0 | |
```
### Use Git LFS for large binary files
Store binary files (like packages, audio, video, or graphics) as Git Large File Storage (Git LFS) objects.
When users commit files into Git, Git uses the blob
[object type](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to store and manage their content.
Git does not handle large binary data efficiently, so large blobs are problematic for Git. If `git-sizer`
reports blobs of over 10 MB, you usually have large binary files in your repository. Large binary files
cause problems for both server and client:
- For the server: unlike text-based source code, binary data is often already compressed.
Git can't compress binary data further, which leads to large packfiles. Large packfiles
require more CPU, memory, and bandwidth to create and send.
- For the client: Git stores blob content in both packfiles (usually in `.git/objects/pack/`) and
regular files (in [worktrees](https://git-scm.com/docs/git-worktree)), binary files require far more
space than text-based source code.
Git LFS stores objects externally, such as in object storage. Your Git repository contains a pointer
to the object's location, rather than the binary file itself. This can improve repository performance.
For more information, see the [Git LFS documentation](../../../../topics/git/lfs/_index.md).
|
---
stage: Data Access
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Improving monorepo performance
breadcrumbs:
- doc
- user
- project
- repository
- monorepos
---
A monorepo is a repository that contains sub-projects. A single application often
contains interdependent projects. For example, a backend, a web frontend, an iOS application, and an Android
application. Monorepos are common, but they can present performance risks. Some common problems:
- Large binary files.
- Many files with long histories.
- Many simultaneous clones and pushes.
- Vertical scaling limits.
- Network bandwidth limits.
- Disk bandwidth limits.
GitLab is itself based in Git. Its Git storage service, [Gitaly](https://gitlab.com/gitlab-org/gitaly),
experiences the performance constraints associated with monorepos. What we've learned can help
you manage your own monorepo better.
- What repository characteristics can impact performance.
- Some tools and steps to optimize monorepos.
## Optimize Gitaly for monorepos
Git compresses objects into [packfiles](https://git-scm.com/book/en/v2/Git-Internals-Packfiles)
to use less space. When you clone, fetch, or push, Git uses packfiles. They reduce disk space
and network bandwidth, but packfile creation requires much CPU and memory.
Massive monorepos have more commits, files, branches, and tags than smaller repositories. When the objects
become larger, and take longer to transfer, packfile creation becomes more expensive
and slower. In Git, the [`git-pack-objects`](https://git-scm.com/docs/git-pack-objects) process is
the most resource intensive operation, because it:
1. Analyzes the commit history and files.
1. Determines which files to send back to the client.
1. Creates packfiles.
Traffic from `git clone` and `git fetch` starts a `git-pack-objects` process on the server.
Automated continuous integration systems, like GitLab CI/CD, can cause much of this traffic.
High amounts of automated CI/CD traffic send many clone and fetch requests, and can strain your
Gitaly server.
Use these strategies to decrease load on your Gitaly server.
### Enable the Gitaly `pack-objects` cache
Enable the [Gitaly `pack-objects` cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache),
which reduces server load for clones and fetches.
When a Git client sends a clone or fetch request, the data produced by `git-pack-objects` can be
cached for reuse. If your monorepo is cloned frequently, enabling
[Gitaly `pack-objects` cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache),
reduces server load. When enabled, Gitaly maintains an in-memory cache instead of regenerating
response data for each clone or fetch call.
For more information, see
[Pack-objects cache](../../../../administration/gitaly/configure_gitaly.md#pack-objects-cache).
### Configure Git bundle URIs
Create and store [Git bundles](https://git-scm.com/docs/bundle-uri) on third-party storage with low
latency, like a CDN. Git downloads packages from your bundle first, then fetches any remaining objects
and references from your Git remote. This approach bootstraps your object database faster and reduces
load on Gitaly.
- It speeds up clones and fetches for users with a poor network connection to your GitLab server.
- It reduces the load on servers that run CI/CD jobs by pre-loading bundles.
To learn more, see [Bundle URIs](../../../../administration/gitaly/bundle_uris.md).
### Configure Gitaly negotiation timeouts
When attempting to fetch or archive repositories, `fatal: the remote end hung up unexpectedly` errors
can happen if you have:
- Large repositories.
- Many repositories in parallel.
- The same large repository in parallel.
To mitigate this issue, increase the
[default negotiation timeout values](../../../../administration/settings/gitaly_timeouts.md#configure-the-negotiation-timeouts).
### Size your hardware correctly
Monorepos are usually for larger organizations with many users. To support your monorepo,
your GitLab environment should match one of the
[reference architectures](../../../../administration/reference_architectures/_index.md)
provided by the GitLab Test Platform and Support teams. These architectures are the recommended
way to deploy GitLab at scale while maintaining performance.
### Reduce the number of Git references
In Git, [references](https://git-scm.com/book/en/v2/Git-Internals-Git-References)
are branch and tag names that point to specific commits. Git stores references as loose files in the
`.git/refs` folder of your repository. To see all references in your repository,
run `git for-each-ref`.
When the number of references in your repository grows, the seek time needed to
find a specific reference also grows. Each time Git parses a reference, the increased seek time
leads to increased latency.
To fix this problem, Git uses [pack-refs](https://git-scm.com/docs/git-pack-refs) to create a single
`.git/packed-refs` file containing all references for that repository. This method reduces the storage
space needed for refs. It also decreases seek time, because seeking in a single file is faster than seeking
through all files in a directory.
Git handles newly created or updated references with loose files. They are not cleaned up and added to the
`.git/packed-refs` file until you run `git pack-refs`. Gitaly runs `git pack-refs` during
[housekeeping](../../../../administration/housekeeping.md#heuristical-housekeeping). While this helps
many repositories, write-heavy repositories still have these performance problems:
- Creating or updating references creates new loose files.
- Deleting references requires editing the existing `packed-refs` file to remove the existing reference.
Git iterates through all references when you fetch or clone a repository. The server reviews ("walks")
the internal graph structure of each reference, finds any missing objects, and sends them to the client.
The iteration and walking processes are CPU-intensive, and increase latency. This latency can cause
a domino effect in repositories with a lot of activity. Each operation is slower, and each operation
stalls later operations.
To mitigate the effects of a large number of references in a monorepo:
- Create an automated process for cleaning up old branches.
- If certain references don't need to be visible to the client, hide them using the
[`transfer.hideRefs`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-transferhideRefs)
configuration setting. Gitaly ignores any on-server Git configuration, so you must change the Gitaly
configuration itself in `/etc/gitlab/gitlab.rb`:
```ruby
gitaly['configuration'] = {
# ...
git: {
# ...
config: [
# ...
{ key: "transfer.hideRefs", value: "refs/namespace_to_hide" },
],
},
}
```
In Git 2.42.0 and later, different Git operations can skip over hidden references
when doing an object graph walk.
## Optimize CI/CD for monorepos
To keep GitLab scalable with your monorepo, optimize how your CI/CD jobs interact with your
repository.
### Reduce concurrent clones in CI/CD
Reduce CI/CD pipeline concurrency by
[staggering your scheduled pipelines](../../../../ci/pipelines/schedules.md#view-and-optimize-pipeline-schedules)
to run at different times. Even a few minutes apart can help.
CI/CD loads are often concurrent, because pipelines are
[scheduled at specific times](../../../../ci/pipelines/pipeline_efficiency.md#reduce-how-often-jobs-run).
Git requests to your repository can spike during these times, and affect performance for CI/CD processes
and users.
### Use shallow clones in CI/CD processes
For `git clone` and `git fetch` calls in your CI/CD systems, set the
[`--depth`](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt)
option with a small number, like 10. A depth of 10 instructs Git to request only the last 10 changes
for a given branch. If your repository has a long backlog, or many large files, this change can
make Git fetches much faster. It reduces the amount of data transferred.
GitLab and GitLab Runner perform a
[shallow clone](../../../../ci/pipelines/settings.md#limit-the-number-of-changes-fetched-during-clone)
by default.
This GitLab CI/CD pipeline configuration example sets the `GIT_DEPTH`:
```yaml
variables:
GIT_DEPTH: 10
test:
script:
- ls -al
```
### Use `git fetch` in CI/CD operations
If it's possible to keep a working copy of the repository available, use `git fetch` instead of
`git clone` on CI/CD systems. `git fetch` requires less work from the server:
- `git clone` requests the entire repository from scratch. `git-pack-objects` must process and send
all branches and tags.
- `git fetch` requests only the Git references missing from the repository. `git-pack-objects`
processes only a subset of the total Git references. This strategy also reduces the total data transferred.
By default, GitLab uses the
[`fetch` Git strategy](../../../../ci/runners/configure_runners.md#git-strategy) recommended for large repositories.
### Set a `git clone` path
If your monorepo is used with a fork-based workflow, consider setting
[`GIT_CLONE_PATH`](../../../../ci/runners/configure_runners.md#custom-build-directories) to control
where you clone your repository.
Git stores forks as separate repositories with separate worktrees. GitLab Runner cannot optimize
the use of worktrees. Configure and use the GitLab Runner executor only for the given project.
To make the process more efficient, don't share it across different projects.
The [`GIT_CLONE_PATH`](../../../../ci/runners/configure_runners.md#custom-build-directories) must be
in the directory set in `$CI_BUILDS_DIR`. You can't pick any path from disk.
### Disable `git clean` on CI/CD jobs
The `git clean` command removes untracked files from the working tree. In large repositories, it uses
a lot of disk I/O. If you reuse existing machines, and can reuse an existing worktree, consider
disabling it on CI/CD jobs. For example, `GIT_CLEAN_FLAGS: -ffdx -e .build/` can avoid deleting directories
from the worktree between runs. This can speed up incremental builds.
To disable `git clean` on CI/CD jobs, set
[`GIT_CLEAN_FLAGS`](../../../../ci/runners/configure_runners.md#git-clean-flags) to `none` for them.
By default, GitLab ensures that:
- You have your worktree on the given SHA.
- Your repository is clean.
For exact parameters accepted by `GIT_CLEAN_FLAGS`, see the Git documentation for
[`git clean`](https://git-scm.com/docs/git-clean). The available parameters depend on your Git version.
### Change `git fetch` behavior with flags
Change the behavior of `git fetch` to exclude any data your CI/CD jobs do not need. If your project contains
many tags, and your CI/CD jobs do not need them, use `GIT_FETCH_EXTRA_FLAGS` to set
[`--no-tags`](https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---no-tags). This setting
can make your fetches faster and more compact.
Even if your repository does not contain many tags, `--no-tags` can improve performance in some cases.
For more information, see [issue 746](https://gitlab.com/gitlab-com/gl-infra/observability/team/-/issues/746)
and the [`GIT_FETCH_EXTRA_FLAGS` Git documentation](../../../../ci/runners/configure_runners.md#git-fetch-extra-flags).
## Optimize Git for monorepos
To keep GitLab scalable with your monorepo, optimize the repository itself.
### Avoid shallow clones for development
Avoid shallow clones for development. Shallow clones greatly increase the time needed to push changes.
Shallow clones work well with CI/CD jobs, because repository contents aren't changed after checkout.
For local development, use
[partial clones](https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---filterltfilter-specgt) instead, to:
- Filter out blobs, with `git clone --filter=blob:none`
- Filter out trees, with `git clone --filter=tree:0`
For more information, see [Reduce clone size](../../../../topics/git/clone.md#reduce-clone-size).
### Profile your repository to find problems
Large repositories generally experience performance issues in Git. The
[`git-sizer`](https://github.com/github/git-sizer) project profiles your repository, and helps you understand
potential problems. It can help you develop mitigation strategies to prevent performance problems.
Analyzing your repository requires a full Git mirror or bare clone, to ensure all Git references
are present.
To profile your repository with `git-sizer`:
1. [Install `git-sizer`](https://github.com/github/git-sizer?tab=readme-ov-file#getting-started).
1. Run this command to clone your repository in the bare Git format compatible with `git-sizer`:
```shell
git clone --mirror <git_repo_url>
```
1. In the directory of your Git repository, run `git-sizer` with all statistics:
```shell
git-sizer -v
```
After processing, the output of `git-sizer` should look like this example. Each row includes a
**Level of concern** for that aspect of the repository. Higher levels of concern are shown with more
asterisks. Items with extremely high levels of concern are shown with exclamation marks. In this example,
a few items have a high level of concern:
```shell
Processing blobs: 1652370
Processing trees: 3396199
Processing commits: 722647
Matching commits to trees: 722647
Processing annotated tags: 534
Processing references: 539
| Name | Value | Level of concern |
| ---------------------------- | --------- | ------------------------------ |
| Overall repository size | | |
| * Commits | | |
| * Count | 723 k | * |
| * Total size | 525 MiB | ** |
| * Trees | | |
| * Count | 3.40 M | ** |
| * Total size | 9.00 GiB | **** |
| * Total tree entries | 264 M | ***** |
| * Blobs | | |
| * Count | 1.65 M | * |
| * Total size | 55.8 GiB | ***** |
| * Annotated tags | | |
| * Count | 534 | |
| * References | | |
| * Count | 539 | |
| | | |
| Biggest objects | | |
| * Commits | | |
| * Maximum size [1] | 72.7 KiB | * |
| * Maximum parents [2] | 66 | ****** |
| * Trees | | |
| * Maximum entries [3] | 1.68 k | * |
| * Blobs | | |
| * Maximum size [4] | 13.5 MiB | * |
| | | |
| History structure | | |
| * Maximum history depth | 136 k | |
| * Maximum tag depth [5] | 1 | |
| | | |
| Biggest checkouts | | |
| * Number of directories [6] | 4.38 k | ** |
| * Maximum path depth [7] | 13 | * |
| * Maximum path length [8] | 134 B | * |
| * Number of files [9] | 62.3 k | * |
| * Total size of files [9] | 747 MiB | |
| * Number of symlinks [10] | 40 | |
| * Number of submodules | 0 | |
```
### Use Git LFS for large binary files
Store binary files (like packages, audio, video, or graphics) as Git Large File Storage (Git LFS) objects.
When users commit files into Git, Git uses the blob
[object type](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to store and manage their content.
Git does not handle large binary data efficiently, so large blobs are problematic for Git. If `git-sizer`
reports blobs of over 10 MB, you usually have large binary files in your repository. Large binary files
cause problems for both server and client:
- For the server: unlike text-based source code, binary data is often already compressed.
Git can't compress binary data further, which leads to large packfiles. Large packfiles
require more CPU, memory, and bandwidth to create and send.
- For the client: Git stores blob content in both packfiles (usually in `.git/objects/pack/`) and
regular files (in [worktrees](https://git-scm.com/docs/git-worktree)), binary files require far more
space than text-based source code.
Git LFS stores objects externally, such as in object storage. Your Git repository contains a pointer
to the object's location, rather than the binary file itself. This can improve repository performance.
For more information, see the [Git LFS documentation](../../../../topics/git/lfs/_index.md).
|
https://docs.gitlab.com/user/project/parallel_deployments
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/parallel_deployments.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
parallel_deployments.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages parallel deployments
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129534) in GitLab 16.7 as an [experiment](../../../policy/development_stages_support.md) [with a flag](../../feature_flags.md) named `pages_multiple_versions_setting`. Disabled by default.
- [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/480195) from "multiple deployments" to "parallel deployments" in GitLab 17.4.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/422145) in GitLab 17.4.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/502219) to remove the project setting in GitLab 17.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/507423) to allow periods in `path_prefix` in GitLab 17.8.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/500000) to allow variables when passed to `publish` property in GitLab 17.9.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/487161) in GitLab 17.9. Feature flag `pages_multiple_versions_setting` removed.
- Automatically appending `pages.publish` path to `artifacts:paths` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) in GitLab 17.10 for Pages jobs only.
{{< /history >}}
With parallel deployments, you can publish multiple versions of your [GitLab Pages](_index.md)
site at the same time. Each version has its own unique URL based on a path prefix you specify.
Use parallel deployments to:
- Enhance your workflow for testing changes in development branches before merging
to production.
- Share working previews with stakeholders for feedback.
- Maintain documentation for multiple software versions simultaneously.
- Publish localized content for different audiences.
- Create staging environments for review before final publication.
Each version of your site gets its own URL based on a path prefix that you specify.
Control how long these parallel deployments exist.
They expire after 24 hours by default, but you can customize this duration to fit your review timeline.
### Create a parallel deployment
Prerequisites:
- The root-level namespace must have available [parallel deployment slots](../../gitlab_com/_index.md#other-limits).
To create a parallel deployment:
1. In your `.gitlab-ci.yml` file, add a Pages job with a `path_prefix`:
```yaml
pages:
stage: deploy
script:
- echo "Pages accessible through ${CI_PAGES_URL}"
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: "$CI_COMMIT_BRANCH"
```
The `path_prefix` value:
- Is converted to lowercase.
- Can contain numbers (`0-9`), letters (`a-z`), and periods (`.`).
- Is replaced with hyphens (`-`) for any other characters.
- Cannot start or end with hyphens (`-`) or periods (`.`), so they are removed.
- Must be 63 bytes or shorter. Anything longer is trimmed.
1. Optional. If you want dynamic prefixes, use
[CI/CD variables](../../../ci/variables/where_variables_can_be_used.md#gitlab-ciyml-file) in your `path_prefix`.
For example:
```yaml
pages:
path_prefix: "mr-$CI_MERGE_REQUEST_IID" # Results in paths like mr-123
```
1. Optional. To set an expiry time for the deployment, add `expire_in`:
```yaml
pages:
pages:
path_prefix: "$CI_COMMIT_BRANCH"
expire_in: 1 week
```
By default, parallel deployments [expire](#expiration) after 24 hours.
1. Commit your changes and push to your repository.
The deployment is accessible at:
- With a [unique domain](_index.md#unique-domains): `https://project-123456.gitlab.io/your-prefix-name`.
- Without a unique domain: `https://namespace.gitlab.io/project/your-prefix-name`.
The URL path between the site domain and public directory is determined by the `path_prefix`.
For example, if your main deployment has content at `/index.html`, a parallel deployment with prefix
`staging` can access that same content at `/staging/index.html`.
To prevent path clashes, avoid using path prefixes that match the names of existing folders in your site.
For more information, see [Path clash](#path-clash).
### Example configuration
Consider a project such as `https://gitlab.example.com/namespace/project`. By default, its main Pages deployment can be accessed through:
- When using a [unique domain](_index.md#unique-domains): `https://project-123456.gitlab.io/`.
- When not using a unique domain: `https://namespace.gitlab.io/project`.
If a `pages.path_prefix` is configured to the project branch names,
like `path_prefix = $CI_COMMIT_BRANCH`, and there's a
branch named `username/testing_feature`, this parallel Pages deployment would be accessible through:
- When using a [unique domain](_index.md#unique-domains): `https://project-123456.gitlab.io/username-testing-feature`.
- When not using a unique domain: `https://namespace.gitlab.io/project/username-testing-feature`.
### Limits
The number of parallel deployments is limited by the root-level namespace. For
specific limits for:
- GitLab.com, see [Other limits](../../gitlab_com/_index.md#other-limits).
- GitLab Self-Managed, see
[Number of parallel Pages deployments](../../../administration/instance_limits.md#number-of-parallel-pages-deployments).
To immediately reduce the number of active deployments in your namespace,
delete some deployments. For more information, see
[Delete a deployment](_index.md#delete-a-deployment).
To configure an expiry time to automatically
delete older deployments, see
[Expiring deployments](_index.md#expiring-deployments).
### Expiration
By default, parallel deployments [expire](_index.md#expiring-deployments) after 24 hours,
after which they are deleted. If you're using a self-hosted instance, your instance admin can
[configure a different default duration](../../../administration/pages/_index.md#configure-the-default-expiry-for-parallel-deployments).
To customize the expiry time, [configure `pages.expire_in`](_index.md#expiring-deployments).
To prevent deployments from automatically expiring, set `pages.expire_in` to
`never`.
### Path clash
`pages.path_prefix` can take dynamic values from [CI/CD variables](../../../ci/variables/_index.md)
that can create pages deployments which could clash with existing paths in your site.
For example, given an existing GitLab Pages site with the following paths:
```plaintext
/index.html
/documents/index.html
```
If a `pages.path_prefix` is `documents`, that version overrides the existing path.
In other words, `https://namespace.gitlab.io/project/documents/index.html` points to the
`/index.html` on the `documents` deployment of the site, instead of `documents/index.html` of the
`main` deployment of the site.
Mixing [CI/CD variables](../../../ci/variables/_index.md) with other strings can reduce the path clash
possibility. For example:
```yaml
create-pages:
stage: deploy
script:
- echo "Pages accessible through ${CI_PAGES_URL}"
variables:
PAGES_PREFIX: "" # No prefix by default (main)
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: "$PAGES_PREFIX"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run on default branch (with default PAGES_PREFIX)
- if: $CI_COMMIT_BRANCH == "staging" # Run on main (with default PAGES_PREFIX)
variables:
PAGES_PREFIX: '_stg' # Prefix with _stg for the staging branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # Conditionally change the prefix for Merge Requests
when: manual # Run pages manually on Merge Requests
variables:
PAGES_PREFIX: 'mr-$CI_MERGE_REQUEST_IID' # Prefix with the mr-<iid>, like `mr-123`
```
Some other examples of mixing [variables](../../../ci/variables/_index.md) with strings for dynamic prefixes:
- `pages.path_prefix: 'mr-$CI_COMMIT_REF_SLUG'`: Branch or tag name prefixed with `mr-`, like `mr-branch-name`.
- `pages.path_prefix: '_${CI_MERGE_REQUEST_IID}_'`: Merge request number
prefixed ans suffixed with `_`, like `_123_`.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### Use parallel deployments to create Pages environments
You can use parallel GitLab Pages deployments to create a new [environment](../../../ci/environments/_index.md).
For example:
```yaml
create-pages:
stage: deploy
script:
- echo "Pages accessible through ${CI_PAGES_URL}"
variables:
PAGES_PREFIX: "" # no prefix by default (run on the default branch)
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: "$PAGES_PREFIX"
environment:
name: "Pages ${PAGES_PREFIX}"
url: $CI_PAGES_URL
rules:
- if: $CI_COMMIT_BRANCH == "staging" # ensure to run on the default branch (with default PAGES_PREFIX)
variables:
PAGES_PREFIX: '_stg' # prefix with _stg for the staging branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # conditionally change the prefix on Merge Requests
when: manual # run pages manually on Merge Requests
variables:
PAGES_PREFIX: 'mr-$CI_MERGE_REQUEST_IID' # prefix with the mr-<iid>, like `mr-123`
```
With this configuration, users will have the access to each GitLab Pages deployment through the UI.
When using [environments](../../../ci/environments/_index.md) for pages, all pages environments are
listed on the project environment list.
You can also [group similar environments](../../../ci/environments/_index.md#group-similar-environments) together.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
#### Auto-clean
Parallel Pages deployments, created by a merge request with a `path_prefix`, are automatically deleted when the
merge request is closed or merged.
### Usage with redirects
Redirects use absolute paths.
Because parallel deployments are available on a sub-path, redirects require
additional modifications to the `_redirects` file to work in parallel deployments.
Existing files always take priority over a redirect rule, so you can use a splat placeholder
to catch requests to prefixed paths.
If your `path_prefix` is `/mr-${$CI_MERGE_REQUEST_IID}`, adapt this `_redirect` file example
to redirect requests for both primary and parallel deployments:
```shell
# Redirect the primary deployment
/will-redirect.html /redirected.html 302
# Redirect parallel deployments
/*/will-redirect.html /:splat/redirected.html 302
```
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages parallel deployments
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129534) in GitLab 16.7 as an [experiment](../../../policy/development_stages_support.md) [with a flag](../../feature_flags.md) named `pages_multiple_versions_setting`. Disabled by default.
- [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/480195) from "multiple deployments" to "parallel deployments" in GitLab 17.4.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/422145) in GitLab 17.4.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/502219) to remove the project setting in GitLab 17.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/507423) to allow periods in `path_prefix` in GitLab 17.8.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/500000) to allow variables when passed to `publish` property in GitLab 17.9.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/487161) in GitLab 17.9. Feature flag `pages_multiple_versions_setting` removed.
- Automatically appending `pages.publish` path to `artifacts:paths` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) in GitLab 17.10 for Pages jobs only.
{{< /history >}}
With parallel deployments, you can publish multiple versions of your [GitLab Pages](_index.md)
site at the same time. Each version has its own unique URL based on a path prefix you specify.
Use parallel deployments to:
- Enhance your workflow for testing changes in development branches before merging
to production.
- Share working previews with stakeholders for feedback.
- Maintain documentation for multiple software versions simultaneously.
- Publish localized content for different audiences.
- Create staging environments for review before final publication.
Each version of your site gets its own URL based on a path prefix that you specify.
Control how long these parallel deployments exist.
They expire after 24 hours by default, but you can customize this duration to fit your review timeline.
### Create a parallel deployment
Prerequisites:
- The root-level namespace must have available [parallel deployment slots](../../gitlab_com/_index.md#other-limits).
To create a parallel deployment:
1. In your `.gitlab-ci.yml` file, add a Pages job with a `path_prefix`:
```yaml
pages:
stage: deploy
script:
- echo "Pages accessible through ${CI_PAGES_URL}"
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: "$CI_COMMIT_BRANCH"
```
The `path_prefix` value:
- Is converted to lowercase.
- Can contain numbers (`0-9`), letters (`a-z`), and periods (`.`).
- Is replaced with hyphens (`-`) for any other characters.
- Cannot start or end with hyphens (`-`) or periods (`.`), so they are removed.
- Must be 63 bytes or shorter. Anything longer is trimmed.
1. Optional. If you want dynamic prefixes, use
[CI/CD variables](../../../ci/variables/where_variables_can_be_used.md#gitlab-ciyml-file) in your `path_prefix`.
For example:
```yaml
pages:
path_prefix: "mr-$CI_MERGE_REQUEST_IID" # Results in paths like mr-123
```
1. Optional. To set an expiry time for the deployment, add `expire_in`:
```yaml
pages:
pages:
path_prefix: "$CI_COMMIT_BRANCH"
expire_in: 1 week
```
By default, parallel deployments [expire](#expiration) after 24 hours.
1. Commit your changes and push to your repository.
The deployment is accessible at:
- With a [unique domain](_index.md#unique-domains): `https://project-123456.gitlab.io/your-prefix-name`.
- Without a unique domain: `https://namespace.gitlab.io/project/your-prefix-name`.
The URL path between the site domain and public directory is determined by the `path_prefix`.
For example, if your main deployment has content at `/index.html`, a parallel deployment with prefix
`staging` can access that same content at `/staging/index.html`.
To prevent path clashes, avoid using path prefixes that match the names of existing folders in your site.
For more information, see [Path clash](#path-clash).
### Example configuration
Consider a project such as `https://gitlab.example.com/namespace/project`. By default, its main Pages deployment can be accessed through:
- When using a [unique domain](_index.md#unique-domains): `https://project-123456.gitlab.io/`.
- When not using a unique domain: `https://namespace.gitlab.io/project`.
If a `pages.path_prefix` is configured to the project branch names,
like `path_prefix = $CI_COMMIT_BRANCH`, and there's a
branch named `username/testing_feature`, this parallel Pages deployment would be accessible through:
- When using a [unique domain](_index.md#unique-domains): `https://project-123456.gitlab.io/username-testing-feature`.
- When not using a unique domain: `https://namespace.gitlab.io/project/username-testing-feature`.
### Limits
The number of parallel deployments is limited by the root-level namespace. For
specific limits for:
- GitLab.com, see [Other limits](../../gitlab_com/_index.md#other-limits).
- GitLab Self-Managed, see
[Number of parallel Pages deployments](../../../administration/instance_limits.md#number-of-parallel-pages-deployments).
To immediately reduce the number of active deployments in your namespace,
delete some deployments. For more information, see
[Delete a deployment](_index.md#delete-a-deployment).
To configure an expiry time to automatically
delete older deployments, see
[Expiring deployments](_index.md#expiring-deployments).
### Expiration
By default, parallel deployments [expire](_index.md#expiring-deployments) after 24 hours,
after which they are deleted. If you're using a self-hosted instance, your instance admin can
[configure a different default duration](../../../administration/pages/_index.md#configure-the-default-expiry-for-parallel-deployments).
To customize the expiry time, [configure `pages.expire_in`](_index.md#expiring-deployments).
To prevent deployments from automatically expiring, set `pages.expire_in` to
`never`.
### Path clash
`pages.path_prefix` can take dynamic values from [CI/CD variables](../../../ci/variables/_index.md)
that can create pages deployments which could clash with existing paths in your site.
For example, given an existing GitLab Pages site with the following paths:
```plaintext
/index.html
/documents/index.html
```
If a `pages.path_prefix` is `documents`, that version overrides the existing path.
In other words, `https://namespace.gitlab.io/project/documents/index.html` points to the
`/index.html` on the `documents` deployment of the site, instead of `documents/index.html` of the
`main` deployment of the site.
Mixing [CI/CD variables](../../../ci/variables/_index.md) with other strings can reduce the path clash
possibility. For example:
```yaml
create-pages:
stage: deploy
script:
- echo "Pages accessible through ${CI_PAGES_URL}"
variables:
PAGES_PREFIX: "" # No prefix by default (main)
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: "$PAGES_PREFIX"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run on default branch (with default PAGES_PREFIX)
- if: $CI_COMMIT_BRANCH == "staging" # Run on main (with default PAGES_PREFIX)
variables:
PAGES_PREFIX: '_stg' # Prefix with _stg for the staging branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # Conditionally change the prefix for Merge Requests
when: manual # Run pages manually on Merge Requests
variables:
PAGES_PREFIX: 'mr-$CI_MERGE_REQUEST_IID' # Prefix with the mr-<iid>, like `mr-123`
```
Some other examples of mixing [variables](../../../ci/variables/_index.md) with strings for dynamic prefixes:
- `pages.path_prefix: 'mr-$CI_COMMIT_REF_SLUG'`: Branch or tag name prefixed with `mr-`, like `mr-branch-name`.
- `pages.path_prefix: '_${CI_MERGE_REQUEST_IID}_'`: Merge request number
prefixed ans suffixed with `_`, like `_123_`.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### Use parallel deployments to create Pages environments
You can use parallel GitLab Pages deployments to create a new [environment](../../../ci/environments/_index.md).
For example:
```yaml
create-pages:
stage: deploy
script:
- echo "Pages accessible through ${CI_PAGES_URL}"
variables:
PAGES_PREFIX: "" # no prefix by default (run on the default branch)
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: "$PAGES_PREFIX"
environment:
name: "Pages ${PAGES_PREFIX}"
url: $CI_PAGES_URL
rules:
- if: $CI_COMMIT_BRANCH == "staging" # ensure to run on the default branch (with default PAGES_PREFIX)
variables:
PAGES_PREFIX: '_stg' # prefix with _stg for the staging branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # conditionally change the prefix on Merge Requests
when: manual # run pages manually on Merge Requests
variables:
PAGES_PREFIX: 'mr-$CI_MERGE_REQUEST_IID' # prefix with the mr-<iid>, like `mr-123`
```
With this configuration, users will have the access to each GitLab Pages deployment through the UI.
When using [environments](../../../ci/environments/_index.md) for pages, all pages environments are
listed on the project environment list.
You can also [group similar environments](../../../ci/environments/_index.md#group-similar-environments) together.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
#### Auto-clean
Parallel Pages deployments, created by a merge request with a `path_prefix`, are automatically deleted when the
merge request is closed or merged.
### Usage with redirects
Redirects use absolute paths.
Because parallel deployments are available on a sub-path, redirects require
additional modifications to the `_redirects` file to work in parallel deployments.
Existing files always take priority over a redirect rule, so you can use a splat placeholder
to catch requests to prefixed paths.
If your `path_prefix` is `/mr-${$CI_MERGE_REQUEST_IID}`, adapt this `_redirect` file example
to redirect requests for both primary and parallel deployments:
```shell
# Redirect the primary deployment
/will-redirect.html /redirected.html 302
# Redirect parallel deployments
/*/will-redirect.html /:splat/redirected.html 302
```
|
https://docs.gitlab.com/user/project/public_folder
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/public_folder.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
public_folder.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages public folder
|
Learn how to configure the build output folder for the most common static site generators
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- With GitLab 16.1 we introduced the ability to configure the published folder in `.gitlab-ci.yml`, so you longer need to change your framework config. For more information, see how to [set a custom folder to be deployed with Pages](introduction.md#customize-the-default-folder).
{{< /history >}}
Follow these instructions to configure the `public` folder
for the following frameworks.
## Eleventy
For Eleventy, you should do one of the following:
- Add the `--output=public` flag in the Eleventy build commands, for example:
`npx @11ty/eleventy --input=path/to/sourcefiles --output=public`
- Add the following to your `.eleventy.js` file:
```javascript
// .eleventy.js
module.exports = function(eleventyConfig) {
return {
dir: {
output: "public"
}
}
};
```
## Astro
By default, Astro uses the `public` folder to store static assets. For GitLab Pages,
rename that folder to a collision-free alternative first:
1. In your project directory, run:
```shell
mv public static
```
1. Add the following to your `astro.config.mjs`. This code informs Astro about
our folder name remapping:
```javascript
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
// GitLab Pages requires exposed files to be located in a folder called "public".
// So we're instructing Astro to put the static build output in a folder of that name.
outDir: 'public',
// The folder name Astro uses for static files (`public`) is already reserved
// for the build output. So in deviation from the defaults we're using a folder
// called `static` instead.
publicDir: 'static',
});
```
## SvelteKit
{{< alert type="note" >}}
GitLab Pages supports only static sites. For SvelteKit,
you can use [`adapter-static`](https://kit.svelte.dev/docs/adapters#supported-environments-static-sites).
{{< /alert >}}
When using `adapter-static`, add the following to your `svelte.config.js`:
```javascript
// svelte.config.js
import adapter from '@sveltejs/adapter-static';
export default {
kit: {
adapter: adapter({
pages: 'public'
})
}
};
```
## Next.js
{{< alert type="note" >}}
GitLab Pages supports only static sites. For Next.js, you can use
Next's [Static HTML export functionality](https://nextjs.org/docs/pages/building-your-application/deploying/static-exports).
{{< /alert >}}
With the release of [Next.js 13](https://nextjs.org/blog/next-13) a lot has changed on how Next.js works.
It is recommended to use the following `next.config.js` so all static assets can be exported properly:
```javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
unoptimized: true,
},
assetPrefix: "https://example.gitlab.io/namespace-here/my-gitlab-project/"
}
module.exports = nextConfig
```
An example `.gitlab-ci.yml` can be as minimal as:
```yaml
create-pages:
before_script:
- npm install
script:
- npm run build
- mv out/* public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
## Nuxt.js
{{< alert type="note" >}}
GitLab Pages supports only static sites.
{{< /alert >}}
By default, Nuxt uses the `public` folder to store static assets. For GitLab
Pages, rename the `public` folder to a collision-free alternative first:
1. In your project directory, run:
```shell
mv public static
```
1. Add the following to your `nuxt.config.js`:
```javascript
export default {
target: 'static',
generate: {
dir: 'public'
},
dir: {
// The folder name Nuxt uses for static files (`public`) is already
// reserved for the build output. So in deviation from the defaults we're
// using a folder called `static` instead.
public: 'static'
}
}
```
1. Configure your Nuxt.js application for
[Static Site Generation](https://nuxt.com/docs/getting-started/deployment#static-hosting).
## Vite
Update your `vite.config.js` to include the following:
```javascript
// vite.config.js
export default {
build: {
outDir: 'public'
}
}
```
## Webpack
Update your `webpack.config.js` to include the following:
```javascript
// webpack.config.js
module.exports = {
output: {
path: __dirname + '/public'
}
};
```
## Should you commit the `public` folder?
Not necessarily. However, when the GitLab Pages deploy pipeline runs, it looks
for an [artifact](../../../ci/jobs/job_artifacts.md) of that name.
If you set up a job that creates the `public` folder before deploy, such as by
running `npm run build`, committing the folder isn't required.
If you prefer to build your site locally, you can commit the `public` folder and
omit the build step during the job instead.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Learn how to configure the build output folder for the most common static
site generators
title: GitLab Pages public folder
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- With GitLab 16.1 we introduced the ability to configure the published folder in `.gitlab-ci.yml`, so you longer need to change your framework config. For more information, see how to [set a custom folder to be deployed with Pages](introduction.md#customize-the-default-folder).
{{< /history >}}
Follow these instructions to configure the `public` folder
for the following frameworks.
## Eleventy
For Eleventy, you should do one of the following:
- Add the `--output=public` flag in the Eleventy build commands, for example:
`npx @11ty/eleventy --input=path/to/sourcefiles --output=public`
- Add the following to your `.eleventy.js` file:
```javascript
// .eleventy.js
module.exports = function(eleventyConfig) {
return {
dir: {
output: "public"
}
}
};
```
## Astro
By default, Astro uses the `public` folder to store static assets. For GitLab Pages,
rename that folder to a collision-free alternative first:
1. In your project directory, run:
```shell
mv public static
```
1. Add the following to your `astro.config.mjs`. This code informs Astro about
our folder name remapping:
```javascript
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
// GitLab Pages requires exposed files to be located in a folder called "public".
// So we're instructing Astro to put the static build output in a folder of that name.
outDir: 'public',
// The folder name Astro uses for static files (`public`) is already reserved
// for the build output. So in deviation from the defaults we're using a folder
// called `static` instead.
publicDir: 'static',
});
```
## SvelteKit
{{< alert type="note" >}}
GitLab Pages supports only static sites. For SvelteKit,
you can use [`adapter-static`](https://kit.svelte.dev/docs/adapters#supported-environments-static-sites).
{{< /alert >}}
When using `adapter-static`, add the following to your `svelte.config.js`:
```javascript
// svelte.config.js
import adapter from '@sveltejs/adapter-static';
export default {
kit: {
adapter: adapter({
pages: 'public'
})
}
};
```
## Next.js
{{< alert type="note" >}}
GitLab Pages supports only static sites. For Next.js, you can use
Next's [Static HTML export functionality](https://nextjs.org/docs/pages/building-your-application/deploying/static-exports).
{{< /alert >}}
With the release of [Next.js 13](https://nextjs.org/blog/next-13) a lot has changed on how Next.js works.
It is recommended to use the following `next.config.js` so all static assets can be exported properly:
```javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
unoptimized: true,
},
assetPrefix: "https://example.gitlab.io/namespace-here/my-gitlab-project/"
}
module.exports = nextConfig
```
An example `.gitlab-ci.yml` can be as minimal as:
```yaml
create-pages:
before_script:
- npm install
script:
- npm run build
- mv out/* public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
## Nuxt.js
{{< alert type="note" >}}
GitLab Pages supports only static sites.
{{< /alert >}}
By default, Nuxt uses the `public` folder to store static assets. For GitLab
Pages, rename the `public` folder to a collision-free alternative first:
1. In your project directory, run:
```shell
mv public static
```
1. Add the following to your `nuxt.config.js`:
```javascript
export default {
target: 'static',
generate: {
dir: 'public'
},
dir: {
// The folder name Nuxt uses for static files (`public`) is already
// reserved for the build output. So in deviation from the defaults we're
// using a folder called `static` instead.
public: 'static'
}
}
```
1. Configure your Nuxt.js application for
[Static Site Generation](https://nuxt.com/docs/getting-started/deployment#static-hosting).
## Vite
Update your `vite.config.js` to include the following:
```javascript
// vite.config.js
export default {
build: {
outDir: 'public'
}
}
```
## Webpack
Update your `webpack.config.js` to include the following:
```javascript
// webpack.config.js
module.exports = {
output: {
path: __dirname + '/public'
}
};
```
## Should you commit the `public` folder?
Not necessarily. However, when the GitLab Pages deploy pipeline runs, it looks
for an [artifact](../../../ci/jobs/job_artifacts.md) of that name.
If you set up a job that creates the `public` folder before deploy, such as by
running `npm run build`, committing the folder isn't required.
If you prefer to build your site locally, you can commit the `public` folder and
omit the build step during the job instead.
|
https://docs.gitlab.com/user/project/introduction
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/introduction.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
introduction.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages settings
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Pages offers configuration options to customize your static site's deployment and presentation.
With Pages settings, you can:
- Serve custom error pages for 403 and 404 responses.
- Configure URL redirects through `_redirects` files.
- Deploy pages from any branch using CI/CD rules.
- Serve pre-compressed assets for faster page loads.
- Customize the folder from which your site is published.
- Generate and manage unique domains for your sites.
This guide explains the settings and configuration options available for your GitLab Pages sites.
For an introduction to Pages, see [GitLab Pages](_index.md).
## GitLab Pages requirements
In brief, this is what you need to upload your website in GitLab Pages:
1. Domain of the instance: domain name that is used for GitLab Pages
(ask your administrator).
1. GitLab CI/CD: a `.gitlab-ci.yml` file with a specific job named [`pages`](../../../ci/yaml/_index.md#pages) in the root directory of your repository.
1. GitLab Runner enabled for the project.
## GitLab Pages on GitLab.com
If you are using [GitLab Pages on GitLab.com](#gitlab-pages-on-gitlabcom) to host your website, then:
- The domain name for GitLab Pages on GitLab.com is `gitlab.io`.
- Custom domains and TLS support are enabled.
- Instance runners are enabled by default, provided for free and can be used to
build your website. If you want you can still bring your own runner.
## Example projects
Visit the [GitLab Pages group](https://gitlab.com/groups/pages) for a complete list of example projects. Contributions are very welcome.
## Custom error codes pages
You can provide your own `403` and `404` error pages by creating `403.html` and
`404.html` files in the root of the `public/` directory. Usually this is
the root directory of your project, but that may differ
depending on your static generator configuration.
If the case of `404.html`, there are different scenarios. For example:
- If you use project Pages (served under `/project-slug/`) and try to access
`/project-slug/non/existing_file`, GitLab Pages tries to serve first
`/project-slug/404.html`, and then `/404.html`.
- If you use user or group Pages (served under `/`) and try to access
`/non/existing_file` GitLab Pages tries to serve `/404.html`.
- If you use a custom domain and try to access `/non/existing_file`, GitLab
Pages tries to serve only `/404.html`.
## Redirects in GitLab Pages
You can configure redirects for your site using a `_redirects` file. For more information, see
[Create redirects for GitLab Pages](redirects.md).
## Delete a Pages site
Permanently delete all Pages deployments for a project.
This is permanent and cannot be undone.
To delete your pages:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Select **Delete pages**.
Your Pages site is no longer deployed.
To deploy this Pages site again, run a new pipeline.
## Subdomains of subdomains
When using Pages under the top-level domain of a GitLab instance (`*.example.io`), you can't use HTTPS with subdomains
of subdomains. If your namespace or group name contains a dot (for example, `foo.bar`) the domain
`https://foo.bar.example.io` does **not** work.
This limitation is because of the [HTTP Over TLS protocol](https://www.rfc-editor.org/rfc/rfc2818#section-3.1). HTTP pages
work as long as you don't redirect HTTP to HTTPS.
## GitLab Pages in projects and groups
You must host your GitLab Pages website in a project. This project can be
[private, internal, or public](../../public_access.md) and belong
to a [group](../../group/_index.md) or [subgroup](../../group/subgroups/_index.md).
For [group websites](getting_started_part_one.md#user-and-group-website-examples),
the group must be at the top level and not a subgroup.
For [project websites](getting_started_part_one.md#project-website-examples),
you can create your project first and access it under `http(s)://namespace.example.io/project-path`.
## Specific configuration options for Pages
Learn how to set up GitLab CI/CD for specific use cases.
### `.gitlab-ci.yml` for plain HTML websites
Suppose your repository contained the following files:
```plaintext
├── index.html
├── css
│ └── main.css
└── js
└── main.js
```
Then the `.gitlab-ci.yml` example below moves all files from the root
directory of the project to the `public/` directory. The `.public` workaround
is so `cp` doesn't also copy `public/` to itself in an infinite loop:
```yaml
create-pages:
script:
- mkdir .public
- cp -r * .public
- mv .public public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
```
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### `.gitlab-ci.yml` for a static site generator
See this document for a [step-by-step guide](getting_started/pages_from_scratch.md).
### `.gitlab-ci.yml` for a repository with code
Remember that GitLab Pages are by default branch/tag agnostic and their
deployment relies solely on what you specify in `.gitlab-ci.yml`. You can limit
the `pages` job with [`rules:if`](../../../ci/yaml/_index.md#rulesif),
whenever a new commit is pushed to a branch used specifically for your
pages.
That way, you can have your project's code in the `main` branch and use an
orphan branch (let's name it `pages`) to host your static generator site.
You can create a new empty branch like this:
```shell
git checkout --orphan pages
```
The first commit made on this new branch has no parents and is the root of a
new history totally disconnected from all the other branches and commits.
Push the source files of your static generator in the `pages` branch.
Below is a copy of `.gitlab-ci.yml` where the most significant line is the last
one, specifying to execute everything in the `pages` branch:
```yaml
create-pages:
image: ruby:2.6
script:
- gem install jekyll
- jekyll build -d public/
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: '$CI_COMMIT_REF_NAME == "pages"'
```
See an example that has different files in the [`main` branch](https://gitlab.com/pages/jekyll-branched/tree/main)
and the source files for Jekyll are in a [`pages` branch](https://gitlab.com/pages/jekyll-branched/tree/pages) which
also includes `.gitlab-ci.yml`.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### Serving compressed assets
Most modern browsers support downloading files in a compressed format. This
speeds up downloads by reducing the size of files.
Before serving an uncompressed file, Pages checks if the same file exists with
a `.br` or `.gz` extension. If it does, and the browser supports receiving
compressed files, it serves that version instead of the uncompressed one.
To take advantage of this feature, the artifact you upload to the Pages should
have this structure:
```plaintext
public/
├─┬ index.html
│ | index.html.br
│ └ index.html.gz
│
├── css/
│ └─┬ main.css
│ | main.css.br
│ └ main.css.gz
│
└── js/
└─┬ main.js
| main.js.br
└ main.js.gz
```
This can be achieved by including a `script:` command like this in your
`.gitlab-ci.yml` pages job:
```yaml
create-pages:
# Other directives
script:
# Build the public/ directory first
- find public -type f -regex '.*\.\(htm\|html\|xml\|txt\|text\|js\|css\|svg\)$' -exec gzip -f -k {} \;
- find public -type f -regex '.*\.\(htm\|html\|xml\|txt\|text\|js\|css\|svg\)$' -exec brotli -f -k {} \;
pages: true # specifies that this is a Pages job
```
By pre-compressing the files and including both versions in the artifact, Pages
can serve requests for both compressed and uncompressed content without
needing to compress files on-demand.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### Resolving ambiguous URLs
GitLab Pages makes assumptions about which files to serve when receiving a
request for a URL that does not include an extension.
Consider a Pages site deployed with the following files:
```plaintext
public/
├── index.html
├── data.html
├── info.html
├── data/
│ └── index.html
└── info/
└── details.html
```
Pages supports reaching each of these files through several different URLs. In
particular, it always looks for an `index.html` file if the URL only
specifies the directory. If the URL references a file that doesn't exist, but
adding `.html` to the URL leads to a file that does exist, it's served
instead. Here are some examples of what happens given the previous Pages site:
| URL path | HTTP response |
| -------------------- | ------------- |
| `/` | `200 OK`: `public/index.html` |
| `/index.html` | `200 OK`: `public/index.html` |
| `/index` | `200 OK`: `public/index.html` |
| `/data` | `302 Found`: redirecting to `/data/` |
| `/data/` | `200 OK`: `public/data/index.html` |
| `/data.html` | `200 OK`: `public/data.html` |
| `/info` | `302 Found`: redirecting to `/info/` |
| `/info/` | `404 Not Found` Error Page |
| `/info.html` | `200 OK`: `public/info.html` |
| `/info/details` | `200 OK`: `public/info/details.html` |
| `/info/details.html` | `200 OK`: `public/info/details.html` |
When `public/data/index.html` exists, it takes priority over the `public/data.html` file
for both the `/data` and `/data/` URL paths.
## Customize the default folder
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/859) in GitLab 16.1 with a Pages flag named `FF_CONFIGURABLE_ROOT_DIR`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/1073) in GitLab 16.1.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/890) in GitLab 16.2.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/500000) to allow variables when passed to `publish` property in GitLab 17.9.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) the `publish` property under the `pages` keyword in GitLab 17.9.
- [Appended](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) the `pages.publish` path automatically to `artifacts:paths` in GitLab 17.10.
{{< /history >}}
By default, Pages looks for a folder named `public` in your build files to publish it.
To change that folder name to any other value, add a `pages.publish` property to your
`deploy-pages` job configuration in `.gitlab-ci.yml`.
The following example publishes a folder named `dist` instead:
```yaml
create-pages:
script:
- npm run build
pages: # specifies that this is a Pages job
publish: dist
```
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
To use variables in the `pages.publish` field, see [`pages.publish`](../../../ci/yaml/_index.md#pagespublish).
Pages uses artifacts to store the files of your site, so the value from
`pages.publish` is automatically appended to [`artifacts:paths`](../../../ci/yaml/_index.md#artifactspaths).
The previous example is equivalent to:
```yaml
create-pages:
script:
- npm run build
pages:
publish: dist
artifacts:
paths:
- dist
```
{{< alert type="warning" >}}
The top-level `publish` keyword was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/519499) in GitLab 17.9 and must now be nested under the `pages` keyword.
{{< /alert >}}
## Regenerate unique domain for GitLab Pages
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/481746) in GitLab 17.7.
{{< /history >}}
You can regenerate the unique domain for your GitLab Pages site.
After the domain is regenerated, the previous URL is no longer active.
If anyone tries to access the old URL, they'll receive a `404` error.
Prerequisites
- You must have at least the Maintainer role for the project.
- The **Use unique domain** setting [must be enabled](_index.md#unique-domains) in your project's Pages settings.
To regenerate a unique domain for your GitLab Pages site:
1. On the left sidebar, select **Deploy > Pages**.
1. Next to **Access pages**, press **Regenerate unique domain**.
1. GitLab generates a new unique domain for your Pages site.
## Known issues
For a list of known issues, see the GitLab [public issue tracker](https://gitlab.com/gitlab-org/gitlab/-/issues?label_name[]=Category%3APages).
## Troubleshooting
### 404 error when accessing a GitLab Pages site URL
This problem most likely results from a missing `index.html` file in the public directory. If after deploying a Pages site
a 404 is encountered, confirm that the public directory contains an `index.html` file. If the file contains a different name
such as `test.html`, the Pages site can still be accessed, but the full path would be needed. For example: `https//group-name.pages.example.com/project-slug/test.html`.
The contents of the public directory can be confirmed by [browsing the artifacts](../../../ci/jobs/job_artifacts.md#download-job-artifacts) from the latest pipeline.
Files listed under the public directory can be accessed through the Pages URL for the project.
A 404 can also be related to incorrect permissions. If [Pages Access Control](pages_access_control.md) is enabled, and a user
goes to the Pages URL and receives a 404 response, it is possible that the user does not have permission to view the site.
To fix this, verify that the user is a member of the project.
### Broken relative links
GitLab Pages supports extensionless URLs. However, due to the problem
described in [issue #354](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/354),
if an extensionless URL ends in a forward slash (`/`), it breaks any relative links on the page.
To work around this issue:
- Ensure any URLs pointing to your Pages site have extensions, or do not include a trailing slash.
- If possible, use only absolute URLs on your site.
### Cannot play media content on Safari
Safari requires the web server to support the [Range request header](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW6) to play your media content. For GitLab Pages to serve
HTTP Range requests, you should use the following two variables in your `.gitlab-ci.yml` file:
```yaml
create-pages:
stage: deploy
variables:
FF_USE_FASTZIP: "true"
ARTIFACT_COMPRESSION_LEVEL: "fastest"
script:
- echo "Deploying pages"
pages: true # specifies that this is a Pages job and publishes the default public directory
environment: production
```
The `FF_USE_FASTZIP` variable enables the [feature flag](https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags) which is needed for [`ARTIFACT_COMPRESSION_LEVEL`](../../../ci/runners/configure_runners.md#artifact-and-cache-settings).
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### `401` error when accessing private GitLab Pages sites in multiple browser tabs
When you try to access a private Pages URL in two different tabs simultaneously without prior authentication,
two different `state` values are returned for each tab.
However, in the Pages session, only the most recent `state` value is stored for the given client.
As a result, after submitting credentials, one of the tabs returns a `401 Unauthorized` error.
To resolve the `401` error, refresh the page.
### Failing `pages:deploy` job
To deploy with GitLab Pages, the root content directory must contain a non-empty `index.html` file,
or the `pages:deploy` job fails.
The content directory is `public/` by default, or a directory specified with the
`pages.publish` keyword in your `.gitlab-ci.yml` file.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages settings
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Pages offers configuration options to customize your static site's deployment and presentation.
With Pages settings, you can:
- Serve custom error pages for 403 and 404 responses.
- Configure URL redirects through `_redirects` files.
- Deploy pages from any branch using CI/CD rules.
- Serve pre-compressed assets for faster page loads.
- Customize the folder from which your site is published.
- Generate and manage unique domains for your sites.
This guide explains the settings and configuration options available for your GitLab Pages sites.
For an introduction to Pages, see [GitLab Pages](_index.md).
## GitLab Pages requirements
In brief, this is what you need to upload your website in GitLab Pages:
1. Domain of the instance: domain name that is used for GitLab Pages
(ask your administrator).
1. GitLab CI/CD: a `.gitlab-ci.yml` file with a specific job named [`pages`](../../../ci/yaml/_index.md#pages) in the root directory of your repository.
1. GitLab Runner enabled for the project.
## GitLab Pages on GitLab.com
If you are using [GitLab Pages on GitLab.com](#gitlab-pages-on-gitlabcom) to host your website, then:
- The domain name for GitLab Pages on GitLab.com is `gitlab.io`.
- Custom domains and TLS support are enabled.
- Instance runners are enabled by default, provided for free and can be used to
build your website. If you want you can still bring your own runner.
## Example projects
Visit the [GitLab Pages group](https://gitlab.com/groups/pages) for a complete list of example projects. Contributions are very welcome.
## Custom error codes pages
You can provide your own `403` and `404` error pages by creating `403.html` and
`404.html` files in the root of the `public/` directory. Usually this is
the root directory of your project, but that may differ
depending on your static generator configuration.
If the case of `404.html`, there are different scenarios. For example:
- If you use project Pages (served under `/project-slug/`) and try to access
`/project-slug/non/existing_file`, GitLab Pages tries to serve first
`/project-slug/404.html`, and then `/404.html`.
- If you use user or group Pages (served under `/`) and try to access
`/non/existing_file` GitLab Pages tries to serve `/404.html`.
- If you use a custom domain and try to access `/non/existing_file`, GitLab
Pages tries to serve only `/404.html`.
## Redirects in GitLab Pages
You can configure redirects for your site using a `_redirects` file. For more information, see
[Create redirects for GitLab Pages](redirects.md).
## Delete a Pages site
Permanently delete all Pages deployments for a project.
This is permanent and cannot be undone.
To delete your pages:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Select **Delete pages**.
Your Pages site is no longer deployed.
To deploy this Pages site again, run a new pipeline.
## Subdomains of subdomains
When using Pages under the top-level domain of a GitLab instance (`*.example.io`), you can't use HTTPS with subdomains
of subdomains. If your namespace or group name contains a dot (for example, `foo.bar`) the domain
`https://foo.bar.example.io` does **not** work.
This limitation is because of the [HTTP Over TLS protocol](https://www.rfc-editor.org/rfc/rfc2818#section-3.1). HTTP pages
work as long as you don't redirect HTTP to HTTPS.
## GitLab Pages in projects and groups
You must host your GitLab Pages website in a project. This project can be
[private, internal, or public](../../public_access.md) and belong
to a [group](../../group/_index.md) or [subgroup](../../group/subgroups/_index.md).
For [group websites](getting_started_part_one.md#user-and-group-website-examples),
the group must be at the top level and not a subgroup.
For [project websites](getting_started_part_one.md#project-website-examples),
you can create your project first and access it under `http(s)://namespace.example.io/project-path`.
## Specific configuration options for Pages
Learn how to set up GitLab CI/CD for specific use cases.
### `.gitlab-ci.yml` for plain HTML websites
Suppose your repository contained the following files:
```plaintext
├── index.html
├── css
│ └── main.css
└── js
└── main.js
```
Then the `.gitlab-ci.yml` example below moves all files from the root
directory of the project to the `public/` directory. The `.public` workaround
is so `cp` doesn't also copy `public/` to itself in an infinite loop:
```yaml
create-pages:
script:
- mkdir .public
- cp -r * .public
- mv .public public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
```
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### `.gitlab-ci.yml` for a static site generator
See this document for a [step-by-step guide](getting_started/pages_from_scratch.md).
### `.gitlab-ci.yml` for a repository with code
Remember that GitLab Pages are by default branch/tag agnostic and their
deployment relies solely on what you specify in `.gitlab-ci.yml`. You can limit
the `pages` job with [`rules:if`](../../../ci/yaml/_index.md#rulesif),
whenever a new commit is pushed to a branch used specifically for your
pages.
That way, you can have your project's code in the `main` branch and use an
orphan branch (let's name it `pages`) to host your static generator site.
You can create a new empty branch like this:
```shell
git checkout --orphan pages
```
The first commit made on this new branch has no parents and is the root of a
new history totally disconnected from all the other branches and commits.
Push the source files of your static generator in the `pages` branch.
Below is a copy of `.gitlab-ci.yml` where the most significant line is the last
one, specifying to execute everything in the `pages` branch:
```yaml
create-pages:
image: ruby:2.6
script:
- gem install jekyll
- jekyll build -d public/
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: '$CI_COMMIT_REF_NAME == "pages"'
```
See an example that has different files in the [`main` branch](https://gitlab.com/pages/jekyll-branched/tree/main)
and the source files for Jekyll are in a [`pages` branch](https://gitlab.com/pages/jekyll-branched/tree/pages) which
also includes `.gitlab-ci.yml`.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### Serving compressed assets
Most modern browsers support downloading files in a compressed format. This
speeds up downloads by reducing the size of files.
Before serving an uncompressed file, Pages checks if the same file exists with
a `.br` or `.gz` extension. If it does, and the browser supports receiving
compressed files, it serves that version instead of the uncompressed one.
To take advantage of this feature, the artifact you upload to the Pages should
have this structure:
```plaintext
public/
├─┬ index.html
│ | index.html.br
│ └ index.html.gz
│
├── css/
│ └─┬ main.css
│ | main.css.br
│ └ main.css.gz
│
└── js/
└─┬ main.js
| main.js.br
└ main.js.gz
```
This can be achieved by including a `script:` command like this in your
`.gitlab-ci.yml` pages job:
```yaml
create-pages:
# Other directives
script:
# Build the public/ directory first
- find public -type f -regex '.*\.\(htm\|html\|xml\|txt\|text\|js\|css\|svg\)$' -exec gzip -f -k {} \;
- find public -type f -regex '.*\.\(htm\|html\|xml\|txt\|text\|js\|css\|svg\)$' -exec brotli -f -k {} \;
pages: true # specifies that this is a Pages job
```
By pre-compressing the files and including both versions in the artifact, Pages
can serve requests for both compressed and uncompressed content without
needing to compress files on-demand.
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### Resolving ambiguous URLs
GitLab Pages makes assumptions about which files to serve when receiving a
request for a URL that does not include an extension.
Consider a Pages site deployed with the following files:
```plaintext
public/
├── index.html
├── data.html
├── info.html
├── data/
│ └── index.html
└── info/
└── details.html
```
Pages supports reaching each of these files through several different URLs. In
particular, it always looks for an `index.html` file if the URL only
specifies the directory. If the URL references a file that doesn't exist, but
adding `.html` to the URL leads to a file that does exist, it's served
instead. Here are some examples of what happens given the previous Pages site:
| URL path | HTTP response |
| -------------------- | ------------- |
| `/` | `200 OK`: `public/index.html` |
| `/index.html` | `200 OK`: `public/index.html` |
| `/index` | `200 OK`: `public/index.html` |
| `/data` | `302 Found`: redirecting to `/data/` |
| `/data/` | `200 OK`: `public/data/index.html` |
| `/data.html` | `200 OK`: `public/data.html` |
| `/info` | `302 Found`: redirecting to `/info/` |
| `/info/` | `404 Not Found` Error Page |
| `/info.html` | `200 OK`: `public/info.html` |
| `/info/details` | `200 OK`: `public/info/details.html` |
| `/info/details.html` | `200 OK`: `public/info/details.html` |
When `public/data/index.html` exists, it takes priority over the `public/data.html` file
for both the `/data` and `/data/` URL paths.
## Customize the default folder
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/859) in GitLab 16.1 with a Pages flag named `FF_CONFIGURABLE_ROOT_DIR`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/1073) in GitLab 16.1.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/890) in GitLab 16.2.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/500000) to allow variables when passed to `publish` property in GitLab 17.9.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) the `publish` property under the `pages` keyword in GitLab 17.9.
- [Appended](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) the `pages.publish` path automatically to `artifacts:paths` in GitLab 17.10.
{{< /history >}}
By default, Pages looks for a folder named `public` in your build files to publish it.
To change that folder name to any other value, add a `pages.publish` property to your
`deploy-pages` job configuration in `.gitlab-ci.yml`.
The following example publishes a folder named `dist` instead:
```yaml
create-pages:
script:
- npm run build
pages: # specifies that this is a Pages job
publish: dist
```
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
To use variables in the `pages.publish` field, see [`pages.publish`](../../../ci/yaml/_index.md#pagespublish).
Pages uses artifacts to store the files of your site, so the value from
`pages.publish` is automatically appended to [`artifacts:paths`](../../../ci/yaml/_index.md#artifactspaths).
The previous example is equivalent to:
```yaml
create-pages:
script:
- npm run build
pages:
publish: dist
artifacts:
paths:
- dist
```
{{< alert type="warning" >}}
The top-level `publish` keyword was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/519499) in GitLab 17.9 and must now be nested under the `pages` keyword.
{{< /alert >}}
## Regenerate unique domain for GitLab Pages
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/481746) in GitLab 17.7.
{{< /history >}}
You can regenerate the unique domain for your GitLab Pages site.
After the domain is regenerated, the previous URL is no longer active.
If anyone tries to access the old URL, they'll receive a `404` error.
Prerequisites
- You must have at least the Maintainer role for the project.
- The **Use unique domain** setting [must be enabled](_index.md#unique-domains) in your project's Pages settings.
To regenerate a unique domain for your GitLab Pages site:
1. On the left sidebar, select **Deploy > Pages**.
1. Next to **Access pages**, press **Regenerate unique domain**.
1. GitLab generates a new unique domain for your Pages site.
## Known issues
For a list of known issues, see the GitLab [public issue tracker](https://gitlab.com/gitlab-org/gitlab/-/issues?label_name[]=Category%3APages).
## Troubleshooting
### 404 error when accessing a GitLab Pages site URL
This problem most likely results from a missing `index.html` file in the public directory. If after deploying a Pages site
a 404 is encountered, confirm that the public directory contains an `index.html` file. If the file contains a different name
such as `test.html`, the Pages site can still be accessed, but the full path would be needed. For example: `https//group-name.pages.example.com/project-slug/test.html`.
The contents of the public directory can be confirmed by [browsing the artifacts](../../../ci/jobs/job_artifacts.md#download-job-artifacts) from the latest pipeline.
Files listed under the public directory can be accessed through the Pages URL for the project.
A 404 can also be related to incorrect permissions. If [Pages Access Control](pages_access_control.md) is enabled, and a user
goes to the Pages URL and receives a 404 response, it is possible that the user does not have permission to view the site.
To fix this, verify that the user is a member of the project.
### Broken relative links
GitLab Pages supports extensionless URLs. However, due to the problem
described in [issue #354](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/354),
if an extensionless URL ends in a forward slash (`/`), it breaks any relative links on the page.
To work around this issue:
- Ensure any URLs pointing to your Pages site have extensions, or do not include a trailing slash.
- If possible, use only absolute URLs on your site.
### Cannot play media content on Safari
Safari requires the web server to support the [Range request header](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW6) to play your media content. For GitLab Pages to serve
HTTP Range requests, you should use the following two variables in your `.gitlab-ci.yml` file:
```yaml
create-pages:
stage: deploy
variables:
FF_USE_FASTZIP: "true"
ARTIFACT_COMPRESSION_LEVEL: "fastest"
script:
- echo "Deploying pages"
pages: true # specifies that this is a Pages job and publishes the default public directory
environment: production
```
The `FF_USE_FASTZIP` variable enables the [feature flag](https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags) which is needed for [`ARTIFACT_COMPRESSION_LEVEL`](../../../ci/runners/configure_runners.md#artifact-and-cache-settings).
The previous YAML example uses [user-defined job names](_index.md#user-defined-job-names).
### `401` error when accessing private GitLab Pages sites in multiple browser tabs
When you try to access a private Pages URL in two different tabs simultaneously without prior authentication,
two different `state` values are returned for each tab.
However, in the Pages session, only the most recent `state` value is stored for the given client.
As a result, after submitting credentials, one of the tabs returns a `401 Unauthorized` error.
To resolve the `401` error, refresh the page.
### Failing `pages:deploy` job
To deploy with GitLab Pages, the root content directory must contain a non-empty `index.html` file,
or the `pages:deploy` job fails.
The content directory is `public/` by default, or a directory specified with the
`pages.publish` keyword in your `.gitlab-ci.yml` file.
|
https://docs.gitlab.com/user/project/getting_started_part_one
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/getting_started_part_one.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
getting_started_part_one.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages default domain names and URLs
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Pages provides default domain names based on your namespace and project name.
These domains:
- Generate predictable URLs for project sites, user sites, and group sites.
- Support hierarchical paths that reflect your GitLab organizational structure.
- Create unique domain names with automatic redirects when enabled.
- Work seamlessly with custom domain names and SSL/TLS certificates.
- Scale across user, group, and subgroup projects.
This guide explains how GitLab Pages assigns domain names and URLs to your websites, and how to
configure your static site generator accordingly.
## GitLab Pages default domain names
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163523) unique domain URLs to be shorter in GitLab 17.4.
{{< /history >}}
If you use your own GitLab instance to deploy your site with GitLab Pages, verify your Pages
wildcard domain with your sysadmin. This guide is valid for any GitLab instance, provided that you
replace the Pages wildcard domain on GitLab.com (`*.gitlab.io`) with your own.
If you set up a GitLab Pages project on GitLab,
it's automatically accessible under a
subdomain of `namespace.example.io`.
The [`namespace`](../../namespace/_index.md)
is defined by your username on GitLab.com,
or the group name you created this project under.
For GitLab Self-Managed, replace `example.io`
with your instance's Pages domain. For GitLab.com,
Pages domains are `*.gitlab.io`.
| Type of GitLab Pages | Example path of a project in GitLab | Website URL |
| -------------------- | ------------ | ----------- |
| User pages | `username/username.example.io` | `http(s)://username.example.io` |
| Group pages | `acmecorp/acmecorp.example.io` | `http(s)://acmecorp.example.io` |
| Project pages owned by a user | `username/my-website` | `http(s)://username.example.io/my-website` |
| Project pages owned by a group | `acmecorp/webshop` | `http(s)://acmecorp.example.io/webshop`|
| Project pages owned by a subgroup | `acmecorp/documentation/product-manual` | `http(s)://acmecorp.example.io/documentation/product-manual`|
When the **Use unique domain** setting is enabled, Pages builds a unique domain name from
the flattened project name and a six-character unique ID. Users receive a `308 Permanent Redirect` status
redirecting the browser to these unique domain URLs. Browsers might cache this redirect:
| Type of GitLab Pages | Example path of a project in GitLab | Website URL |
| --------------------------------- | --------------------------------------- | ----------- |
| User pages | `username/username.example.io` | `http(s)://username-example-io-123456.example.io` |
| Group pages | `acmecorp/acmecorp.example.io` | `http(s)://acmecorp-example-io-123456.example.io` |
| Project pages owned by a user | `username/my-website` | `https://my-website-123456.gitlab.io/` |
| Project pages owned by a group | `acmecorp/webshop` | `http(s)://webshop-123456.example.io/` |
| Project pages owned by a subgroup | `acmecorp/documentation/product-manual` | `http(s)://product-manual-123456.example.io/` |
`123456` in the example URLs is a six-character unique ID.
For example, if the unique ID is `f85695`, the last example is
`http(s)://product-manual-f85695.example.io/`.
{{< alert type="warning" >}}
There are some known [limitations](introduction.md#subdomains-of-subdomains)
regarding namespaces served under the general domain name and HTTPS.
Make sure to read that section.
{{< /alert >}}
To understand Pages domains clearly, read the examples below.
{{< alert type="note" >}}
The following examples imply you disabled the **Use unique domain** setting. If you did not, refer to the previous table, replacing `example.io` by `gitlab.io`.
{{< /alert >}}
### Project website examples
- You created a project called `blog` under your username `john`,
therefore your project URL is `https://gitlab.com/john/blog/`.
After you enabled GitLab Pages for this project, and build your site,
you can access it at `https://john.gitlab.io/blog/`.
- You created a group for all your websites called `websites`,
and a project in this group is called `blog`. Your project
URL is `https://gitlab.com/websites/blog/`. After you enabled
GitLab Pages for this project, the site is available at
`https://websites.gitlab.io/blog/`.
- You created a group for your engineering department called `engineering`,
a subgroup for all your documentation websites called `docs`,
and a project in this subgroup is called `workflows`. Your project
URL is `https://gitlab.com/engineering/docs/workflows/`. After you enabled
GitLab Pages for this project, the site is available at
`https://engineering.gitlab.io/docs/workflows`.
### User and Group website examples
- Under your username, `john`, you created a project called
`john.gitlab.io`. Your project URL is `https://gitlab.com/john/john.gitlab.io`.
After you enabled GitLab Pages for your project, your website
is published under `https://john.gitlab.io`.
- Under your group `websites`, you created a project called
`websites.gitlab.io`. Your project's URL is `https://gitlab.com/websites/websites.gitlab.io`.
After you enabled GitLab Pages for your project,
your website is published under `https://websites.gitlab.io`.
**General example**:
- On GitLab.com, a project site is always available under
`https://namespace.gitlab.io/project-slug`
- On GitLab.com, a user or group website is available under
`https://namespace.gitlab.io/`
- On your GitLab instance, replace `gitlab.io` with your
Pages server domain. Ask your sysadmin for this information.
## URLs and base URLs
{{< alert type="note" >}}
The `baseurl` option might be named differently in some static site generators.
{{< /alert >}}
Every Static Site Generator (SSG) default configuration expects
to find your website under a (sub)domain (`example.com`), not
in a subdirectory of that domain (`example.com/subdir`). Therefore,
whenever you publish a project website (for example, `namespace.gitlab.io/project-slug`),
you must look for this configuration (base URL) on your static site generator's
documentation and set it up to reflect this pattern.
For example, for a Jekyll site, the `baseurl` is defined in the Jekyll
configuration file, `_config.yml`. If your website URL is
`https://john.gitlab.io/blog/`, you need to add this line to `_config.yml`:
```yaml
baseurl: "/blog"
```
On the contrary, if you deploy your website after forking one of
our [default examples](https://gitlab.com/pages), the `baseurl` is
already configured this way, as all examples there are project
websites. If you decide to make yours a user or group website, you
must remove this configuration from your project. For the Jekyll
example we just mentioned, you must change Jekyll's `_config.yml` to:
```yaml
baseurl: ""
```
If you're using the [plain HTML example](https://gitlab.com/pages/plain-html),
you don't need to set a `baseurl`.
## Custom domains
GitLab Pages supports custom domains and subdomains, served under HTTP or HTTPS.
See [GitLab Pages custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/_index.md) for more information.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages default domain names and URLs
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Pages provides default domain names based on your namespace and project name.
These domains:
- Generate predictable URLs for project sites, user sites, and group sites.
- Support hierarchical paths that reflect your GitLab organizational structure.
- Create unique domain names with automatic redirects when enabled.
- Work seamlessly with custom domain names and SSL/TLS certificates.
- Scale across user, group, and subgroup projects.
This guide explains how GitLab Pages assigns domain names and URLs to your websites, and how to
configure your static site generator accordingly.
## GitLab Pages default domain names
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163523) unique domain URLs to be shorter in GitLab 17.4.
{{< /history >}}
If you use your own GitLab instance to deploy your site with GitLab Pages, verify your Pages
wildcard domain with your sysadmin. This guide is valid for any GitLab instance, provided that you
replace the Pages wildcard domain on GitLab.com (`*.gitlab.io`) with your own.
If you set up a GitLab Pages project on GitLab,
it's automatically accessible under a
subdomain of `namespace.example.io`.
The [`namespace`](../../namespace/_index.md)
is defined by your username on GitLab.com,
or the group name you created this project under.
For GitLab Self-Managed, replace `example.io`
with your instance's Pages domain. For GitLab.com,
Pages domains are `*.gitlab.io`.
| Type of GitLab Pages | Example path of a project in GitLab | Website URL |
| -------------------- | ------------ | ----------- |
| User pages | `username/username.example.io` | `http(s)://username.example.io` |
| Group pages | `acmecorp/acmecorp.example.io` | `http(s)://acmecorp.example.io` |
| Project pages owned by a user | `username/my-website` | `http(s)://username.example.io/my-website` |
| Project pages owned by a group | `acmecorp/webshop` | `http(s)://acmecorp.example.io/webshop`|
| Project pages owned by a subgroup | `acmecorp/documentation/product-manual` | `http(s)://acmecorp.example.io/documentation/product-manual`|
When the **Use unique domain** setting is enabled, Pages builds a unique domain name from
the flattened project name and a six-character unique ID. Users receive a `308 Permanent Redirect` status
redirecting the browser to these unique domain URLs. Browsers might cache this redirect:
| Type of GitLab Pages | Example path of a project in GitLab | Website URL |
| --------------------------------- | --------------------------------------- | ----------- |
| User pages | `username/username.example.io` | `http(s)://username-example-io-123456.example.io` |
| Group pages | `acmecorp/acmecorp.example.io` | `http(s)://acmecorp-example-io-123456.example.io` |
| Project pages owned by a user | `username/my-website` | `https://my-website-123456.gitlab.io/` |
| Project pages owned by a group | `acmecorp/webshop` | `http(s)://webshop-123456.example.io/` |
| Project pages owned by a subgroup | `acmecorp/documentation/product-manual` | `http(s)://product-manual-123456.example.io/` |
`123456` in the example URLs is a six-character unique ID.
For example, if the unique ID is `f85695`, the last example is
`http(s)://product-manual-f85695.example.io/`.
{{< alert type="warning" >}}
There are some known [limitations](introduction.md#subdomains-of-subdomains)
regarding namespaces served under the general domain name and HTTPS.
Make sure to read that section.
{{< /alert >}}
To understand Pages domains clearly, read the examples below.
{{< alert type="note" >}}
The following examples imply you disabled the **Use unique domain** setting. If you did not, refer to the previous table, replacing `example.io` by `gitlab.io`.
{{< /alert >}}
### Project website examples
- You created a project called `blog` under your username `john`,
therefore your project URL is `https://gitlab.com/john/blog/`.
After you enabled GitLab Pages for this project, and build your site,
you can access it at `https://john.gitlab.io/blog/`.
- You created a group for all your websites called `websites`,
and a project in this group is called `blog`. Your project
URL is `https://gitlab.com/websites/blog/`. After you enabled
GitLab Pages for this project, the site is available at
`https://websites.gitlab.io/blog/`.
- You created a group for your engineering department called `engineering`,
a subgroup for all your documentation websites called `docs`,
and a project in this subgroup is called `workflows`. Your project
URL is `https://gitlab.com/engineering/docs/workflows/`. After you enabled
GitLab Pages for this project, the site is available at
`https://engineering.gitlab.io/docs/workflows`.
### User and Group website examples
- Under your username, `john`, you created a project called
`john.gitlab.io`. Your project URL is `https://gitlab.com/john/john.gitlab.io`.
After you enabled GitLab Pages for your project, your website
is published under `https://john.gitlab.io`.
- Under your group `websites`, you created a project called
`websites.gitlab.io`. Your project's URL is `https://gitlab.com/websites/websites.gitlab.io`.
After you enabled GitLab Pages for your project,
your website is published under `https://websites.gitlab.io`.
**General example**:
- On GitLab.com, a project site is always available under
`https://namespace.gitlab.io/project-slug`
- On GitLab.com, a user or group website is available under
`https://namespace.gitlab.io/`
- On your GitLab instance, replace `gitlab.io` with your
Pages server domain. Ask your sysadmin for this information.
## URLs and base URLs
{{< alert type="note" >}}
The `baseurl` option might be named differently in some static site generators.
{{< /alert >}}
Every Static Site Generator (SSG) default configuration expects
to find your website under a (sub)domain (`example.com`), not
in a subdirectory of that domain (`example.com/subdir`). Therefore,
whenever you publish a project website (for example, `namespace.gitlab.io/project-slug`),
you must look for this configuration (base URL) on your static site generator's
documentation and set it up to reflect this pattern.
For example, for a Jekyll site, the `baseurl` is defined in the Jekyll
configuration file, `_config.yml`. If your website URL is
`https://john.gitlab.io/blog/`, you need to add this line to `_config.yml`:
```yaml
baseurl: "/blog"
```
On the contrary, if you deploy your website after forking one of
our [default examples](https://gitlab.com/pages), the `baseurl` is
already configured this way, as all examples there are project
websites. If you decide to make yours a user or group website, you
must remove this configuration from your project. For the Jekyll
example we just mentioned, you must change Jekyll's `_config.yml` to:
```yaml
baseurl: ""
```
If you're using the [plain HTML example](https://gitlab.com/pages/plain-html),
you don't need to set a `baseurl`.
## Custom domains
GitLab Pages supports custom domains and subdomains, served under HTTP or HTTPS.
See [GitLab Pages custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/_index.md) for more information.
|
https://docs.gitlab.com/user/project/redirects
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/redirects.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
redirects.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages redirects
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In GitLab Pages, you can configure rules to forward one URL to another using
[Netlify style](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file)
HTTP redirects.
Not all
[special options offered by Netlify](https://docs.netlify.com/routing/redirects/redirect-options/)
are supported.
| Feature | Supported | Example |
|---------------------------------------------------|------------------------|---------|
| [Redirects (`301`, `302`)](#redirects) | {{< icon name="check-circle" >}} Yes | `/wardrobe.html /narnia.html 302` |
| [Rewrites (`200`)](#rewrites) | {{< icon name="check-circle" >}} Yes | `/* / 200` |
| [Splats](#splats) | {{< icon name="check-circle" >}} Yes | `/news/* /blog/:splat` |
| [Placeholders](#placeholders) | {{< icon name="check-circle" >}} Yes | `/news/:year/:month/:date /blog-:year-:month-:date.html` |
| Rewrites (other than `200`) | {{< icon name="dotted-circle" >}} No | `/en/* /en/404.html 404` |
| Query parameters | {{< icon name="dotted-circle" >}} No | `/store id=:id /blog/:id 301` |
| Force ([shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)) | {{< icon name="dotted-circle" >}} No | `/app/ /app/index.html 200!` |
| [Domain-level redirects](#domain-level-redirects) | {{< icon name="check-circle" >}} Yes | `http://blog.example.com/* https://www.example.com/blog/:splat 301` |
| Redirect by country or language | {{< icon name="dotted-circle" >}} No | `/ /anz 302 Country=au,nz` |
| Redirect by role | {{< icon name="dotted-circle" >}} No | `/admin/* 200! Role=admin` |
{{< alert type="note" >}}
The [matching behavior test cases](https://gitlab.com/gitlab-org/gitlab-pages/-/blob/master/internal/redirects/matching_test.go)
are a good resource for understanding how GitLab implements rule matching in
detail. Community contributions are welcome for any edge cases that aren't included in
this test suite!
{{< /alert >}}
## Create redirects
To create redirects, create a configuration file named `_redirects` in the
`public/` directory of your GitLab Pages site.
- All paths must start with a forward slash `/`.
- A default status code of `301` is applied if no [status code](#http-status-codes) is provided.
- The `_redirects` file has a file size limit and a maximum number of rules per project,
configured at the instance level. Only the first matching rules within the configured maximum are processed.
The default file size limit is 64 KB, and the default maximum number of rules is 1,000.
- If your GitLab Pages site uses the default domain name (such as
`namespace.gitlab.io/project-slug`) you must prefix every rule with the path:
```plaintext
/project-slug/wardrobe.html /project-slug/narnia.html 302
```
- If your GitLab Pages site uses [custom domains](custom_domains_ssl_tls_certification/_index.md),
no project path prefix is needed. For example, if your custom domain is `example.com`,
your `_redirects` file would look like:
```plaintext
/wardrobe.html /narnia.html 302
```
## Files override redirects
Files take priority over redirects. If a file exists on disk, GitLab Pages serves
the file instead of your redirect. For example, if the files `hello.html` and
`world.html` exist, and the `_redirects` file contains the following line, the redirect
is ignored because `hello.html` exists:
```plaintext
/project-slug/hello.html /project-slug/world.html 302
```
GitLab does not support Netlify
[force option](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)
to change this behavior.
## HTTP status codes
A default status code of `301` is applied if no status code is provided, but
you can explicitly set your own. The following HTTP codes are supported:
- **301**: Permanent redirect.
- **302**: Temporary redirect.
- **200**: Standard response for successful HTTP requests. Pages
serves the content in the `to` rule if it exists, without changing the URL in
the address bar.
## Redirects
To create a redirect, add a rule that includes a `from` path, a `to` path,
and an [HTTP status code](#http-status-codes):
```plaintext
# 301 permanent redirect
/old/file.html /new/file.html 301
# 302 temporary redirect
/old/another_file.html /new/another_file.html 302
```
## Rewrites
{{< history >}}
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/619) in GitLab 15.2.
{{< /history >}}
Provide a status code of `200` to serve the content of the `to` path when the
request matches the `from`:
```plaintext
/old/file.html /new/file.html 200
```
This status code can be used in combination with [splat rules](#splats) to dynamically
rewrite the URL.
## Domain-level redirects
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/936) in GitLab 16.8 [with a flag](../../../administration/feature_flags/_index.md) named `FF_ENABLE_DOMAIN_REDIRECT`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-com/-/merge_requests/3395) in GitLab 16.9.
- [Enabled on GitLab Self-Managed and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/1087) in GitLab 16.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/1097) in GitLab 17.4. Feature flag `FF_ENABLE_DOMAIN_REDIRECT` removed.
{{< /history >}}
To create a domain-level redirect, add a domain-level path (beginning with `http://`
or `https://`) to either:
- The `to` path only.
- The `from` and `to` paths.
The supported [HTTP status codes](#http-status-codes) are `301` and `302`:
```plaintext
# 301 permanent redirect
http://blog.example.com/file_1.html https://www.example.com/blog/file_1.html 301
/file_2.html https://www.example.com/blog/file_2.html 301
# 302 temporary redirect
http://blog.example.com/file_3.html https://www.example.com/blog/file_3.html 302
/file_4.html https://www.example.com/blog/file_4.html 302
```
Domain-level redirects can be used in combination with [splat rules](#splats) (including splat placeholders)
to dynamically rewrite the URL path.
## Splats
A rule with an asterisk (`*`) in its `from` path, known as a splat, matches
anything at the start, middle, or end of the requested path. This example
matches anything after `/old/` and rewrites it to `/new/file.html`:
```plaintext
/old/* /new/file.html 200
```
### Splat placeholders
The content matched by a `*` in a rule's `from` path can be injected into the
`to` path using the `:splat` placeholder:
```plaintext
/old/* /new/:splat 200
```
In this example, a request to `/old/file.html` serves the contents of `/new/file.html`
with a `200` status code.
If a rule's `from` path includes multiple splats, the value of the first splat
match replaces any `:splat`s in the `to` path.
### Splat matching behavior
Splats are "greedy" and match as many characters as possible:
```plaintext
/old/*/file /new/:splat/file 301
```
In this example, the rule redirects `/old/a/b/c/file` to `/new/a/b/c/file`.
Splats also match empty strings, so the previous rule redirects
`/old/file` to `/new/file`.
### Rewrite all requests to a root `index.html`
Single page applications (SPAs) often perform their own routing using
client-side routes. For these applications, rewrite all requests
to the root `index.html` so the routing logic can be handled
by the JavaScript application.
Prerequisites:
- If you use [GitLab Pages integration with Let's Encrypt](custom_domains_ssl_tls_certification/lets_encrypt_integration.md),
you must enable it before you add this rule. Otherwise, the redirection breaks the Let's Encrypt
integration. For more details, see
[GitLab Pages issue 649](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/649).
To rewrite requests to `index.html`:
1. Add this `_redirects` rule:
```plaintext
/* /index.html 200
```
1. To make your single-page application work with parallel deployments, edit the redirect rule to
include the path prefix:
```plaintext
/project/base/<prefix>/* /project/base/<prefix>/index.html 200
```
Replace `<prefix>` with your path prefix value.
## Placeholders
Use placeholders in rules to match portions of the requested URL and use these
matches when rewriting or redirecting to a new URL.
A placeholder is formatted as a `:` character followed by a string of letters
(`[a-zA-Z]+`) in both the `from` and `to` paths:
```plaintext
/news/:year/:month/:date/:slug /blog/:year-:month-:date-:slug 200
```
This rule instructs Pages to respond to a request for `/news/2021/08/12/file.html` by
serving the content of `/blog/2021-08-12-file.html` with a `200`.
### Placeholder matching behavior
Compared to [splats](#splats), placeholders are more limited in how much content
they match. Placeholders match text between forward slashes
(`/`), so use placeholders to match single path segments.
In addition, placeholders do not match empty strings. A rule like the following
would **not** match a request URL like `/old/file`:
```plaintext
/old/:path /new/:path
```
## Debug redirect rules
If a redirect isn't working as expected, or you want to check your redirect syntax, visit
`[your pages url]/_redirects`. The `_redirects` file isn't served directly, but your browser
displays a numbered list of your redirect rules, and whether the rule is valid or invalid:
```plaintext
11 rules
rule 1: valid
rule 2: valid
rule 3: error: splats are not supported
rule 4: valid
rule 5: error: placeholders are not supported
rule 6: valid
rule 7: error: no domain-level redirects to outside sites
rule 8: error: url path must start with forward slash /
rule 9: error: no domain-level redirects to outside sites
rule 10: valid
rule 11: valid
```
## Differences from Netlify implementation
Most supported `_redirects` rules behave the same in both GitLab and Netlify.
However, there are some minor differences:
- **All rule URLs must begin with a slash**:
Netlify does not require URLs to begin with a forward slash:
```plaintext
# Valid in Netlify, invalid in GitLab
*/path /new/path 200
```
GitLab validates that all URLs begin with a forward slash. A valid
equivalent of the previous example:
```plaintext
# Valid in both Netlify and GitLab
/old/path /new/path 200
```
- **All placeholder values are populated**:
Netlify only populates placeholder values that appear in the `to` path:
```plaintext
/old /new/:placeholder
```
Given a request to `/old`:
- Netlify redirects to `/new/:placeholder` (with a literal `:placeholder`).
- GitLab redirects to `/new/`.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages redirects
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In GitLab Pages, you can configure rules to forward one URL to another using
[Netlify style](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file)
HTTP redirects.
Not all
[special options offered by Netlify](https://docs.netlify.com/routing/redirects/redirect-options/)
are supported.
| Feature | Supported | Example |
|---------------------------------------------------|------------------------|---------|
| [Redirects (`301`, `302`)](#redirects) | {{< icon name="check-circle" >}} Yes | `/wardrobe.html /narnia.html 302` |
| [Rewrites (`200`)](#rewrites) | {{< icon name="check-circle" >}} Yes | `/* / 200` |
| [Splats](#splats) | {{< icon name="check-circle" >}} Yes | `/news/* /blog/:splat` |
| [Placeholders](#placeholders) | {{< icon name="check-circle" >}} Yes | `/news/:year/:month/:date /blog-:year-:month-:date.html` |
| Rewrites (other than `200`) | {{< icon name="dotted-circle" >}} No | `/en/* /en/404.html 404` |
| Query parameters | {{< icon name="dotted-circle" >}} No | `/store id=:id /blog/:id 301` |
| Force ([shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)) | {{< icon name="dotted-circle" >}} No | `/app/ /app/index.html 200!` |
| [Domain-level redirects](#domain-level-redirects) | {{< icon name="check-circle" >}} Yes | `http://blog.example.com/* https://www.example.com/blog/:splat 301` |
| Redirect by country or language | {{< icon name="dotted-circle" >}} No | `/ /anz 302 Country=au,nz` |
| Redirect by role | {{< icon name="dotted-circle" >}} No | `/admin/* 200! Role=admin` |
{{< alert type="note" >}}
The [matching behavior test cases](https://gitlab.com/gitlab-org/gitlab-pages/-/blob/master/internal/redirects/matching_test.go)
are a good resource for understanding how GitLab implements rule matching in
detail. Community contributions are welcome for any edge cases that aren't included in
this test suite!
{{< /alert >}}
## Create redirects
To create redirects, create a configuration file named `_redirects` in the
`public/` directory of your GitLab Pages site.
- All paths must start with a forward slash `/`.
- A default status code of `301` is applied if no [status code](#http-status-codes) is provided.
- The `_redirects` file has a file size limit and a maximum number of rules per project,
configured at the instance level. Only the first matching rules within the configured maximum are processed.
The default file size limit is 64 KB, and the default maximum number of rules is 1,000.
- If your GitLab Pages site uses the default domain name (such as
`namespace.gitlab.io/project-slug`) you must prefix every rule with the path:
```plaintext
/project-slug/wardrobe.html /project-slug/narnia.html 302
```
- If your GitLab Pages site uses [custom domains](custom_domains_ssl_tls_certification/_index.md),
no project path prefix is needed. For example, if your custom domain is `example.com`,
your `_redirects` file would look like:
```plaintext
/wardrobe.html /narnia.html 302
```
## Files override redirects
Files take priority over redirects. If a file exists on disk, GitLab Pages serves
the file instead of your redirect. For example, if the files `hello.html` and
`world.html` exist, and the `_redirects` file contains the following line, the redirect
is ignored because `hello.html` exists:
```plaintext
/project-slug/hello.html /project-slug/world.html 302
```
GitLab does not support Netlify
[force option](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)
to change this behavior.
## HTTP status codes
A default status code of `301` is applied if no status code is provided, but
you can explicitly set your own. The following HTTP codes are supported:
- **301**: Permanent redirect.
- **302**: Temporary redirect.
- **200**: Standard response for successful HTTP requests. Pages
serves the content in the `to` rule if it exists, without changing the URL in
the address bar.
## Redirects
To create a redirect, add a rule that includes a `from` path, a `to` path,
and an [HTTP status code](#http-status-codes):
```plaintext
# 301 permanent redirect
/old/file.html /new/file.html 301
# 302 temporary redirect
/old/another_file.html /new/another_file.html 302
```
## Rewrites
{{< history >}}
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/619) in GitLab 15.2.
{{< /history >}}
Provide a status code of `200` to serve the content of the `to` path when the
request matches the `from`:
```plaintext
/old/file.html /new/file.html 200
```
This status code can be used in combination with [splat rules](#splats) to dynamically
rewrite the URL.
## Domain-level redirects
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/936) in GitLab 16.8 [with a flag](../../../administration/feature_flags/_index.md) named `FF_ENABLE_DOMAIN_REDIRECT`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-com/-/merge_requests/3395) in GitLab 16.9.
- [Enabled on GitLab Self-Managed and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/1087) in GitLab 16.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/1097) in GitLab 17.4. Feature flag `FF_ENABLE_DOMAIN_REDIRECT` removed.
{{< /history >}}
To create a domain-level redirect, add a domain-level path (beginning with `http://`
or `https://`) to either:
- The `to` path only.
- The `from` and `to` paths.
The supported [HTTP status codes](#http-status-codes) are `301` and `302`:
```plaintext
# 301 permanent redirect
http://blog.example.com/file_1.html https://www.example.com/blog/file_1.html 301
/file_2.html https://www.example.com/blog/file_2.html 301
# 302 temporary redirect
http://blog.example.com/file_3.html https://www.example.com/blog/file_3.html 302
/file_4.html https://www.example.com/blog/file_4.html 302
```
Domain-level redirects can be used in combination with [splat rules](#splats) (including splat placeholders)
to dynamically rewrite the URL path.
## Splats
A rule with an asterisk (`*`) in its `from` path, known as a splat, matches
anything at the start, middle, or end of the requested path. This example
matches anything after `/old/` and rewrites it to `/new/file.html`:
```plaintext
/old/* /new/file.html 200
```
### Splat placeholders
The content matched by a `*` in a rule's `from` path can be injected into the
`to` path using the `:splat` placeholder:
```plaintext
/old/* /new/:splat 200
```
In this example, a request to `/old/file.html` serves the contents of `/new/file.html`
with a `200` status code.
If a rule's `from` path includes multiple splats, the value of the first splat
match replaces any `:splat`s in the `to` path.
### Splat matching behavior
Splats are "greedy" and match as many characters as possible:
```plaintext
/old/*/file /new/:splat/file 301
```
In this example, the rule redirects `/old/a/b/c/file` to `/new/a/b/c/file`.
Splats also match empty strings, so the previous rule redirects
`/old/file` to `/new/file`.
### Rewrite all requests to a root `index.html`
Single page applications (SPAs) often perform their own routing using
client-side routes. For these applications, rewrite all requests
to the root `index.html` so the routing logic can be handled
by the JavaScript application.
Prerequisites:
- If you use [GitLab Pages integration with Let's Encrypt](custom_domains_ssl_tls_certification/lets_encrypt_integration.md),
you must enable it before you add this rule. Otherwise, the redirection breaks the Let's Encrypt
integration. For more details, see
[GitLab Pages issue 649](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/649).
To rewrite requests to `index.html`:
1. Add this `_redirects` rule:
```plaintext
/* /index.html 200
```
1. To make your single-page application work with parallel deployments, edit the redirect rule to
include the path prefix:
```plaintext
/project/base/<prefix>/* /project/base/<prefix>/index.html 200
```
Replace `<prefix>` with your path prefix value.
## Placeholders
Use placeholders in rules to match portions of the requested URL and use these
matches when rewriting or redirecting to a new URL.
A placeholder is formatted as a `:` character followed by a string of letters
(`[a-zA-Z]+`) in both the `from` and `to` paths:
```plaintext
/news/:year/:month/:date/:slug /blog/:year-:month-:date-:slug 200
```
This rule instructs Pages to respond to a request for `/news/2021/08/12/file.html` by
serving the content of `/blog/2021-08-12-file.html` with a `200`.
### Placeholder matching behavior
Compared to [splats](#splats), placeholders are more limited in how much content
they match. Placeholders match text between forward slashes
(`/`), so use placeholders to match single path segments.
In addition, placeholders do not match empty strings. A rule like the following
would **not** match a request URL like `/old/file`:
```plaintext
/old/:path /new/:path
```
## Debug redirect rules
If a redirect isn't working as expected, or you want to check your redirect syntax, visit
`[your pages url]/_redirects`. The `_redirects` file isn't served directly, but your browser
displays a numbered list of your redirect rules, and whether the rule is valid or invalid:
```plaintext
11 rules
rule 1: valid
rule 2: valid
rule 3: error: splats are not supported
rule 4: valid
rule 5: error: placeholders are not supported
rule 6: valid
rule 7: error: no domain-level redirects to outside sites
rule 8: error: url path must start with forward slash /
rule 9: error: no domain-level redirects to outside sites
rule 10: valid
rule 11: valid
```
## Differences from Netlify implementation
Most supported `_redirects` rules behave the same in both GitLab and Netlify.
However, there are some minor differences:
- **All rule URLs must begin with a slash**:
Netlify does not require URLs to begin with a forward slash:
```plaintext
# Valid in Netlify, invalid in GitLab
*/path /new/path 200
```
GitLab validates that all URLs begin with a forward slash. A valid
equivalent of the previous example:
```plaintext
# Valid in both Netlify and GitLab
/old/path /new/path 200
```
- **All placeholder values are populated**:
Netlify only populates placeholder values that appear in the `to` path:
```plaintext
/old /new/:placeholder
```
Given a request to `/old`:
- Netlify redirects to `/new/:placeholder` (with a literal `:placeholder`).
- GitLab redirects to `/new/`.
|
https://docs.gitlab.com/user/project/pages
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
_index.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages
|
Static site hosting, documentation publishing, project websites, and custom domains.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Pages publishes static websites directly from a repository in GitLab.
These websites:
- Deploy automatically with GitLab CI/CD pipelines.
- Support any static site generator (like Hugo, Jekyll, or Gatsby) or plain HTML, CSS, and JavaScript.
- Run on GitLab-provided infrastructure at no additional cost.
- Connect with custom domains and SSL/TLS certificates.
- Control access through built-in authentication.
- Scale reliably for personal, business, or project documentation sites.
To publish a website with Pages, use any static site generator like Gatsby, Jekyll, Hugo, Middleman, Harp, Hexo, or Brunch.
Pages also supports websites written directly in plain HTML, CSS, and JavaScript.
Dynamic server-side processing (like `.php` and `.asp`) is not supported.
For more information, see [Static vs dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/).
## Getting started
To create a GitLab Pages website:
| Document | Description |
|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [Use the GitLab UI to create a simple `.gitlab-ci.yml`](getting_started/pages_ui.md) | Add a Pages site to an existing project. Use the UI to set up a simple `.gitlab-ci.yml`. |
| [Create a `.gitlab-ci.yml` file from scratch](getting_started/pages_from_scratch.md) | Add a Pages site to an existing project. Learn how to create and configure your own CI file. |
| [Use a `.gitlab-ci.yml` template](getting_started/pages_ci_cd_template.md) | Add a Pages site to an existing project. Use a pre-populated CI template file. |
| [Fork a sample project](getting_started/pages_forked_sample_project.md) | Create a new project with Pages already configured by forking a sample project. |
| [Use a project template](getting_started/pages_new_project_template.md) | Create a new project with Pages already configured by using a template. |
To update a GitLab Pages website:
| Document | Description |
|----------|-------------|
| [GitLab Pages domain names, URLs, and base URLs](getting_started_part_one.md) | Learn about GitLab Pages default domains. |
| [Explore GitLab Pages](introduction.md) | Requirements, technical aspects, specific GitLab CI/CD configuration options, Access Control, custom 404 pages, limitations, and FAQ. |
| [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/_index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. |
| [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. |
| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another. |
For more information, see:
| Document | Description |
|----------|-------------|
| [Static vs dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/) | Static versus dynamic site overview. |
| [Modern static site generators](https://about.gitlab.com/blog/2016/06/10/ssg-overview-gitlab-pages-part-2/) | SSG overview. |
| [Build any SSG site with GitLab Pages](https://about.gitlab.com/blog/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/) | Use SSGs for GitLab Pages. |
## Using GitLab Pages
To use GitLab Pages, you must create a project in GitLab to upload your website's
files to. These projects can be either public, internal, or private.
By default, GitLab deploys your website from a specific folder called `public` in your
repository.
You can also [set a custom folder to be deployed with Pages](introduction.md#customize-the-default-folder).
When you create a new project in GitLab, a [repository](../repository/_index.md) becomes available automatically.
To deploy your site, GitLab uses its built-in tool called [GitLab CI/CD](../../../ci/_index.md)
to build your site and publish it to the GitLab Pages server. The sequence of
scripts that GitLab CI/CD runs to accomplish this task is created from a file named
`.gitlab-ci.yml`, which you can [create and modify](getting_started/pages_from_scratch.md).
A user-defined `job` with `pages: true` property in the configuration file makes
GitLab aware that you're deploying a GitLab Pages website.
You can either use the GitLab [default domain for GitLab Pages websites](getting_started_part_one.md#gitlab-pages-default-domain-names),
`*.gitlab.io`, or your own domain (`example.com`). In that case, you
must be an administrator in your domain's registrar (or control panel) to set it up with Pages.
## Access to your Pages site
If you're using GitLab Pages default domain (`.gitlab.io`), your website is
automatically secure and available under HTTPS. If you're using your own custom
domain, you can optionally secure it with SSL/TLS certificates.
If you're using GitLab.com, your website is publicly available to the internet.
To restrict access to your website, enable [GitLab Pages Access Control](pages_access_control.md).
If you're using a GitLab Self-Managed instance, your websites are published on your
own server, according to the [Pages settings](../../../administration/pages/_index.md)
chosen by your sysadmin, who can make them public or internal.
## Pages examples
These GitLab Pages website examples can teach you advanced techniques to use
and adapt for your own needs:
- [Posting to your GitLab Pages blog from iOS](https://about.gitlab.com/blog/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/).
- [GitLab CI: Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/blog/2020/12/10/basics-of-gitlab-ci-updated/).
- [GitLab CI: Deployment & environments](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/).
- [Building a new GitLab docs site with Nanoc, GitLab CI, and GitLab Pages](https://about.gitlab.com/blog/2016/12/07/building-a-new-gitlab-docs-site-with-nanoc-gitlab-ci-and-gitlab-pages/).
- [Publish code coverage reports with GitLab Pages](https://about.gitlab.com/blog/2016/11/03/publish-code-coverage-report-with-gitlab-pages/).
## Administer GitLab Pages for GitLab Self-Managed instances
If you are running a GitLab Self-Managed instance,
[follow the administration steps](../../../administration/pages/_index.md) to configure Pages.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=dD8c7WNcc6s) about how to get started with GitLab Pages administration.
### Configure GitLab Pages in a Helm Chart (Kubernetes) instance
To configure GitLab Pages on instances deployed with Helm chart (Kubernetes), use either:
- [The `gitlab-pages` subchart](https://docs.gitlab.com/charts/charts/gitlab/gitlab-pages/).
- [An external GitLab Pages instance](https://docs.gitlab.com/charts/advanced/external-gitlab-pages/).
## Security for GitLab Pages
### Namespaces that contain `.`
If your username is `example`, your GitLab Pages website is located at `example.gitlab.io`.
GitLab allows usernames to contain a `.`, so a user named `bar.example` could create
a GitLab Pages website `bar.example.gitlab.io` that effectively is a subdomain of your
`example.gitlab.io` website. Be careful if you use JavaScript to set cookies for your website.
The safe way to manually set cookies with JavaScript is to not specify the `domain` at all:
```javascript
// Safe: This cookie is only visible to example.gitlab.io
document.cookie = "key=value";
// Unsafe: This cookie is visible to example.gitlab.io and its subdomains,
// regardless of the presence of the leading dot.
document.cookie = "key=value;domain=.example.gitlab.io";
document.cookie = "key=value;domain=example.gitlab.io";
```
This issue doesn't affect users with a custom domain, or users who don't set any
cookies manually with JavaScript.
### Shared cookies
By default, every project in a group shares the same domain, for example, `group.gitlab.io`. This means that cookies are also shared for all projects in a group.
To ensure each project uses different cookies, enable the Pages [unique domains](#unique-domains) feature for your project.
## Unique domains
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9347) in GitLab 15.9 [with a flag](../../../administration/feature_flags/_index.md) named `pages_unique_domain`. Disabled by default.
- [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/388151) in GitLab 15.11.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122229) in GitLab 16.3.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163523) unique domain URLs to be shorter in GitLab 17.4.
{{< /history >}}
By default, every new project uses pages unique domain. This is to avoid projects on the same group
to share cookies.
The project maintainer can disable this feature on:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Clear the **Use unique domain** checkbox.
1. Select **Save changes**.
For example URLs, see [GitLab Pages default domain names](getting_started_part_one.md#gitlab-pages-default-domain-names).
## Primary domain
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/481334) in GitLab 17.8.
{{< /history >}}
When you use GitLab Pages with custom domains, you can redirect all requests to GitLab Pages to a primary domain.
When the primary domain is selected, users receive `308 Permanent Redirect` status that redirects the browser to the
selected primary domain. Browsers might cache this redirect.
Prerequisites:
- You must have at least the Maintainer role for the project.
- A [custom domain](custom_domains_ssl_tls_certification/_index.md#set-up-a-custom-domain) must be set up.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. From the **Primary domain** dropdown list, select the domain to redirect to.
1. Select **Save changes**.
## Expiring deployments
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162826) in GitLab 17.4.
- Support for variables [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/492289) in GitLab 17.11.
{{< /history >}}
You can configure your Pages deployments to be automatically deleted after
a period of time has passed by specifying a duration at [`pages.expire_in`](../../../ci/yaml/_index.md#pagesexpire_in):
```yaml
create-pages:
stage: deploy
script:
- ...
pages: # specifies that this is a Pages job and publishes the default public directory
expire_in: 1 week
```
Expired deployments are stopped by a cron job that runs every 10 minutes.
Stopped deployments are subsequently deleted by another cron job that also
runs every 10 minutes. To recover it, follow the steps described in
[Recover a stopped deployment](#recover-a-stopped-deployment).
A stopped or deleted deployment is no longer available on the web. You
see a 404 Not found error page at its URL, until another deployment is created
with the same URL configuration.
The previous YAML example uses [user-defined job names](#user-defined-job-names).
### Recover a stopped deployment
Prerequisites:
- You must have at least the Maintainer role for the project.
To recover a stopped deployment that has not yet been deleted:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Near **Deployments** turn on the **Include stopped deployments** toggle.
If your deployment has not been deleted yet, it should be included in the
list.
1. Expand the deployment you want to recover and select **Restore**.
### Delete a Deployment
To delete a deployment:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Under **Deployments**, select any area on the deployment you wish to delete.
The deployment details expand.
1. Select **Delete**.
When you select **Delete**, your deployment is stopped immediately.
Stopped deployments are deleted by a cron job running every 10 minutes.
To restore a stopped deployment that has not been deleted yet, see
[Recover a stopped deployment](#recover-a-stopped-deployment).
## User-defined job names
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/232505) in GitLab 17.5 with a flag `customizable_pages_job_name`, disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169095) in GitLab 17.6. Feature flag `customizable_pages_job_name` removed.
{{< /history >}}
To trigger a Pages deployment from any job, include the `pages` property in the
job definition. It can either be a Boolean set to `true` or a hash.
For example, using `true`:
```yaml
deploy-my-pages-site:
stage: deploy
script:
- npm run build
pages: true # specifies that this is a Pages job and publishes the default public directory
```
For example, using a hash:
```yaml
deploy-pages-review-app:
stage: deploy
script:
- npm run build
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: '_staging'
```
If the `pages` property of a job named `pages` is set to `false`, no
deployment is triggered:
```yaml
pages:
pages: false
```
{{< alert type="warning" >}}
If you have multiple Pages jobs in your pipeline with the same value for
`path_prefix`, the last one to be completed will be deployed with Pages.
{{< /alert >}}
## Parallel deployments
To create multiple deployments for your project at the same time, for example to
create review apps, view the documentation on [Parallel Deployments](parallel_deployments.md).
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Static site hosting, documentation publishing, project websites, and
custom domains.
title: GitLab Pages
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Pages publishes static websites directly from a repository in GitLab.
These websites:
- Deploy automatically with GitLab CI/CD pipelines.
- Support any static site generator (like Hugo, Jekyll, or Gatsby) or plain HTML, CSS, and JavaScript.
- Run on GitLab-provided infrastructure at no additional cost.
- Connect with custom domains and SSL/TLS certificates.
- Control access through built-in authentication.
- Scale reliably for personal, business, or project documentation sites.
To publish a website with Pages, use any static site generator like Gatsby, Jekyll, Hugo, Middleman, Harp, Hexo, or Brunch.
Pages also supports websites written directly in plain HTML, CSS, and JavaScript.
Dynamic server-side processing (like `.php` and `.asp`) is not supported.
For more information, see [Static vs dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/).
## Getting started
To create a GitLab Pages website:
| Document | Description |
|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [Use the GitLab UI to create a simple `.gitlab-ci.yml`](getting_started/pages_ui.md) | Add a Pages site to an existing project. Use the UI to set up a simple `.gitlab-ci.yml`. |
| [Create a `.gitlab-ci.yml` file from scratch](getting_started/pages_from_scratch.md) | Add a Pages site to an existing project. Learn how to create and configure your own CI file. |
| [Use a `.gitlab-ci.yml` template](getting_started/pages_ci_cd_template.md) | Add a Pages site to an existing project. Use a pre-populated CI template file. |
| [Fork a sample project](getting_started/pages_forked_sample_project.md) | Create a new project with Pages already configured by forking a sample project. |
| [Use a project template](getting_started/pages_new_project_template.md) | Create a new project with Pages already configured by using a template. |
To update a GitLab Pages website:
| Document | Description |
|----------|-------------|
| [GitLab Pages domain names, URLs, and base URLs](getting_started_part_one.md) | Learn about GitLab Pages default domains. |
| [Explore GitLab Pages](introduction.md) | Requirements, technical aspects, specific GitLab CI/CD configuration options, Access Control, custom 404 pages, limitations, and FAQ. |
| [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/_index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. |
| [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. |
| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another. |
For more information, see:
| Document | Description |
|----------|-------------|
| [Static vs dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/) | Static versus dynamic site overview. |
| [Modern static site generators](https://about.gitlab.com/blog/2016/06/10/ssg-overview-gitlab-pages-part-2/) | SSG overview. |
| [Build any SSG site with GitLab Pages](https://about.gitlab.com/blog/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/) | Use SSGs for GitLab Pages. |
## Using GitLab Pages
To use GitLab Pages, you must create a project in GitLab to upload your website's
files to. These projects can be either public, internal, or private.
By default, GitLab deploys your website from a specific folder called `public` in your
repository.
You can also [set a custom folder to be deployed with Pages](introduction.md#customize-the-default-folder).
When you create a new project in GitLab, a [repository](../repository/_index.md) becomes available automatically.
To deploy your site, GitLab uses its built-in tool called [GitLab CI/CD](../../../ci/_index.md)
to build your site and publish it to the GitLab Pages server. The sequence of
scripts that GitLab CI/CD runs to accomplish this task is created from a file named
`.gitlab-ci.yml`, which you can [create and modify](getting_started/pages_from_scratch.md).
A user-defined `job` with `pages: true` property in the configuration file makes
GitLab aware that you're deploying a GitLab Pages website.
You can either use the GitLab [default domain for GitLab Pages websites](getting_started_part_one.md#gitlab-pages-default-domain-names),
`*.gitlab.io`, or your own domain (`example.com`). In that case, you
must be an administrator in your domain's registrar (or control panel) to set it up with Pages.
## Access to your Pages site
If you're using GitLab Pages default domain (`.gitlab.io`), your website is
automatically secure and available under HTTPS. If you're using your own custom
domain, you can optionally secure it with SSL/TLS certificates.
If you're using GitLab.com, your website is publicly available to the internet.
To restrict access to your website, enable [GitLab Pages Access Control](pages_access_control.md).
If you're using a GitLab Self-Managed instance, your websites are published on your
own server, according to the [Pages settings](../../../administration/pages/_index.md)
chosen by your sysadmin, who can make them public or internal.
## Pages examples
These GitLab Pages website examples can teach you advanced techniques to use
and adapt for your own needs:
- [Posting to your GitLab Pages blog from iOS](https://about.gitlab.com/blog/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/).
- [GitLab CI: Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/blog/2020/12/10/basics-of-gitlab-ci-updated/).
- [GitLab CI: Deployment & environments](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/).
- [Building a new GitLab docs site with Nanoc, GitLab CI, and GitLab Pages](https://about.gitlab.com/blog/2016/12/07/building-a-new-gitlab-docs-site-with-nanoc-gitlab-ci-and-gitlab-pages/).
- [Publish code coverage reports with GitLab Pages](https://about.gitlab.com/blog/2016/11/03/publish-code-coverage-report-with-gitlab-pages/).
## Administer GitLab Pages for GitLab Self-Managed instances
If you are running a GitLab Self-Managed instance,
[follow the administration steps](../../../administration/pages/_index.md) to configure Pages.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=dD8c7WNcc6s) about how to get started with GitLab Pages administration.
### Configure GitLab Pages in a Helm Chart (Kubernetes) instance
To configure GitLab Pages on instances deployed with Helm chart (Kubernetes), use either:
- [The `gitlab-pages` subchart](https://docs.gitlab.com/charts/charts/gitlab/gitlab-pages/).
- [An external GitLab Pages instance](https://docs.gitlab.com/charts/advanced/external-gitlab-pages/).
## Security for GitLab Pages
### Namespaces that contain `.`
If your username is `example`, your GitLab Pages website is located at `example.gitlab.io`.
GitLab allows usernames to contain a `.`, so a user named `bar.example` could create
a GitLab Pages website `bar.example.gitlab.io` that effectively is a subdomain of your
`example.gitlab.io` website. Be careful if you use JavaScript to set cookies for your website.
The safe way to manually set cookies with JavaScript is to not specify the `domain` at all:
```javascript
// Safe: This cookie is only visible to example.gitlab.io
document.cookie = "key=value";
// Unsafe: This cookie is visible to example.gitlab.io and its subdomains,
// regardless of the presence of the leading dot.
document.cookie = "key=value;domain=.example.gitlab.io";
document.cookie = "key=value;domain=example.gitlab.io";
```
This issue doesn't affect users with a custom domain, or users who don't set any
cookies manually with JavaScript.
### Shared cookies
By default, every project in a group shares the same domain, for example, `group.gitlab.io`. This means that cookies are also shared for all projects in a group.
To ensure each project uses different cookies, enable the Pages [unique domains](#unique-domains) feature for your project.
## Unique domains
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9347) in GitLab 15.9 [with a flag](../../../administration/feature_flags/_index.md) named `pages_unique_domain`. Disabled by default.
- [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/388151) in GitLab 15.11.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122229) in GitLab 16.3.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163523) unique domain URLs to be shorter in GitLab 17.4.
{{< /history >}}
By default, every new project uses pages unique domain. This is to avoid projects on the same group
to share cookies.
The project maintainer can disable this feature on:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Clear the **Use unique domain** checkbox.
1. Select **Save changes**.
For example URLs, see [GitLab Pages default domain names](getting_started_part_one.md#gitlab-pages-default-domain-names).
## Primary domain
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/481334) in GitLab 17.8.
{{< /history >}}
When you use GitLab Pages with custom domains, you can redirect all requests to GitLab Pages to a primary domain.
When the primary domain is selected, users receive `308 Permanent Redirect` status that redirects the browser to the
selected primary domain. Browsers might cache this redirect.
Prerequisites:
- You must have at least the Maintainer role for the project.
- A [custom domain](custom_domains_ssl_tls_certification/_index.md#set-up-a-custom-domain) must be set up.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. From the **Primary domain** dropdown list, select the domain to redirect to.
1. Select **Save changes**.
## Expiring deployments
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162826) in GitLab 17.4.
- Support for variables [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/492289) in GitLab 17.11.
{{< /history >}}
You can configure your Pages deployments to be automatically deleted after
a period of time has passed by specifying a duration at [`pages.expire_in`](../../../ci/yaml/_index.md#pagesexpire_in):
```yaml
create-pages:
stage: deploy
script:
- ...
pages: # specifies that this is a Pages job and publishes the default public directory
expire_in: 1 week
```
Expired deployments are stopped by a cron job that runs every 10 minutes.
Stopped deployments are subsequently deleted by another cron job that also
runs every 10 minutes. To recover it, follow the steps described in
[Recover a stopped deployment](#recover-a-stopped-deployment).
A stopped or deleted deployment is no longer available on the web. You
see a 404 Not found error page at its URL, until another deployment is created
with the same URL configuration.
The previous YAML example uses [user-defined job names](#user-defined-job-names).
### Recover a stopped deployment
Prerequisites:
- You must have at least the Maintainer role for the project.
To recover a stopped deployment that has not yet been deleted:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Near **Deployments** turn on the **Include stopped deployments** toggle.
If your deployment has not been deleted yet, it should be included in the
list.
1. Expand the deployment you want to recover and select **Restore**.
### Delete a Deployment
To delete a deployment:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Under **Deployments**, select any area on the deployment you wish to delete.
The deployment details expand.
1. Select **Delete**.
When you select **Delete**, your deployment is stopped immediately.
Stopped deployments are deleted by a cron job running every 10 minutes.
To restore a stopped deployment that has not been deleted yet, see
[Recover a stopped deployment](#recover-a-stopped-deployment).
## User-defined job names
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/232505) in GitLab 17.5 with a flag `customizable_pages_job_name`, disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169095) in GitLab 17.6. Feature flag `customizable_pages_job_name` removed.
{{< /history >}}
To trigger a Pages deployment from any job, include the `pages` property in the
job definition. It can either be a Boolean set to `true` or a hash.
For example, using `true`:
```yaml
deploy-my-pages-site:
stage: deploy
script:
- npm run build
pages: true # specifies that this is a Pages job and publishes the default public directory
```
For example, using a hash:
```yaml
deploy-pages-review-app:
stage: deploy
script:
- npm run build
pages: # specifies that this is a Pages job and publishes the default public directory
path_prefix: '_staging'
```
If the `pages` property of a job named `pages` is set to `false`, no
deployment is triggered:
```yaml
pages:
pages: false
```
{{< alert type="warning" >}}
If you have multiple Pages jobs in your pipeline with the same value for
`path_prefix`, the last one to be completed will be deployed with Pages.
{{< /alert >}}
## Parallel deployments
To create multiple deployments for your project at the same time, for example to
create review apps, view the documentation on [Parallel Deployments](parallel_deployments.md).
|
https://docs.gitlab.com/user/project/pages_access_control
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages_access_control.md
|
2025-08-13
|
doc/user/project/pages
|
[
"doc",
"user",
"project",
"pages"
] |
pages_access_control.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages access control
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Group SAML SSO support for Pages [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/326288) in GitLab 18.2 [with a flag](../../../administration/feature_flags/_index.md) named `ff_oauth_redirect_to_sso_login`. Disabled by default.
{{< /history >}}
You can enable Pages access control on your project
if your administrator has [enabled the access control feature](../../../administration/pages/_index.md#access-control)
on your GitLab instance. When enabled, only authenticated
[members of your project](../../permissions.md#project-members-permissions)
(at least Guest) can access your website, by default:
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a demonstration, see [Pages access controls](https://www.youtube.com/watch?v=tSPAr5mQYc8).
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Toggle the **Pages** button to enable the access control. If you don't see the toggle button,
that means it isn't enabled. Ask your administrator to [enable it](../../../administration/pages/_index.md#access-control).
1. The Pages access control dropdown list allows you to set who can view pages hosted
with GitLab Pages, depending on your project's visibility:
- If your project is private:
- **Only project members**: Only project members are able to browse the website.
- **Everyone**: Everyone, both logged into and logged out of GitLab, is able to browse the website, no matter their project membership.
- If your project is internal:
- **Only project members**: Only project members are able to browse the website.
- **Everyone with access**: Everyone logged into GitLab is able to browse the website, no matter their project membership. [External users](../../../administration/external_users.md) can access the website only if they have a membership in the project.
- **Everyone**: Everyone, both logged into and logged out of GitLab, is able to browse the website, no matter their project membership.
- If your project is public:
- **Only project members**: Only project members are able to browse the website.
- **Everyone with access**: Everyone, both logged into and logged out of GitLab, is able to browse the website, no matter their project membership.
1. Select **Save changes**. Your changes may not take effect immediately. GitLab Pages uses
a caching mechanism for efficiency. Your changes may not take effect until that cache is
invalidated, which usually takes less than a minute.
The next time someone tries to access your website and the access control is
enabled, they're presented with a page to sign in to GitLab and verify they
can access the website.
When [SAML SSO](../../group/saml_sso/_index.md) is configured for the associated group
and the access control is enabled, users must authenticate using SSO before accessing the website.
## Restrict Pages access to project members for the group and its subgroups
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/254962) in GitLab 17.9.
{{< /history >}}
You can configure a setting for the group to restrict Pages access to only project members.
When enabled, all projects in the group and its subgroups become visible only to members.
Prerequisites
- Public access to Pages must not be [disabled at the instance level.](../../../administration/pages/_index.md#disable-public-access-to-all-pages-sites)
- You must have the Owner role for the group.
To do this:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Under **Pages access control**, select
**Restrict access to only project members on all group projects**.
1. Select **Save changes**.
GitLab Pages uses a cache for efficiency. Changes to access settings typically take effect within one minute when the cache updates.
## Authenticate with an access token
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/388) in GitLab 17.10.
{{< /history >}}
To authenticate against a restricted GitLab Pages site, you can provide the `Authorization` header with an access token.
Prerequisites:
- You must have one of the following access tokens with the `read_api` scope:
- [Personal access token](../../profile/personal_access_tokens.md#create-a-personal-access-token)
- [Project access token](../settings/project_access_tokens.md#create-a-project-access-token)
- [Group access token](../../group/settings/group_access_tokens.md#create-a-group-access-token)
- [OAuth 2.0 token](../../../api/oauth2.md)
For example, to use an access token with OAuth-compliant headers:
```shell
curl --header "Authorization: Bearer <your_access_token>" <published_pages_url>
```
For invalid or unauthorized access tokens, returns [`404`](../../../api/rest/troubleshooting.md#status-codes).
## Terminating a Pages session
To sign out of your GitLab Pages website, revoke the application access token
for GitLab Pages:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. Select **Applications**.
1. In the **Authorized applications** section, find the **GitLab Pages**
entry, and select **Revoke**.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages access control
breadcrumbs:
- doc
- user
- project
- pages
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Group SAML SSO support for Pages [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/326288) in GitLab 18.2 [with a flag](../../../administration/feature_flags/_index.md) named `ff_oauth_redirect_to_sso_login`. Disabled by default.
{{< /history >}}
You can enable Pages access control on your project
if your administrator has [enabled the access control feature](../../../administration/pages/_index.md#access-control)
on your GitLab instance. When enabled, only authenticated
[members of your project](../../permissions.md#project-members-permissions)
(at least Guest) can access your website, by default:
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a demonstration, see [Pages access controls](https://www.youtube.com/watch?v=tSPAr5mQYc8).
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Toggle the **Pages** button to enable the access control. If you don't see the toggle button,
that means it isn't enabled. Ask your administrator to [enable it](../../../administration/pages/_index.md#access-control).
1. The Pages access control dropdown list allows you to set who can view pages hosted
with GitLab Pages, depending on your project's visibility:
- If your project is private:
- **Only project members**: Only project members are able to browse the website.
- **Everyone**: Everyone, both logged into and logged out of GitLab, is able to browse the website, no matter their project membership.
- If your project is internal:
- **Only project members**: Only project members are able to browse the website.
- **Everyone with access**: Everyone logged into GitLab is able to browse the website, no matter their project membership. [External users](../../../administration/external_users.md) can access the website only if they have a membership in the project.
- **Everyone**: Everyone, both logged into and logged out of GitLab, is able to browse the website, no matter their project membership.
- If your project is public:
- **Only project members**: Only project members are able to browse the website.
- **Everyone with access**: Everyone, both logged into and logged out of GitLab, is able to browse the website, no matter their project membership.
1. Select **Save changes**. Your changes may not take effect immediately. GitLab Pages uses
a caching mechanism for efficiency. Your changes may not take effect until that cache is
invalidated, which usually takes less than a minute.
The next time someone tries to access your website and the access control is
enabled, they're presented with a page to sign in to GitLab and verify they
can access the website.
When [SAML SSO](../../group/saml_sso/_index.md) is configured for the associated group
and the access control is enabled, users must authenticate using SSO before accessing the website.
## Restrict Pages access to project members for the group and its subgroups
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/254962) in GitLab 17.9.
{{< /history >}}
You can configure a setting for the group to restrict Pages access to only project members.
When enabled, all projects in the group and its subgroups become visible only to members.
Prerequisites
- Public access to Pages must not be [disabled at the instance level.](../../../administration/pages/_index.md#disable-public-access-to-all-pages-sites)
- You must have the Owner role for the group.
To do this:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Under **Pages access control**, select
**Restrict access to only project members on all group projects**.
1. Select **Save changes**.
GitLab Pages uses a cache for efficiency. Changes to access settings typically take effect within one minute when the cache updates.
## Authenticate with an access token
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/388) in GitLab 17.10.
{{< /history >}}
To authenticate against a restricted GitLab Pages site, you can provide the `Authorization` header with an access token.
Prerequisites:
- You must have one of the following access tokens with the `read_api` scope:
- [Personal access token](../../profile/personal_access_tokens.md#create-a-personal-access-token)
- [Project access token](../settings/project_access_tokens.md#create-a-project-access-token)
- [Group access token](../../group/settings/group_access_tokens.md#create-a-group-access-token)
- [OAuth 2.0 token](../../../api/oauth2.md)
For example, to use an access token with OAuth-compliant headers:
```shell
curl --header "Authorization: Bearer <your_access_token>" <published_pages_url>
```
For invalid or unauthorized access tokens, returns [`404`](../../../api/rest/troubleshooting.md#status-codes).
## Terminating a Pages session
To sign out of your GitLab Pages website, revoke the application access token
for GitLab Pages:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. Select **Applications**.
1. In the **Authorized applications** section, find the **GitLab Pages**
entry, and select **Revoke**.
|
https://docs.gitlab.com/user/project/pages/custom_domains_ssl_tls_certification
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/_index.md
|
2025-08-13
|
doc/user/project/pages/custom_domains_ssl_tls_certification
|
[
"doc",
"user",
"project",
"pages",
"custom_domains_ssl_tls_certification"
] |
_index.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages custom domains
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/238461) in GitLab 15.4, you can use verified domains to [bypass user email confirmation for SAML- or SCIM-provisioned users](../../../group/saml_sso/_index.md#bypass-user-email-confirmation-with-verified-domains).
{{< /history >}}
You can use custom domains:
- With GitLab Pages.
- To [bypass user email confirmation for SAML- or SCIM-provisioned users](../../../group/saml_sso/_index.md#bypass-user-email-confirmation-with-verified-domains).
When using custom domains this way, you use the GitLab Pages feature but can skip the [prerequisites](#prerequisites).
To use one or more custom domain names:
- Add a [custom **root domain** or a **subdomain**](#set-up-a-custom-domain).
- Add [SSL/TLS certification](#adding-an-ssltls-certificate-to-pages).
{{< alert type="warning" >}}
You cannot verify the [most popular public email domains](../../../group/access_and_permissions.md#restrict-group-access-by-domain).
{{< /alert >}}
## Set up a custom domain
To set up Pages with a custom domain name, read the requirements and steps below.
### Prerequisites
- An administrator has configured the server for [GitLab Pages custom domains](../../../../administration/pages/_index.md#advanced-configuration)
- A GitLab Pages website up and running, served under the default Pages domain
(`*.gitlab.io`, for GitLab.com).
- A custom domain name `example.com` or subdomain `subdomain.example.com`.
- Access to your domain's server control panel to set up DNS records:
- A DNS record (`A`, `AAAA`, `ALIAS`, or `CNAME`) pointing your domain to the GitLab Pages server. If
there are multiple DNS records on that name, you must use an `ALIAS` record.
- A DNS `TXT` record to verify your domain's ownership.
### Steps
Follow the steps below to add your custom domain to Pages. See also
this document for an [overview on DNS records](dns_concepts.md).
#### 1. Add a custom domain
To add your custom domain to GitLab Pages:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. In the upper-right corner, select **New Domain**.
1. In **Domain**, enter the domain name.
1. Optional. In **Certificate**, turn off the **Automatic certificate management using Let's Encrypt** toggle to add an [SSL/TLS certificate](#adding-an-ssltls-certificate-to-pages). You can also add the certificate and key later.
1. Select **Create New Domain**.
#### 2. Get the verification code
After you add a new domain to Pages, the verification code prompts you. Copy the values from GitLab
and paste them in your domain's control panel as a `TXT` record on the next step.

#### 3. Set up DNS records
Read this document for an [overview of DNS records for Pages](dns_concepts.md).
If you're familiar with the subject, follow the instructions below
according to the type of domain you want to use with your Pages site:
- [For root domains](#for-root-domains), `example.com`.
- [For subdomains](#for-subdomains), `subdomain.example.com`.
- [For both](#for-both-root-and-subdomains).
##### For root domains
Root domains (`example.com`) require:
- At least one of:
- A [DNS `A` record](dns_concepts.md#a-record) pointing your domain to the Pages server.
- A [DNS `AAAA` record](dns_concepts.md#aaaa-record) pointing your domain to the Pages server.
- A [`TXT` record](dns_concepts.md#txt-record) to verify your domain's ownership.
| From | DNS Record | To |
| --------------------------------------------- | ---------- | --------------- |
| `example.com` | `A` | `35.185.44.232` |
| `example.com` | `AAAA` | `2600:1901:0:7b8a::` |
| `_gitlab-pages-verification-code.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
For projects on GitLab.com, the IPv4 address is `35.185.44.232` and the IPv6 address is `2600:1901:0:7b8a::`.
For projects living in other GitLab instances (CE or EE), contact
your sysadmin asking for this information (which IP address is Pages
server running on your instance).

{{< alert type="warning" >}}
If you use your root domain for your GitLab Pages website
**only**, and if your domain registrar supports this feature, you can
add a DNS apex `CNAME` record instead of an `A` or `AAAA` record. The main
advantage of doing so is that when GitLab Pages IP on GitLab.com
changes for whatever reason, you don't need to update your `A` or `AAAA` record.
There may be a few exceptions, but **this method is not recommended**
as it most likely doesn't work if you set an [`MX` record](dns_concepts.md#mx-record) for your root domain.
{{< /alert >}}
##### For subdomains
Subdomains (`subdomain.example.com`) require:
- A DNS [`ALIAS` or `CNAME` record](dns_concepts.md#cname-record) pointing your subdomain to the Pages server.
- A DNS [`TXT` record](dns_concepts.md#txt-record) to verify your domain's ownership.
| From | DNS Record | To |
|:--------------------------------------------------------|:----------------|:----------------------|
| `subdomain.example.com` | `ALIAS`/`CNAME` | `namespace.gitlab.io` |
| `_gitlab-pages-verification-code.subdomain.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
Whether it's a user or a project website, the DNS record
should point to your Pages domain (`namespace.gitlab.io`),
without any path.
##### For both root and subdomains
There are a few cases where you need to point both the subdomain and root
domain to the same website, for instance, `example.com` and `www.example.com`.
They require:
- A DNS `A` record for the domain.
- A DNS `AAAA` record for the domain.
- A DNS `ALIAS`/`CNAME` record for the subdomain.
- A DNS `TXT` record for each.
| From | DNS Record | To |
|---------------------------------------------------|------------|----|
| `example.com` | `A` | `35.185.44.232` |
| `example.com` | `AAAA` | `2600:1901:0:7b8a::` |
| `_gitlab-pages-verification-code.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
| `www.example.com` | `CNAME` | `namespace.gitlab.io` |
| `_gitlab-pages-verification-code.www.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
If you're using Cloudflare, check
[Redirecting `www.domain.com` to `domain.com` with Cloudflare](#redirect-wwwdomaincom-to-domaincom-with-cloudflare).
Additionally:
- **Do not** use a `CNAME` record if you want to point your
`domain.com` to your GitLab Pages site. Use an `A` record instead.
- **Do not** add any special chars after the default Pages
domain. For example, don't point `subdomain.domain.com` to
or `namespace.gitlab.io/`. Some domain hosting providers may request a trailing dot (`namespace.gitlab.io.`), though.
- GitLab Pages IP on GitLab.com [was changed](https://about.gitlab.com/releases/2017/03/06/we-are-changing-the-ip-of-gitlab-pages-on-gitlab-com/) in 2017.
- GitLab Pages IP on GitLab.com [has changed](https://about.gitlab.com/blog/2018/07/19/gcp-move-update/#gitlab-pages-and-custom-domains)
from `52.167.214.135` to `35.185.44.232` in 2018.
- IPv6 support [was added](https://gitlab.com/gitlab-org/gitlab/-/issues/214718)
to GitLab.com in 2023.
#### 4. Verify the domain's ownership
After you have added all the DNS records:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. In **Verification status**, select **Retry verification** ({{< icon name="retry" >}}).

As soon as your domain becomes active, your website is available through your domain name.
{{< alert type="warning" >}}
Considering GitLab instances with domain verification enabled,
if the domain can't be verified for 7 days, it's removed
from the GitLab project.
{{< /alert >}}
Additionally:
- Domain verification is **required for GitLab.com users**.
For GitLab Self-Managed, your GitLab administrator has the option
to [disabled custom domain verification](../../../../administration/pages/_index.md#custom-domain-verification).
- [DNS propagation may take some time (up to 24 hours)](https://www.inmotionhosting.com/support/domain-names/dns-nameserver-changes/complete-guide-to-dns-records/),
although it's usually a matter of minutes to complete. Until it does, verification
fails, and attempts to visit your domain result in a 404.
- Once your domain has been verified, leave the verification record
in place. Your domain is periodically reverified, and may be
disabled if the record is removed.
### Add more domain aliases
You can add more than one alias (custom domains and subdomains) to the same project.
An alias can be understood as having many doors leading to the same room.
All the aliases you've set to your site are listed on **Setting > Pages**.
From that page, you can view, add, and remove them.
### Redirect `www.domain.com` to `domain.com` with Cloudflare
If you use Cloudflare, you can redirect `www` to `domain.com`
without adding both `www.domain.com` and `domain.com` to GitLab.
To do so, you can use Cloudflare's page rules associated to a
`CNAME` record to redirect `www.domain.com` to `domain.com`. You
can use the following setup:
1. In Cloudflare, create at least one of:
- A DNS `A` record pointing `domain.com` to `35.185.44.232`.
- A DNS `AAAA` record pointing `domain.com` to `2600:1901:0:7b8a::`.
1. In GitLab, add the domain to GitLab Pages and get the verification code.
1. In Cloudflare, create a DNS `TXT` record to verify your domain.
1. In GitLab, verify your domain.
1. In Cloudflare, create a DNS `CNAME` record pointing `www` to `domain.com`.
1. In Cloudflare, add a Page Rule pointing `www.domain.com` to `domain.com`:
- Go to your domain's dashboard and select **Page Rules**
on the top nav.
- Select **Create Page Rule**.
- Enter the domain `www.domain.com` and select **+ Add a Setting**.
- From the dropdown list, choose **Forwarding URL**, then select the
status code **301 - Permanent Redirect**.
- Enter the destination URL `https://domain.com`.
## Adding an SSL/TLS certificate to Pages
Read this document for an [overview on SSL/TLS certification](ssl_tls_concepts.md).
To secure your custom domain with GitLab Pages you can opt by:
- Using the [Let's Encrypt integration with GitLab Pages](lets_encrypt_integration.md),
which automatically obtains and renews SSL certificates
for your Pages domains.
- Manually adding SSL/TLS certificates to GitLab Pages websites
by following the steps below.
### Manual addition of SSL/TLS certificates
You can use any certificate satisfying the following requirements:
- A GitLab Pages website is up and running, accessible on a custom domain.
- **A PEM certificate**: it is the certificate generated by the CA,
which needs to be added to the field **Certificate (PEM)**.
- **An [intermediate certificate](https://en.wikipedia.org/wiki/Intermediate_certificate_authority)**: (aka "root certificate"), it is
the part of the encryption keychain that identifies the CA.
Usually it's combined with the PEM certificate, but there are
some cases in which you need to add them manually.
[Cloudflare certs](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/)
are one of these cases.
- **A private key**, it's an encrypted key which validates
your PEM against your domain.
For example, [Cloudflare certificates](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/)
meet these requirements.
#### Steps
- To add the certificate at the time you add a new domain:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the left sidebar, select **Deploy > Pages**.
1. In the upper-right corner, select **New Domain**.
1. In **Domain**, enter the domain name.
1. In **Certificate**, turn off the **Automatic certificate management using Let's Encrypt** toggle to add an [SSL/TLS certificate](#adding-an-ssltls-certificate-to-pages).
1. Select **Create New Domain**.
- To add the certificate to a domain previously added:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the left sidebar, select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. In **Certificate**, turn off the **Automatic certificate management using Let's Encrypt** toggle to add an [SSL/TLS certificate](#adding-an-ssltls-certificate-to-pages).
1. Select **Save changes**.
1. Add the PEM certificate to its corresponding field.
1. If your certificate is missing its intermediate, copy
and paste the root certificate (usually available from your CA website)
and paste it in the [same field as your PEM certificate](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/),
just jumping a line between them.
1. Copy your private key and paste it in the last field.
**Do not** open certificates or encryption keys in
regular text editors. Always use code editors (such as
Sublime Text, Dreamweaver, Brackets, etc).
## Force HTTPS for GitLab Pages websites
To make your website's visitors even more secure, you can choose to
force HTTPS for GitLab Pages. By doing so, all attempts to visit your
website through HTTP are automatically redirected to HTTPS through 301.
It works with both the GitLab default domain and with your custom
domain (as long as you've set a valid certificate for it).
To enable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Select the **Force HTTPS (requires valid certificates)** checkbox.
1. Select **Save changes**.
If you use Cloudflare CDN in front of GitLab Pages, make sure to set the SSL connection setting to
`full` instead of `flexible`. For more details, see the [Cloudflare CDN directions](https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes#h_4e0d1a7c-eb71-4204-9e22-9d3ef9ef7fef).
## Edit a custom domain
You can edit a custom domain to:
- View the custom domain.
- View the DNS record to add.
- View the TXT verification entry.
- Retry verification.
- Edit the certificate settings.
To edit a custom domain:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
## Delete a custom domain
After a custom domain is deleted, the domain is no longer verified in GitLab and cannot be used with GitLab Pages.
To delete and remove a custom domain:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Remove domain** ({{< icon name="remove" >}})
1. When prompted, select **Remove domain**.
## Troubleshooting
### Domain verification
To manually verify that you have properly configured the domain verification
`TXT` DNS entry, you can run the following command in your terminal:
```shell
dig _gitlab-pages-verification-code.<YOUR-PAGES-DOMAIN> TXT
```
Expect the output:
```plaintext
;; ANSWER SECTION:
_gitlab-pages-verification-code.<YOUR-PAGES-DOMAIN>. 300 IN TXT "gitlab-pages-verification-code=<YOUR-VERIFICATION-CODE>"
```
In some cases it can help to add the verification code with the same domain name as you are trying to register.
For a root domain:
| From | DNS Record | To |
| ------------------------------------------------- | ---------- | ---------------------- |
| `example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
| `_gitlab-pages-verification-code.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
For a subdomain:
| From | DNS Record | To |
| ------------------------------------------------- | ---------- | ---------------------- |
| `www.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
| `_gitlab-pages-verification-code.www.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages custom domains
breadcrumbs:
- doc
- user
- project
- pages
- custom_domains_ssl_tls_certification
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/238461) in GitLab 15.4, you can use verified domains to [bypass user email confirmation for SAML- or SCIM-provisioned users](../../../group/saml_sso/_index.md#bypass-user-email-confirmation-with-verified-domains).
{{< /history >}}
You can use custom domains:
- With GitLab Pages.
- To [bypass user email confirmation for SAML- or SCIM-provisioned users](../../../group/saml_sso/_index.md#bypass-user-email-confirmation-with-verified-domains).
When using custom domains this way, you use the GitLab Pages feature but can skip the [prerequisites](#prerequisites).
To use one or more custom domain names:
- Add a [custom **root domain** or a **subdomain**](#set-up-a-custom-domain).
- Add [SSL/TLS certification](#adding-an-ssltls-certificate-to-pages).
{{< alert type="warning" >}}
You cannot verify the [most popular public email domains](../../../group/access_and_permissions.md#restrict-group-access-by-domain).
{{< /alert >}}
## Set up a custom domain
To set up Pages with a custom domain name, read the requirements and steps below.
### Prerequisites
- An administrator has configured the server for [GitLab Pages custom domains](../../../../administration/pages/_index.md#advanced-configuration)
- A GitLab Pages website up and running, served under the default Pages domain
(`*.gitlab.io`, for GitLab.com).
- A custom domain name `example.com` or subdomain `subdomain.example.com`.
- Access to your domain's server control panel to set up DNS records:
- A DNS record (`A`, `AAAA`, `ALIAS`, or `CNAME`) pointing your domain to the GitLab Pages server. If
there are multiple DNS records on that name, you must use an `ALIAS` record.
- A DNS `TXT` record to verify your domain's ownership.
### Steps
Follow the steps below to add your custom domain to Pages. See also
this document for an [overview on DNS records](dns_concepts.md).
#### 1. Add a custom domain
To add your custom domain to GitLab Pages:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. In the upper-right corner, select **New Domain**.
1. In **Domain**, enter the domain name.
1. Optional. In **Certificate**, turn off the **Automatic certificate management using Let's Encrypt** toggle to add an [SSL/TLS certificate](#adding-an-ssltls-certificate-to-pages). You can also add the certificate and key later.
1. Select **Create New Domain**.
#### 2. Get the verification code
After you add a new domain to Pages, the verification code prompts you. Copy the values from GitLab
and paste them in your domain's control panel as a `TXT` record on the next step.

#### 3. Set up DNS records
Read this document for an [overview of DNS records for Pages](dns_concepts.md).
If you're familiar with the subject, follow the instructions below
according to the type of domain you want to use with your Pages site:
- [For root domains](#for-root-domains), `example.com`.
- [For subdomains](#for-subdomains), `subdomain.example.com`.
- [For both](#for-both-root-and-subdomains).
##### For root domains
Root domains (`example.com`) require:
- At least one of:
- A [DNS `A` record](dns_concepts.md#a-record) pointing your domain to the Pages server.
- A [DNS `AAAA` record](dns_concepts.md#aaaa-record) pointing your domain to the Pages server.
- A [`TXT` record](dns_concepts.md#txt-record) to verify your domain's ownership.
| From | DNS Record | To |
| --------------------------------------------- | ---------- | --------------- |
| `example.com` | `A` | `35.185.44.232` |
| `example.com` | `AAAA` | `2600:1901:0:7b8a::` |
| `_gitlab-pages-verification-code.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
For projects on GitLab.com, the IPv4 address is `35.185.44.232` and the IPv6 address is `2600:1901:0:7b8a::`.
For projects living in other GitLab instances (CE or EE), contact
your sysadmin asking for this information (which IP address is Pages
server running on your instance).

{{< alert type="warning" >}}
If you use your root domain for your GitLab Pages website
**only**, and if your domain registrar supports this feature, you can
add a DNS apex `CNAME` record instead of an `A` or `AAAA` record. The main
advantage of doing so is that when GitLab Pages IP on GitLab.com
changes for whatever reason, you don't need to update your `A` or `AAAA` record.
There may be a few exceptions, but **this method is not recommended**
as it most likely doesn't work if you set an [`MX` record](dns_concepts.md#mx-record) for your root domain.
{{< /alert >}}
##### For subdomains
Subdomains (`subdomain.example.com`) require:
- A DNS [`ALIAS` or `CNAME` record](dns_concepts.md#cname-record) pointing your subdomain to the Pages server.
- A DNS [`TXT` record](dns_concepts.md#txt-record) to verify your domain's ownership.
| From | DNS Record | To |
|:--------------------------------------------------------|:----------------|:----------------------|
| `subdomain.example.com` | `ALIAS`/`CNAME` | `namespace.gitlab.io` |
| `_gitlab-pages-verification-code.subdomain.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
Whether it's a user or a project website, the DNS record
should point to your Pages domain (`namespace.gitlab.io`),
without any path.
##### For both root and subdomains
There are a few cases where you need to point both the subdomain and root
domain to the same website, for instance, `example.com` and `www.example.com`.
They require:
- A DNS `A` record for the domain.
- A DNS `AAAA` record for the domain.
- A DNS `ALIAS`/`CNAME` record for the subdomain.
- A DNS `TXT` record for each.
| From | DNS Record | To |
|---------------------------------------------------|------------|----|
| `example.com` | `A` | `35.185.44.232` |
| `example.com` | `AAAA` | `2600:1901:0:7b8a::` |
| `_gitlab-pages-verification-code.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
| `www.example.com` | `CNAME` | `namespace.gitlab.io` |
| `_gitlab-pages-verification-code.www.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
If you're using Cloudflare, check
[Redirecting `www.domain.com` to `domain.com` with Cloudflare](#redirect-wwwdomaincom-to-domaincom-with-cloudflare).
Additionally:
- **Do not** use a `CNAME` record if you want to point your
`domain.com` to your GitLab Pages site. Use an `A` record instead.
- **Do not** add any special chars after the default Pages
domain. For example, don't point `subdomain.domain.com` to
or `namespace.gitlab.io/`. Some domain hosting providers may request a trailing dot (`namespace.gitlab.io.`), though.
- GitLab Pages IP on GitLab.com [was changed](https://about.gitlab.com/releases/2017/03/06/we-are-changing-the-ip-of-gitlab-pages-on-gitlab-com/) in 2017.
- GitLab Pages IP on GitLab.com [has changed](https://about.gitlab.com/blog/2018/07/19/gcp-move-update/#gitlab-pages-and-custom-domains)
from `52.167.214.135` to `35.185.44.232` in 2018.
- IPv6 support [was added](https://gitlab.com/gitlab-org/gitlab/-/issues/214718)
to GitLab.com in 2023.
#### 4. Verify the domain's ownership
After you have added all the DNS records:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. In **Verification status**, select **Retry verification** ({{< icon name="retry" >}}).

As soon as your domain becomes active, your website is available through your domain name.
{{< alert type="warning" >}}
Considering GitLab instances with domain verification enabled,
if the domain can't be verified for 7 days, it's removed
from the GitLab project.
{{< /alert >}}
Additionally:
- Domain verification is **required for GitLab.com users**.
For GitLab Self-Managed, your GitLab administrator has the option
to [disabled custom domain verification](../../../../administration/pages/_index.md#custom-domain-verification).
- [DNS propagation may take some time (up to 24 hours)](https://www.inmotionhosting.com/support/domain-names/dns-nameserver-changes/complete-guide-to-dns-records/),
although it's usually a matter of minutes to complete. Until it does, verification
fails, and attempts to visit your domain result in a 404.
- Once your domain has been verified, leave the verification record
in place. Your domain is periodically reverified, and may be
disabled if the record is removed.
### Add more domain aliases
You can add more than one alias (custom domains and subdomains) to the same project.
An alias can be understood as having many doors leading to the same room.
All the aliases you've set to your site are listed on **Setting > Pages**.
From that page, you can view, add, and remove them.
### Redirect `www.domain.com` to `domain.com` with Cloudflare
If you use Cloudflare, you can redirect `www` to `domain.com`
without adding both `www.domain.com` and `domain.com` to GitLab.
To do so, you can use Cloudflare's page rules associated to a
`CNAME` record to redirect `www.domain.com` to `domain.com`. You
can use the following setup:
1. In Cloudflare, create at least one of:
- A DNS `A` record pointing `domain.com` to `35.185.44.232`.
- A DNS `AAAA` record pointing `domain.com` to `2600:1901:0:7b8a::`.
1. In GitLab, add the domain to GitLab Pages and get the verification code.
1. In Cloudflare, create a DNS `TXT` record to verify your domain.
1. In GitLab, verify your domain.
1. In Cloudflare, create a DNS `CNAME` record pointing `www` to `domain.com`.
1. In Cloudflare, add a Page Rule pointing `www.domain.com` to `domain.com`:
- Go to your domain's dashboard and select **Page Rules**
on the top nav.
- Select **Create Page Rule**.
- Enter the domain `www.domain.com` and select **+ Add a Setting**.
- From the dropdown list, choose **Forwarding URL**, then select the
status code **301 - Permanent Redirect**.
- Enter the destination URL `https://domain.com`.
## Adding an SSL/TLS certificate to Pages
Read this document for an [overview on SSL/TLS certification](ssl_tls_concepts.md).
To secure your custom domain with GitLab Pages you can opt by:
- Using the [Let's Encrypt integration with GitLab Pages](lets_encrypt_integration.md),
which automatically obtains and renews SSL certificates
for your Pages domains.
- Manually adding SSL/TLS certificates to GitLab Pages websites
by following the steps below.
### Manual addition of SSL/TLS certificates
You can use any certificate satisfying the following requirements:
- A GitLab Pages website is up and running, accessible on a custom domain.
- **A PEM certificate**: it is the certificate generated by the CA,
which needs to be added to the field **Certificate (PEM)**.
- **An [intermediate certificate](https://en.wikipedia.org/wiki/Intermediate_certificate_authority)**: (aka "root certificate"), it is
the part of the encryption keychain that identifies the CA.
Usually it's combined with the PEM certificate, but there are
some cases in which you need to add them manually.
[Cloudflare certs](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/)
are one of these cases.
- **A private key**, it's an encrypted key which validates
your PEM against your domain.
For example, [Cloudflare certificates](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/)
meet these requirements.
#### Steps
- To add the certificate at the time you add a new domain:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the left sidebar, select **Deploy > Pages**.
1. In the upper-right corner, select **New Domain**.
1. In **Domain**, enter the domain name.
1. In **Certificate**, turn off the **Automatic certificate management using Let's Encrypt** toggle to add an [SSL/TLS certificate](#adding-an-ssltls-certificate-to-pages).
1. Select **Create New Domain**.
- To add the certificate to a domain previously added:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the left sidebar, select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. In **Certificate**, turn off the **Automatic certificate management using Let's Encrypt** toggle to add an [SSL/TLS certificate](#adding-an-ssltls-certificate-to-pages).
1. Select **Save changes**.
1. Add the PEM certificate to its corresponding field.
1. If your certificate is missing its intermediate, copy
and paste the root certificate (usually available from your CA website)
and paste it in the [same field as your PEM certificate](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/),
just jumping a line between them.
1. Copy your private key and paste it in the last field.
**Do not** open certificates or encryption keys in
regular text editors. Always use code editors (such as
Sublime Text, Dreamweaver, Brackets, etc).
## Force HTTPS for GitLab Pages websites
To make your website's visitors even more secure, you can choose to
force HTTPS for GitLab Pages. By doing so, all attempts to visit your
website through HTTP are automatically redirected to HTTPS through 301.
It works with both the GitLab default domain and with your custom
domain (as long as you've set a valid certificate for it).
To enable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Select the **Force HTTPS (requires valid certificates)** checkbox.
1. Select **Save changes**.
If you use Cloudflare CDN in front of GitLab Pages, make sure to set the SSL connection setting to
`full` instead of `flexible`. For more details, see the [Cloudflare CDN directions](https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes#h_4e0d1a7c-eb71-4204-9e22-9d3ef9ef7fef).
## Edit a custom domain
You can edit a custom domain to:
- View the custom domain.
- View the DNS record to add.
- View the TXT verification entry.
- Retry verification.
- Edit the certificate settings.
To edit a custom domain:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
## Delete a custom domain
After a custom domain is deleted, the domain is no longer verified in GitLab and cannot be used with GitLab Pages.
To delete and remove a custom domain:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Remove domain** ({{< icon name="remove" >}})
1. When prompted, select **Remove domain**.
## Troubleshooting
### Domain verification
To manually verify that you have properly configured the domain verification
`TXT` DNS entry, you can run the following command in your terminal:
```shell
dig _gitlab-pages-verification-code.<YOUR-PAGES-DOMAIN> TXT
```
Expect the output:
```plaintext
;; ANSWER SECTION:
_gitlab-pages-verification-code.<YOUR-PAGES-DOMAIN>. 300 IN TXT "gitlab-pages-verification-code=<YOUR-VERIFICATION-CODE>"
```
In some cases it can help to add the verification code with the same domain name as you are trying to register.
For a root domain:
| From | DNS Record | To |
| ------------------------------------------------- | ---------- | ---------------------- |
| `example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
| `_gitlab-pages-verification-code.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
For a subdomain:
| From | DNS Record | To |
| ------------------------------------------------- | ---------- | ---------------------- |
| `www.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
| `_gitlab-pages-verification-code.www.example.com` | `TXT` | `gitlab-pages-verification-code=00112233445566778899aabbccddeeff` |
|
https://docs.gitlab.com/user/project/pages/lets_encrypt_integration
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/lets_encrypt_integration.md
|
2025-08-13
|
doc/user/project/pages/custom_domains_ssl_tls_certification
|
[
"doc",
"user",
"project",
"pages",
"custom_domains_ssl_tls_certification"
] |
lets_encrypt_integration.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages Let's Encrypt certificates
|
Automatic Let's Encrypt SSL certificates for GitLab Pages.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
The GitLab Pages integration with Let's Encrypt (LE) allows you
to use LE certificates for your Pages website with custom domains
without the hassle of having to issue and update them yourself;
GitLab does it for you, out-of-the-box.
[Let's Encrypt](https://letsencrypt.org) is a free, automated, and
open source Certificate Authority.
{{< alert type="warning" >}}
This feature covers only certificates for **custom domains**, not the wildcard certificate required to run
[Pages daemon](../../../../administration/pages/_index.md) (GitLab Self-Managed, Free, Premium, and Ultimate only). Wildcard
certificate generation is tracked in [this issue](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/3342).
{{< /alert >}}
## Prerequisites
Before you can enable automatic provisioning of an SSL certificate for your domain, make sure you have:
- Created a [project](../_index.md#getting-started) in GitLab
containing your website's source code.
- Acquired a domain (`example.com`) and added a [DNS entry](_index.md)
pointing it to your Pages website. The top-level domain (`.com`) must be a
[public suffix](https://publicsuffix.org/).
- [Added your domain to your Pages project](_index.md#1-add-a-custom-domain)
and verified your ownership.
- Verified your website is up and running, accessible through your custom domain.
The GitLab integration with Let's Encrypt is enabled and available on GitLab.com.
For **GitLab Self-Managed** instances, make sure your administrator has
[enabled it](../../../../administration/pages/_index.md#lets-encrypt-integration).
## Enabling Let's Encrypt integration for your custom domain
Once you've met the requirements, enable Let's Encrypt integration:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. Turn on the **Automatic certificate management using Let's Encrypt** toggle.

1. Select **Save changes**.
Once enabled, GitLab obtains a LE certificate and add it to the
associated Pages domain. GitLab also renews it automatically.
{{< alert type="note" >}}
Issuing the certificate and updating Pages configuration
**can take up to an hour**.
If you already have an SSL certificate in domain settings it
continues to work until replaced by the Let's Encrypt certificate.
{{< /alert >}}
## Troubleshooting
### Something went wrong while obtaining the Let's Encrypt certificate
If you get an error **Something went wrong while obtaining the Let's Encrypt certificate**, first, make sure that your pages site is set to "Everyone" in your project's **Settings > General > Visibility**. This allows the Let's Encrypt Servers reach your pages site. Once this is confirmed, you can try obtaining the certificate again by following these steps:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. In **Verification status**, select **Retry verification** ({{< icon name="retry" >}}).
1. If you're still getting the same error:
1. Make sure you have properly set only one `CNAME` or `A` DNS record for your domain.
1. Make sure your domain **doesn't have** an `AAAA` DNS record.
1. If you have a `CAA` DNS record for your domain or any higher level domains, make sure [it includes `letsencrypt.org`](https://letsencrypt.org/docs/caa/).
1. Make sure [your domain is verified](_index.md#1-add-a-custom-domain).
1. Go to step 1.
### Obtaining a certificate hangs for more than an hour
If you've enabled Let's Encrypt integration, but a certificate is absent after an hour and you see the message:
```plaintext
GitLab is obtaining a Let's Encrypt SSL certificate for this domain.
This process can take some time. Please try again later.
```
Remove and add the domain for GitLab Pages again by following these steps:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Remove**.
1. [Add the domain again, and verify it](_index.md#1-add-a-custom-domain).
1. [Enable Let's Encrypt integration for your domain](#enabling-lets-encrypt-integration-for-your-custom-domain).
1. If you're still getting the same error:
1. Make sure you have properly set only one `CNAME` or `A` DNS record for your domain.
1. Make sure your domain **doesn't have** an `AAAA` DNS record.
1. If you have a `CAA` DNS record for your domain or any higher level domains, make sure [it includes `letsencrypt.org`](https://letsencrypt.org/docs/caa/).
1. Go to step 1.
<!-- 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, for example, `### 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. -->
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Automatic Let's Encrypt SSL certificates for GitLab Pages.
title: GitLab Pages Let's Encrypt certificates
breadcrumbs:
- doc
- user
- project
- pages
- custom_domains_ssl_tls_certification
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
The GitLab Pages integration with Let's Encrypt (LE) allows you
to use LE certificates for your Pages website with custom domains
without the hassle of having to issue and update them yourself;
GitLab does it for you, out-of-the-box.
[Let's Encrypt](https://letsencrypt.org) is a free, automated, and
open source Certificate Authority.
{{< alert type="warning" >}}
This feature covers only certificates for **custom domains**, not the wildcard certificate required to run
[Pages daemon](../../../../administration/pages/_index.md) (GitLab Self-Managed, Free, Premium, and Ultimate only). Wildcard
certificate generation is tracked in [this issue](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/3342).
{{< /alert >}}
## Prerequisites
Before you can enable automatic provisioning of an SSL certificate for your domain, make sure you have:
- Created a [project](../_index.md#getting-started) in GitLab
containing your website's source code.
- Acquired a domain (`example.com`) and added a [DNS entry](_index.md)
pointing it to your Pages website. The top-level domain (`.com`) must be a
[public suffix](https://publicsuffix.org/).
- [Added your domain to your Pages project](_index.md#1-add-a-custom-domain)
and verified your ownership.
- Verified your website is up and running, accessible through your custom domain.
The GitLab integration with Let's Encrypt is enabled and available on GitLab.com.
For **GitLab Self-Managed** instances, make sure your administrator has
[enabled it](../../../../administration/pages/_index.md#lets-encrypt-integration).
## Enabling Let's Encrypt integration for your custom domain
Once you've met the requirements, enable Let's Encrypt integration:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. Turn on the **Automatic certificate management using Let's Encrypt** toggle.

1. Select **Save changes**.
Once enabled, GitLab obtains a LE certificate and add it to the
associated Pages domain. GitLab also renews it automatically.
{{< alert type="note" >}}
Issuing the certificate and updating Pages configuration
**can take up to an hour**.
If you already have an SSL certificate in domain settings it
continues to work until replaced by the Let's Encrypt certificate.
{{< /alert >}}
## Troubleshooting
### Something went wrong while obtaining the Let's Encrypt certificate
If you get an error **Something went wrong while obtaining the Let's Encrypt certificate**, first, make sure that your pages site is set to "Everyone" in your project's **Settings > General > Visibility**. This allows the Let's Encrypt Servers reach your pages site. Once this is confirmed, you can try obtaining the certificate again by following these steps:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Edit** ({{< icon name="pencil" >}}).
1. In **Verification status**, select **Retry verification** ({{< icon name="retry" >}}).
1. If you're still getting the same error:
1. Make sure you have properly set only one `CNAME` or `A` DNS record for your domain.
1. Make sure your domain **doesn't have** an `AAAA` DNS record.
1. If you have a `CAA` DNS record for your domain or any higher level domains, make sure [it includes `letsencrypt.org`](https://letsencrypt.org/docs/caa/).
1. Make sure [your domain is verified](_index.md#1-add-a-custom-domain).
1. Go to step 1.
### Obtaining a certificate hangs for more than an hour
If you've enabled Let's Encrypt integration, but a certificate is absent after an hour and you see the message:
```plaintext
GitLab is obtaining a Let's Encrypt SSL certificate for this domain.
This process can take some time. Please try again later.
```
Remove and add the domain for GitLab Pages again by following these steps:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
1. Next to the domain name, select **Remove**.
1. [Add the domain again, and verify it](_index.md#1-add-a-custom-domain).
1. [Enable Let's Encrypt integration for your domain](#enabling-lets-encrypt-integration-for-your-custom-domain).
1. If you're still getting the same error:
1. Make sure you have properly set only one `CNAME` or `A` DNS record for your domain.
1. Make sure your domain **doesn't have** an `AAAA` DNS record.
1. If you have a `CAA` DNS record for your domain or any higher level domains, make sure [it includes `letsencrypt.org`](https://letsencrypt.org/docs/caa/).
1. Go to step 1.
<!-- 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, for example, `### 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. -->
|
https://docs.gitlab.com/user/project/pages/dns_concepts
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/dns_concepts.md
|
2025-08-13
|
doc/user/project/pages/custom_domains_ssl_tls_certification
|
[
"doc",
"user",
"project",
"pages",
"custom_domains_ssl_tls_certification"
] |
dns_concepts.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages DNS records
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
A Domain Name System (DNS) web service routes visitors to websites
by translating domain names (such as `www.example.com`) into the
numeric IP addresses (such as `192.0.2.1`) that computers use to
connect to each other.
A DNS record is created to point a (sub)domain to a certain location,
which can be an IP address or another domain. In case you want to use
GitLab Pages with your own (sub)domain, you need to access your domain's
registrar control panel to add a DNS record pointing it back to your
GitLab Pages site.
How to add DNS records depends on which server your domain
is hosted on. Every control panel has its own place to do it. If you are
not an administrator of your domain, and don't have access to your registrar,
you must ask the technical support of your hosting service
to do it for you.
To help you out, we've gathered some instructions on how to do that
for the most popular hosting services:
<!-- vale gitlab_base.Spelling = NO -->
- [123-reg](https://www.123-reg.co.uk/support/domains/domain-name-server-dns-management-guide/)
- [Amazon](https://docs.aws.amazon.com/AmazonS3/latest/userguide/website-hosting-custom-domain-walkthrough.html)
- [Bluehost](https://www.bluehost.com/help/article/dns-management-add-edit-or-delete-dns-entries)
- [Cloudflare](https://developers.cloudflare.com/fundamentals/setup/)
- [cPanel](https://docs.cpanel.net/cpanel/domains/zone-editor/)
- [DigitalOcean](https://docs.digitalocean.com/products/networking/dns/how-to/manage-records/)
- [DreamHost](https://help.dreamhost.com/hc/en-us/articles/360035516812)
- [Gandi](https://docs.gandi.net/en/domain_names/faq/dns_records.html)
- [Go Daddy](https://www.godaddy.com/help/add-an-a-record-19238)
- [Hostgator](https://www.hostgator.com/help/article/changing-dns-records)
- [Inmotion hosting](https://www.inmotionhosting.com/support/edu/cpanel/how-do-i-make-custom-dns-records/)
- [Microsoft](https://learn.microsoft.com/en-us/windows-server/networking/dns/manage-resource-records?tabs=powershell)
- [Namecheap](https://www.namecheap.com/support/knowledgebase/subcategory/2237/host-records-setup/)
<!-- vale gitlab_base.Spelling = YES -->
If your hosting service is not listed, you can just try to
search the web for `how to add dns record on <my hosting service>`.
## `A` record
A DNS `A` record maps a host to an IPv4 IP address.
It points a root domain as `example.com` to the host's IP address as
`192.0.2.1`.
Example:
- `example.com` => `A` => `192.0.2.1`
## `AAAA` record
A DNS `AAAA` record maps a host to an IPv6 IP address.
It points a root domain as `example.com` to the host's IP address as
`2001:db8::1`.
Example:
- `example.com` => `AAAA` => `2001:db8::1`
## `CNAME` record
`CNAME` records define an alias for canonical name for your server (one defined
by an `A` record). It points a subdomain to another domain.
Example:
- `www` => `CNAME` => `example.com`
This way, visitors visiting `www.example.com` are redirected to
`example.com`.
## `MX` record
MX records are used to define the mail exchanges that are used for the domain.
This helps email messages arrive at your mail server correctly.
Example:
- `MX` => `mail.example.com`
Then you can register emails for `users@mail.example.com`.
## `TXT` record
A `TXT` record can associate arbitrary text with a host or other name. A common
use is for site verification.
Example:
- `example.com`=> `TXT` => `"google-site-verification=6P08Ow5E-8Q0m6vQ7FMAqAYIDprkVV8fUf_7hZ4Qvc8"`
This way, you can verify the ownership for that domain name.
## All combined
You can have one DNS record or more than one combined:
- `example.com` => `A` => `192.0.2.1`
- `example.com` => `AAAA` => `2001:db8::1`
- `www` => `CNAME` => `example.com`
- `MX` => `mail.example.com`
- `example.com`=> `TXT` => `"google-site-verification=6P08Ow5E-8Q0m6vQ7FMAqAYIDprkVV8fUf_7hZ4Qvc8"`
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages DNS records
breadcrumbs:
- doc
- user
- project
- pages
- custom_domains_ssl_tls_certification
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
A Domain Name System (DNS) web service routes visitors to websites
by translating domain names (such as `www.example.com`) into the
numeric IP addresses (such as `192.0.2.1`) that computers use to
connect to each other.
A DNS record is created to point a (sub)domain to a certain location,
which can be an IP address or another domain. In case you want to use
GitLab Pages with your own (sub)domain, you need to access your domain's
registrar control panel to add a DNS record pointing it back to your
GitLab Pages site.
How to add DNS records depends on which server your domain
is hosted on. Every control panel has its own place to do it. If you are
not an administrator of your domain, and don't have access to your registrar,
you must ask the technical support of your hosting service
to do it for you.
To help you out, we've gathered some instructions on how to do that
for the most popular hosting services:
<!-- vale gitlab_base.Spelling = NO -->
- [123-reg](https://www.123-reg.co.uk/support/domains/domain-name-server-dns-management-guide/)
- [Amazon](https://docs.aws.amazon.com/AmazonS3/latest/userguide/website-hosting-custom-domain-walkthrough.html)
- [Bluehost](https://www.bluehost.com/help/article/dns-management-add-edit-or-delete-dns-entries)
- [Cloudflare](https://developers.cloudflare.com/fundamentals/setup/)
- [cPanel](https://docs.cpanel.net/cpanel/domains/zone-editor/)
- [DigitalOcean](https://docs.digitalocean.com/products/networking/dns/how-to/manage-records/)
- [DreamHost](https://help.dreamhost.com/hc/en-us/articles/360035516812)
- [Gandi](https://docs.gandi.net/en/domain_names/faq/dns_records.html)
- [Go Daddy](https://www.godaddy.com/help/add-an-a-record-19238)
- [Hostgator](https://www.hostgator.com/help/article/changing-dns-records)
- [Inmotion hosting](https://www.inmotionhosting.com/support/edu/cpanel/how-do-i-make-custom-dns-records/)
- [Microsoft](https://learn.microsoft.com/en-us/windows-server/networking/dns/manage-resource-records?tabs=powershell)
- [Namecheap](https://www.namecheap.com/support/knowledgebase/subcategory/2237/host-records-setup/)
<!-- vale gitlab_base.Spelling = YES -->
If your hosting service is not listed, you can just try to
search the web for `how to add dns record on <my hosting service>`.
## `A` record
A DNS `A` record maps a host to an IPv4 IP address.
It points a root domain as `example.com` to the host's IP address as
`192.0.2.1`.
Example:
- `example.com` => `A` => `192.0.2.1`
## `AAAA` record
A DNS `AAAA` record maps a host to an IPv6 IP address.
It points a root domain as `example.com` to the host's IP address as
`2001:db8::1`.
Example:
- `example.com` => `AAAA` => `2001:db8::1`
## `CNAME` record
`CNAME` records define an alias for canonical name for your server (one defined
by an `A` record). It points a subdomain to another domain.
Example:
- `www` => `CNAME` => `example.com`
This way, visitors visiting `www.example.com` are redirected to
`example.com`.
## `MX` record
MX records are used to define the mail exchanges that are used for the domain.
This helps email messages arrive at your mail server correctly.
Example:
- `MX` => `mail.example.com`
Then you can register emails for `users@mail.example.com`.
## `TXT` record
A `TXT` record can associate arbitrary text with a host or other name. A common
use is for site verification.
Example:
- `example.com`=> `TXT` => `"google-site-verification=6P08Ow5E-8Q0m6vQ7FMAqAYIDprkVV8fUf_7hZ4Qvc8"`
This way, you can verify the ownership for that domain name.
## All combined
You can have one DNS record or more than one combined:
- `example.com` => `A` => `192.0.2.1`
- `example.com` => `AAAA` => `2001:db8::1`
- `www` => `CNAME` => `example.com`
- `MX` => `mail.example.com`
- `example.com`=> `TXT` => `"google-site-verification=6P08Ow5E-8Q0m6vQ7FMAqAYIDprkVV8fUf_7hZ4Qvc8"`
|
https://docs.gitlab.com/user/project/pages/ssl_tls_concepts
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/ssl_tls_concepts.md
|
2025-08-13
|
doc/user/project/pages/custom_domains_ssl_tls_certification
|
[
"doc",
"user",
"project",
"pages",
"custom_domains_ssl_tls_certification"
] |
ssl_tls_concepts.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Pages SSL/TLS certificates
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
Every GitLab Pages project on GitLab.com is available under
HTTPS for the default Pages domain (`*.gitlab.io`). Once you set
up your Pages project with your custom (sub)domain, if you want
it secured by HTTPS, you must issue a certificate for that
(sub)domain and install it on your project.
{{< alert type="note" >}}
Certificates are **not** required to add to your custom
(sub)domain on your GitLab Pages project, though they are
highly recommendable.
{{< /alert >}}
Let's start with an introduction to the importance of HTTPS.
## Why should you care about HTTPS?
This might be your first question. If our sites are hosted by GitLab Pages,
they are static, hence we are not dealing with server-side scripts
nor credit card transactions, then why do we need secure connections?
When HTTPS came out in 1990, [SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0.2C_2.0_and_3.0) was considered a "special"
security measure, necessary just for big companies like banks and shopping sites
with financial transactions.
<!-- vale gitlab_base.Spelling = NO -->
Now we have a different picture. [According to Josh Aas](https://letsencrypt.org/2015/10/29/phishing-and-malware.html), Executive Director at [Internet Security Research Group (ISRG)](https://en.wikipedia.org/wiki/Internet_Security_Research_Group):
<!-- vale gitlab_base.rulename = YES -->
> We've come to realize that HTTPS is important for almost all websites. It's important for any website that
> allows people to sign in with a password, any website that [tracks its users](https://www.washingtonpost.com/news/the-switch/wp/2013/12/10/nsa-uses-google-cookies-to-pinpoint-targets-for-hacking/)
> in any way, any website that [doesn't want its content altered](https://arstechnica.com/tech-policy/2014/09/why-comcasts-javascript-ad-injections-threaten-security-net-neutrality/),
> and for any site that offers content people might not want others to know they are consuming.
> We've also learned that any site not secured by HTTPS [can be used to attack other sites](https://krebsonsecurity.com/2015/04/dont-be-fodder-for-chinas-great-cannon/).
Therefore, the reason why certificates are so important is that they encrypt
the connection between the **client** (you, your visitors)
and the **server** (where you site lives), through a keychain of
authentications and validations.
## Organizations supporting HTTPS
There is a huge movement in favor of securing all the web. W3C fully
[supports the cause](https://w3ctag.github.io/web-https/) and explains very well
the reasons for that. Richard Barnes, a writer for Mozilla Security Blog,
suggested that [Firefox would deprecate HTTP](https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/),
and would no longer accept unsecured connections. Recently, Mozilla published a
[communication](https://blog.mozilla.org/security/2016/03/29/march-2016-ca-communication/)
reiterating the importance of HTTPS.
## Issuing Certificates
GitLab Pages accepts certificates provided in the [PEM](https://knowledge.digicert.com/quovadis) format, issued by
[Certificate Authorities](https://en.wikipedia.org/wiki/Certificate_authority) or as
[self-signed certificates](https://en.wikipedia.org/wiki/Self-signed_certificate). [Self-signed certificates are typically not used](https://www.mcafee.com/blogs/other-blogs/mcafee-labs/self-signed-certificates-secure-so-why-ban/)
for public websites for security reasons and to ensure that browsers trust your site's certificate.
There are various kinds of certificates, each one
with a certain security level. A static personal website doesn't
require the same security level as an online banking web app,
for instance.
There are some certificate authorities that
offer free certificates, aiming to make the internet more secure
to everyone. The most popular is [Let's Encrypt](https://letsencrypt.org/),
which issues certificates trusted by most of browsers, it's open
source, and free to use. See [GitLab Pages integration with Let's Encrypt](lets_encrypt_integration.md) to enable HTTPS on your custom domain.
Similarly popular are [certificates issued by Cloudflare](https://www.cloudflare.com/application-services/products/ssl/),
which also offers a [free CDN service](https://blog.cloudflare.com/cloudflares-free-cdn-and-you/).
Their certs are valid up to 15 years. See the tutorial on
[how to add a Cloudflare Certificate to your GitLab Pages website](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/).
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Pages SSL/TLS certificates
breadcrumbs:
- doc
- user
- project
- pages
- custom_domains_ssl_tls_certification
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
Every GitLab Pages project on GitLab.com is available under
HTTPS for the default Pages domain (`*.gitlab.io`). Once you set
up your Pages project with your custom (sub)domain, if you want
it secured by HTTPS, you must issue a certificate for that
(sub)domain and install it on your project.
{{< alert type="note" >}}
Certificates are **not** required to add to your custom
(sub)domain on your GitLab Pages project, though they are
highly recommendable.
{{< /alert >}}
Let's start with an introduction to the importance of HTTPS.
## Why should you care about HTTPS?
This might be your first question. If our sites are hosted by GitLab Pages,
they are static, hence we are not dealing with server-side scripts
nor credit card transactions, then why do we need secure connections?
When HTTPS came out in 1990, [SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0.2C_2.0_and_3.0) was considered a "special"
security measure, necessary just for big companies like banks and shopping sites
with financial transactions.
<!-- vale gitlab_base.Spelling = NO -->
Now we have a different picture. [According to Josh Aas](https://letsencrypt.org/2015/10/29/phishing-and-malware.html), Executive Director at [Internet Security Research Group (ISRG)](https://en.wikipedia.org/wiki/Internet_Security_Research_Group):
<!-- vale gitlab_base.rulename = YES -->
> We've come to realize that HTTPS is important for almost all websites. It's important for any website that
> allows people to sign in with a password, any website that [tracks its users](https://www.washingtonpost.com/news/the-switch/wp/2013/12/10/nsa-uses-google-cookies-to-pinpoint-targets-for-hacking/)
> in any way, any website that [doesn't want its content altered](https://arstechnica.com/tech-policy/2014/09/why-comcasts-javascript-ad-injections-threaten-security-net-neutrality/),
> and for any site that offers content people might not want others to know they are consuming.
> We've also learned that any site not secured by HTTPS [can be used to attack other sites](https://krebsonsecurity.com/2015/04/dont-be-fodder-for-chinas-great-cannon/).
Therefore, the reason why certificates are so important is that they encrypt
the connection between the **client** (you, your visitors)
and the **server** (where you site lives), through a keychain of
authentications and validations.
## Organizations supporting HTTPS
There is a huge movement in favor of securing all the web. W3C fully
[supports the cause](https://w3ctag.github.io/web-https/) and explains very well
the reasons for that. Richard Barnes, a writer for Mozilla Security Blog,
suggested that [Firefox would deprecate HTTP](https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/),
and would no longer accept unsecured connections. Recently, Mozilla published a
[communication](https://blog.mozilla.org/security/2016/03/29/march-2016-ca-communication/)
reiterating the importance of HTTPS.
## Issuing Certificates
GitLab Pages accepts certificates provided in the [PEM](https://knowledge.digicert.com/quovadis) format, issued by
[Certificate Authorities](https://en.wikipedia.org/wiki/Certificate_authority) or as
[self-signed certificates](https://en.wikipedia.org/wiki/Self-signed_certificate). [Self-signed certificates are typically not used](https://www.mcafee.com/blogs/other-blogs/mcafee-labs/self-signed-certificates-secure-so-why-ban/)
for public websites for security reasons and to ensure that browsers trust your site's certificate.
There are various kinds of certificates, each one
with a certain security level. A static personal website doesn't
require the same security level as an online banking web app,
for instance.
There are some certificate authorities that
offer free certificates, aiming to make the internet more secure
to everyone. The most popular is [Let's Encrypt](https://letsencrypt.org/),
which issues certificates trusted by most of browsers, it's open
source, and free to use. See [GitLab Pages integration with Let's Encrypt](lets_encrypt_integration.md) to enable HTTPS on your custom domain.
Similarly popular are [certificates issued by Cloudflare](https://www.cloudflare.com/application-services/products/ssl/),
which also offers a [free CDN service](https://blog.cloudflare.com/cloudflares-free-cdn-and-you/).
Their certs are valid up to 15 years. See the tutorial on
[how to add a Cloudflare Certificate to your GitLab Pages website](https://about.gitlab.com/blog/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/).
|
https://docs.gitlab.com/user/project/pages/pages_ci_cd_template
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/pages_ci_cd_template.md
|
2025-08-13
|
doc/user/project/pages/getting_started
|
[
"doc",
"user",
"project",
"pages",
"getting_started"
] |
pages_ci_cd_template.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Create a GitLab Pages website from a CI/CD template
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab provides `.gitlab-ci.yml` templates for the most popular Static Site Generators (SSGs).
You can create your own `.gitlab-ci.yml` file from one of these templates, and run
the CI/CD pipeline to generate a Pages website.
Use a `.gitlab-ci.yml` template when you have an existing project that you want to add a Pages site to.
Your GitLab repository should contain files specific to an SSG, or plain HTML. After you complete
these steps, you may have to do additional configuration for the Pages site to generate properly.
1. On the left sidebar, select **Search or go to** and find your project.
1. From the **Add** ({{< icon name="plus" >}}) dropdown list, select **New file**.
1. From the **Select a template type** dropdown list, select `.gitlab-ci.yml`.
1. From the **Apply a template** dropdown list, in the **Pages** section, select the name of your SSG.
1. In the **Commit message** box, type the commit message.
1. Select **Commit changes**.
If everything is configured correctly, the site can take approximately 30 minutes to deploy.
To view the pipeline, go to **Build > Pipelines**.
When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
For every change pushed to your repository, GitLab CI/CD runs a new pipeline
that immediately publishes your changes to the Pages site.
To view the HTML and other assets that were created for the site,
[download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts).
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Create a GitLab Pages website from a CI/CD template
breadcrumbs:
- doc
- user
- project
- pages
- getting_started
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab provides `.gitlab-ci.yml` templates for the most popular Static Site Generators (SSGs).
You can create your own `.gitlab-ci.yml` file from one of these templates, and run
the CI/CD pipeline to generate a Pages website.
Use a `.gitlab-ci.yml` template when you have an existing project that you want to add a Pages site to.
Your GitLab repository should contain files specific to an SSG, or plain HTML. After you complete
these steps, you may have to do additional configuration for the Pages site to generate properly.
1. On the left sidebar, select **Search or go to** and find your project.
1. From the **Add** ({{< icon name="plus" >}}) dropdown list, select **New file**.
1. From the **Select a template type** dropdown list, select `.gitlab-ci.yml`.
1. From the **Apply a template** dropdown list, in the **Pages** section, select the name of your SSG.
1. In the **Commit message** box, type the commit message.
1. Select **Commit changes**.
If everything is configured correctly, the site can take approximately 30 minutes to deploy.
To view the pipeline, go to **Build > Pipelines**.
When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
For every change pushed to your repository, GitLab CI/CD runs a new pipeline
that immediately publishes your changes to the Pages site.
To view the HTML and other assets that were created for the site,
[download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts).
|
https://docs.gitlab.com/user/project/pages/pages_ui
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/pages_ui.md
|
2025-08-13
|
doc/user/project/pages/getting_started
|
[
"doc",
"user",
"project",
"pages",
"getting_started"
] |
pages_ui.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Create a GitLab Pages deployment for a static site
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Create a GitLab Pages deployment to convert your static site or framework into a website hosted on GitLab.
Through a step-by-step form, GitLab:
- Generates a custom CI/CD configuration based on your project setup.
- Creates a `.gitlab-ci.yml` file configured for GitLab Pages deployments.
- Submits the changes through a merge request for your review.
- Deploys your website automatically when the merge request is committed.
This guide explains how to use the Pages UI to deploy a static site or framework-based application.
## Prerequisites
- Your app must [output files to the `public` folder](../public_folder.md). If you create
this folder during the build pipeline, you do not need to commit it to Git.
{{< alert type="warning" >}}
This step is important. Ensure your files are in a root-level `public` folder.
{{< /alert >}}
- You must have a project that either:
- Generates static sites or a client-rendered single-page application (SPA),
like [Eleventy](https://www.11ty.dev), [Astro](https://astro.build), or [Jekyll](https://jekyllrb.com).
- Contains a framework configured for static output, such as [Next.js](https://nextjs.org),
[Nuxt](https://nuxt.com), or [SvelteKit](https://kit.svelte.dev).
- GitLab Pages must be enabled for the project. (To enable, go to **Settings > General**,
expand **Visibility, project features, permissions**, and turn on the **Pages** toggle.)
## Create the Pages deployment
To complete the setup and generate a GitLab Pages deployment:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
A **Get Started with Pages** form appears. If this form is not available,
see [Troubleshooting](#if-the-get-started-with-pages-form-is-not-available).
1. For **Step 1**, enter an image name. You can also [set a custom folder to be deployed with Pages](../introduction.md#customize-the-default-folder).
1. Select **Next**.
1. For **Step 2**, enter your installation steps. If your framework's build process does not
need one of the provided build commands, you can either:
- Skip the step by selecting **Next**.
- Enter `:` (the bash "do nothing" command) if you still want to incorporate that
step's boilerplate into your `.gitlab-ci.yml` file.
1. Select **Next**.
1. For **Step 3**, enter scripts that indicate how to build your application.
1. Select **Next**.
1. Optional. Edit the generated `.gitlab-ci.yml` file as needed.
1. For **Step 4**, add a commit message and select **Commit**. This commit triggers your first
GitLab Pages deployment.
To view the running pipeline, go to **Build > Pipelines**.
To view the artifacts that were created during the deployment, view the job,
and on the right side, select **Download artifacts**.
## Troubleshooting
### If the `Get Started with Pages` form is not available
The `Get Started with Pages` form is not available if you:
- Deployed a GitLab Pages site before.
- Committed `.gitlab-ci.yml` through the forms at least one time.
To fix this issue:
- If the message **Waiting for the Pages Pipeline to complete** appears, select
**Start over** to start the form again.
- If your project has previously deployed GitLab Pages successfully,
[manually update](pages_from_scratch.md) your `.gitlab-ci.yml` file.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Create a GitLab Pages deployment for a static site
breadcrumbs:
- doc
- user
- project
- pages
- getting_started
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Create a GitLab Pages deployment to convert your static site or framework into a website hosted on GitLab.
Through a step-by-step form, GitLab:
- Generates a custom CI/CD configuration based on your project setup.
- Creates a `.gitlab-ci.yml` file configured for GitLab Pages deployments.
- Submits the changes through a merge request for your review.
- Deploys your website automatically when the merge request is committed.
This guide explains how to use the Pages UI to deploy a static site or framework-based application.
## Prerequisites
- Your app must [output files to the `public` folder](../public_folder.md). If you create
this folder during the build pipeline, you do not need to commit it to Git.
{{< alert type="warning" >}}
This step is important. Ensure your files are in a root-level `public` folder.
{{< /alert >}}
- You must have a project that either:
- Generates static sites or a client-rendered single-page application (SPA),
like [Eleventy](https://www.11ty.dev), [Astro](https://astro.build), or [Jekyll](https://jekyllrb.com).
- Contains a framework configured for static output, such as [Next.js](https://nextjs.org),
[Nuxt](https://nuxt.com), or [SvelteKit](https://kit.svelte.dev).
- GitLab Pages must be enabled for the project. (To enable, go to **Settings > General**,
expand **Visibility, project features, permissions**, and turn on the **Pages** toggle.)
## Create the Pages deployment
To complete the setup and generate a GitLab Pages deployment:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Pages**.
A **Get Started with Pages** form appears. If this form is not available,
see [Troubleshooting](#if-the-get-started-with-pages-form-is-not-available).
1. For **Step 1**, enter an image name. You can also [set a custom folder to be deployed with Pages](../introduction.md#customize-the-default-folder).
1. Select **Next**.
1. For **Step 2**, enter your installation steps. If your framework's build process does not
need one of the provided build commands, you can either:
- Skip the step by selecting **Next**.
- Enter `:` (the bash "do nothing" command) if you still want to incorporate that
step's boilerplate into your `.gitlab-ci.yml` file.
1. Select **Next**.
1. For **Step 3**, enter scripts that indicate how to build your application.
1. Select **Next**.
1. Optional. Edit the generated `.gitlab-ci.yml` file as needed.
1. For **Step 4**, add a commit message and select **Commit**. This commit triggers your first
GitLab Pages deployment.
To view the running pipeline, go to **Build > Pipelines**.
To view the artifacts that were created during the deployment, view the job,
and on the right side, select **Download artifacts**.
## Troubleshooting
### If the `Get Started with Pages` form is not available
The `Get Started with Pages` form is not available if you:
- Deployed a GitLab Pages site before.
- Committed `.gitlab-ci.yml` through the forms at least one time.
To fix this issue:
- If the message **Waiting for the Pages Pipeline to complete** appears, select
**Start over** to start the form again.
- If your project has previously deployed GitLab Pages successfully,
[manually update](pages_from_scratch.md) your `.gitlab-ci.yml` file.
|
https://docs.gitlab.com/user/project/pages/pages_from_scratch
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/pages_from_scratch.md
|
2025-08-13
|
doc/user/project/pages/getting_started
|
[
"doc",
"user",
"project",
"pages",
"getting_started"
] |
pages_from_scratch.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Tutorial: Create a GitLab Pages website from scratch
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
This tutorial shows you how to create a Pages site from scratch using
the [Jekyll](https://jekyllrb.com/) Static Site Generator (SSG). You start with
a blank project and create your own CI/CD configuration file, which gives
instructions to a [runner](https://docs.gitlab.com/runner/). When your CI/CD
[pipeline](../../../../ci/pipelines/_index.md) runs, the Pages site is created.
This example uses Jekyll, but other SSGs follow similar steps.
You do not need to be familiar with Jekyll or SSGs
to complete this tutorial.
To create a GitLab Pages website:
- [Step 1: Create the project files](#create-the-project-files)
- [Step 2: Choose a Docker image](#choose-a-docker-image)
- [Step 3: Install Jekyll](#install-jekyll)
- [Step 4: Specify the `public` directory for output](#specify-the-public-directory-for-output)
- [Step 5: Specify the `public` directory for artifacts](#specify-the-public-directory-for-artifacts)
- [Step 6: Deploy and view your website](#deploy-and-view-your-website)
## Prerequisites
You must have a [blank project](../../_index.md#create-a-blank-project) in GitLab.
## Create the project files
Create three files in the root (top-level) directory:
- `.gitlab-ci.yml`: A YAML file that contains the commands you want to run.
For now, leave the file's contents blank.
- `index.html`: A non-empty HTML file you can populate with whatever HTML content
you'd like, for example:
```html
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
```
- [`Gemfile`](https://bundler.io/gemfile.html): A file that describes dependencies for Ruby programs.
Populate it with this content:
```ruby
source "https://rubygems.org"
gem "jekyll"
```
## Choose a Docker image
In this example, the runner uses a [Docker image](../../../../ci/docker/using_docker_images.md)
to run scripts and deploy the site.
This specific Ruby image is maintained on [DockerHub](https://hub.docker.com/_/ruby).
Add a default image to your pipeline by adding this CI/CD configuration to the beginning of your `.gitlab-ci.yml` file:
```yaml
default:
image: ruby:3.2
```
If your SSG needs [NodeJS](https://nodejs.org/) to build, you must specify an
image that contains NodeJS as part of its file system. For example, for a
[Hexo](https://gitlab.com/pages/hexo) site, you can use `image: node:12.17.0`.
## Install Jekyll
To run [Jekyll](https://jekyllrb.com/) locally, you must install it:
1. Open your terminal.
1. Install [Bundler](https://bundler.io/) by running `gem install bundler`.
1. Create `Gemfile.lock` by running `bundle install`.
1. Install Jekyll by running `bundle exec jekyll build`.
To run Jekyll in your project, edit the `.gitlab-ci.yml` file
and add the installation commands:
```yaml
script:
- gem install bundler
- bundle install
- bundle exec jekyll build
```
In addition, in the `.gitlab-ci.yml` file, each `script` is organized by a `job`.
A `job` includes the scripts and settings you want to apply to that specific
task.
```yaml
job:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build
```
For GitLab Pages, this `job` has to include a property, called `pages`.
This setting tells the runner you want the job to deploy your website
with GitLab Pages:
```yaml
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build
pages: true # specifies that this is a Pages job
```
The example in this page uses [user-defined job names](../_index.md#user-defined-job-names).
## Specify the `public` directory for output
Jekyll needs to know where to generate its output.
GitLab Pages only considers files in a directory called `public`.
Jekyll uses a destination flag (`-d`) to specify an output directory for the built website.
Add the destination to your `.gitlab-ci.yml` file:
```yaml
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job
```
## Specify the `public` directory for artifacts
{{< history >}}
- Automatically appending `pages.publish` path to `artifacts:paths` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) in GitLab 17.10 for Pages jobs only.
{{< /history >}}
Now that Jekyll has output the files to the `public` directory, the runner needs to know where
to get them. In GitLab 17.10 and later, for Pages jobs only, the `public` directory is
appended automatically to [`artifacts:paths`](../../../../ci/yaml/_index.md#artifactspaths)
when the [`pages.publish`](../../../../ci/yaml/_index.md#pagespublish) path
is not explicitly specified:
```yaml
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
Your `.gitlab-ci.yml` file should now look like this:
```yaml
default:
image: ruby:3.2
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
## Deploy and view your website
After you have completed the preceding steps,
deploy your website:
1. Save and commit the `.gitlab-ci.yml` file.
1. Go to **Build > Pipelines** to watch the pipeline.
1. When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
When this `pages` job completes successfully, a special `pages:deploy` job
appears in the pipeline view. It prepares the content of the website for the
GitLab Pages daemon. GitLab runs it in the background and doesn't use a runner.
## Other options for your CI/CD file
If you want to do more advanced tasks, you can update your `.gitlab-ci.yml` file
with [other CI/CD YAML keywords](../../../../ci/yaml/_index.md). You can validate
your `.gitlab-ci.yml` file with the [CI Lint](../../../../ci/yaml/lint.md) tool that's included with GitLab.
The following topics show other examples of other options you can add to your CI/CD file.
### Deploy specific branches to a Pages site
You may want to deploy to a Pages site only from specific branches.
First, add a `workflow` section to force the pipeline to run only when changes are
pushed to branches:
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
Then configure the pipeline to run the job for the
[default branch](../../repository/branches/default.md) (here, `main`) only.
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
```
### Specify a stage to deploy
There are three default stages for GitLab CI/CD: build, test,
and deploy.
If you want to test your script and check the built site before deploying
to production, you can run the test exactly as it runs when you
push to your [default branch](../../repository/branches/default.md) (here, `main`).
To specify a stage for your job to run in,
add a `stage` line to your CI file:
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
```
Now add another job to the CI file, telling it to
test every push to every branch **except** the `main` branch:
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
test:
stage: test
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_BRANCH != "main"
```
When the `test` job runs in the `test` stage, Jekyll
builds the site in a directory called `test`. The job affects
all branches except `main`.
When you apply stages to different jobs, every job in the same
stage builds in parallel. If your web application needs more than
one test before being deployed, you can run all your tests at the
same time.
### Remove duplicate commands
To avoid duplicating the same `before_script` commands in every job, you can add them
to the default section.
In the example, `gem install bundler` and `bundle install` were running
for both jobs, `pages` and `test`.
Move these commands to the `default` section:
```yaml
default:
image: ruby:3.2
before_script:
- gem install bundler
- bundle install
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_BRANCH != "main"
```
### Build faster with cached dependencies
To build faster, you can cache the installation files for your
project's dependencies by using the `cache` parameter.
This example caches Jekyll dependencies in a `vendor` directory
when you run `bundle install`:
```yaml
default:
image: ruby:3.2
before_script:
- gem install bundler
- bundle install --path vendor
cache:
paths:
- vendor/
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_BRANCH != "main"
```
In this case, you need to exclude the `/vendor`
directory from the list of folders Jekyll builds. Otherwise, Jekyll
tries to build the directory contents along with the site.
In the root directory, create a file called `_config.yml`
and add this content:
```yaml
exclude:
- vendor
```
Now GitLab CI/CD not only builds the website, but also:
- Pushes with **continuous tests** to feature branches.
- **Caches** dependencies installed with Bundler.
- **Continuously deploys** every push to the `main` branch.
To view the HTML and other assets that were created for the site,
[download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts).
The example in this page uses [user-defined job names](../_index.md#user-defined-job-names).
## Related topics
- [Deploy your web app to staging and production](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/)
- [Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/blog/2020/12/10/basics-of-gitlab-ci-updated/)
- [Pull specific directories from different projects](https://about.gitlab.com/blog/2016/12/07/building-a-new-gitlab-docs-site-with-nanoc-gitlab-ci-and-gitlab-pages/)
- [Use GitLab Pages to produce a code coverage report](https://about.gitlab.com/blog/2016/11/03/publish-code-coverage-report-with-gitlab-pages/)
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: 'Tutorial: Create a GitLab Pages website from scratch'
breadcrumbs:
- doc
- user
- project
- pages
- getting_started
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
This tutorial shows you how to create a Pages site from scratch using
the [Jekyll](https://jekyllrb.com/) Static Site Generator (SSG). You start with
a blank project and create your own CI/CD configuration file, which gives
instructions to a [runner](https://docs.gitlab.com/runner/). When your CI/CD
[pipeline](../../../../ci/pipelines/_index.md) runs, the Pages site is created.
This example uses Jekyll, but other SSGs follow similar steps.
You do not need to be familiar with Jekyll or SSGs
to complete this tutorial.
To create a GitLab Pages website:
- [Step 1: Create the project files](#create-the-project-files)
- [Step 2: Choose a Docker image](#choose-a-docker-image)
- [Step 3: Install Jekyll](#install-jekyll)
- [Step 4: Specify the `public` directory for output](#specify-the-public-directory-for-output)
- [Step 5: Specify the `public` directory for artifacts](#specify-the-public-directory-for-artifacts)
- [Step 6: Deploy and view your website](#deploy-and-view-your-website)
## Prerequisites
You must have a [blank project](../../_index.md#create-a-blank-project) in GitLab.
## Create the project files
Create three files in the root (top-level) directory:
- `.gitlab-ci.yml`: A YAML file that contains the commands you want to run.
For now, leave the file's contents blank.
- `index.html`: A non-empty HTML file you can populate with whatever HTML content
you'd like, for example:
```html
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
```
- [`Gemfile`](https://bundler.io/gemfile.html): A file that describes dependencies for Ruby programs.
Populate it with this content:
```ruby
source "https://rubygems.org"
gem "jekyll"
```
## Choose a Docker image
In this example, the runner uses a [Docker image](../../../../ci/docker/using_docker_images.md)
to run scripts and deploy the site.
This specific Ruby image is maintained on [DockerHub](https://hub.docker.com/_/ruby).
Add a default image to your pipeline by adding this CI/CD configuration to the beginning of your `.gitlab-ci.yml` file:
```yaml
default:
image: ruby:3.2
```
If your SSG needs [NodeJS](https://nodejs.org/) to build, you must specify an
image that contains NodeJS as part of its file system. For example, for a
[Hexo](https://gitlab.com/pages/hexo) site, you can use `image: node:12.17.0`.
## Install Jekyll
To run [Jekyll](https://jekyllrb.com/) locally, you must install it:
1. Open your terminal.
1. Install [Bundler](https://bundler.io/) by running `gem install bundler`.
1. Create `Gemfile.lock` by running `bundle install`.
1. Install Jekyll by running `bundle exec jekyll build`.
To run Jekyll in your project, edit the `.gitlab-ci.yml` file
and add the installation commands:
```yaml
script:
- gem install bundler
- bundle install
- bundle exec jekyll build
```
In addition, in the `.gitlab-ci.yml` file, each `script` is organized by a `job`.
A `job` includes the scripts and settings you want to apply to that specific
task.
```yaml
job:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build
```
For GitLab Pages, this `job` has to include a property, called `pages`.
This setting tells the runner you want the job to deploy your website
with GitLab Pages:
```yaml
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build
pages: true # specifies that this is a Pages job
```
The example in this page uses [user-defined job names](../_index.md#user-defined-job-names).
## Specify the `public` directory for output
Jekyll needs to know where to generate its output.
GitLab Pages only considers files in a directory called `public`.
Jekyll uses a destination flag (`-d`) to specify an output directory for the built website.
Add the destination to your `.gitlab-ci.yml` file:
```yaml
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job
```
## Specify the `public` directory for artifacts
{{< history >}}
- Automatically appending `pages.publish` path to `artifacts:paths` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/428018) in GitLab 17.10 for Pages jobs only.
{{< /history >}}
Now that Jekyll has output the files to the `public` directory, the runner needs to know where
to get them. In GitLab 17.10 and later, for Pages jobs only, the `public` directory is
appended automatically to [`artifacts:paths`](../../../../ci/yaml/_index.md#artifactspaths)
when the [`pages.publish`](../../../../ci/yaml/_index.md#pagespublish) path
is not explicitly specified:
```yaml
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
Your `.gitlab-ci.yml` file should now look like this:
```yaml
default:
image: ruby:3.2
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
## Deploy and view your website
After you have completed the preceding steps,
deploy your website:
1. Save and commit the `.gitlab-ci.yml` file.
1. Go to **Build > Pipelines** to watch the pipeline.
1. When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
When this `pages` job completes successfully, a special `pages:deploy` job
appears in the pipeline view. It prepares the content of the website for the
GitLab Pages daemon. GitLab runs it in the background and doesn't use a runner.
## Other options for your CI/CD file
If you want to do more advanced tasks, you can update your `.gitlab-ci.yml` file
with [other CI/CD YAML keywords](../../../../ci/yaml/_index.md). You can validate
your `.gitlab-ci.yml` file with the [CI Lint](../../../../ci/yaml/lint.md) tool that's included with GitLab.
The following topics show other examples of other options you can add to your CI/CD file.
### Deploy specific branches to a Pages site
You may want to deploy to a Pages site only from specific branches.
First, add a `workflow` section to force the pipeline to run only when changes are
pushed to branches:
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
```
Then configure the pipeline to run the job for the
[default branch](../../repository/branches/default.md) (here, `main`) only.
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
```
### Specify a stage to deploy
There are three default stages for GitLab CI/CD: build, test,
and deploy.
If you want to test your script and check the built site before deploying
to production, you can run the test exactly as it runs when you
push to your [default branch](../../repository/branches/default.md) (here, `main`).
To specify a stage for your job to run in,
add a `stage` line to your CI file:
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
```
Now add another job to the CI file, telling it to
test every push to every branch **except** the `main` branch:
```yaml
default:
image: ruby:3.2
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
test:
stage: test
script:
- gem install bundler
- bundle install
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_BRANCH != "main"
```
When the `test` job runs in the `test` stage, Jekyll
builds the site in a directory called `test`. The job affects
all branches except `main`.
When you apply stages to different jobs, every job in the same
stage builds in parallel. If your web application needs more than
one test before being deployed, you can run all your tests at the
same time.
### Remove duplicate commands
To avoid duplicating the same `before_script` commands in every job, you can add them
to the default section.
In the example, `gem install bundler` and `bundle install` were running
for both jobs, `pages` and `test`.
Move these commands to the `default` section:
```yaml
default:
image: ruby:3.2
before_script:
- gem install bundler
- bundle install
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_BRANCH != "main"
```
### Build faster with cached dependencies
To build faster, you can cache the installation files for your
project's dependencies by using the `cache` parameter.
This example caches Jekyll dependencies in a `vendor` directory
when you run `bundle install`:
```yaml
default:
image: ruby:3.2
before_script:
- gem install bundler
- bundle install --path vendor
cache:
paths:
- vendor/
workflow:
rules:
- if: $CI_COMMIT_BRANCH
create-pages:
stage: deploy
script:
- bundle exec jekyll build -d public
pages: true # specifies that this is a Pages job and publishes the default public directory
rules:
- if: $CI_COMMIT_BRANCH == "main"
environment: production
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_BRANCH != "main"
```
In this case, you need to exclude the `/vendor`
directory from the list of folders Jekyll builds. Otherwise, Jekyll
tries to build the directory contents along with the site.
In the root directory, create a file called `_config.yml`
and add this content:
```yaml
exclude:
- vendor
```
Now GitLab CI/CD not only builds the website, but also:
- Pushes with **continuous tests** to feature branches.
- **Caches** dependencies installed with Bundler.
- **Continuously deploys** every push to the `main` branch.
To view the HTML and other assets that were created for the site,
[download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts).
The example in this page uses [user-defined job names](../_index.md#user-defined-job-names).
## Related topics
- [Deploy your web app to staging and production](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/)
- [Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/blog/2020/12/10/basics-of-gitlab-ci-updated/)
- [Pull specific directories from different projects](https://about.gitlab.com/blog/2016/12/07/building-a-new-gitlab-docs-site-with-nanoc-gitlab-ci-and-gitlab-pages/)
- [Use GitLab Pages to produce a code coverage report](https://about.gitlab.com/blog/2016/11/03/publish-code-coverage-report-with-gitlab-pages/)
|
https://docs.gitlab.com/user/project/pages/pages_forked_sample_project
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/pages_forked_sample_project.md
|
2025-08-13
|
doc/user/project/pages/getting_started
|
[
"doc",
"user",
"project",
"pages",
"getting_started"
] |
pages_forked_sample_project.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Create a GitLab Pages website from a forked sample project
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab provides [sample projects for the most popular Static Site Generators (SSG)](https://gitlab.com/pages).
You can fork one of the sample projects and run the CI/CD pipeline to generate a Pages website.
Fork a sample project when you want to test GitLab Pages or start a new project that's already
configured to generate a Pages site.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=TWqh9MtT4Bg) of how this works.
To fork a sample project and create a Pages website:
1. View the sample projects by navigating to the [GitLab Pages examples](https://gitlab.com/pages) group.
1. Select the name of the project you want to [fork](../../repository/forking_workflow.md#create-a-fork).
1. In the upper-right corner, select **Fork**, then choose a namespace to fork to.
1. For your project, on the left sidebar, select **Build > Pipelines** and then **New pipeline**.
GitLab CI/CD builds and deploys your site.
The site can take approximately 30 minutes to deploy.
When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
For every change pushed to your repository, GitLab CI/CD runs a new pipeline
that immediately publishes your changes to the Pages site.
## Remove the fork relationship
If you want to contribute to the project you forked from,
you can keep the forked relationship. Otherwise:
1. On the left sidebar, select **Settings > General**.
1. Expand **Advanced settings**.
1. Select **Remove fork relationship**.
## Change the URL
You can change the URL to match your namespace.
If your Pages site is hosted on GitLab.com,
you can rename it to `<namespace>.gitlab.io`, where `<namespace>` is your GitLab namespace
(the one you chose when you forked the project).
1. On the left sidebar, select **Settings > General**.
1. Expand **Advanced**.
1. In **Change path**, update the path to `<namespace>.gitlab.io`.
For example, if your project's URL is `gitlab.com/gitlab-tests/jekyll`, your namespace is
`gitlab-tests`.
If you set the repository path to `gitlab-tests.gitlab.io`,
the resulting URL for your Pages website is `https://gitlab-tests.gitlab.io`.

1. Open your SSG configuration file and change the [base URL](../getting_started_part_one.md#urls-and-base-urls)
from `"project-name"` to `""`. The project name setting varies by SSG and may not be in the configuration file.
## Related topics
- [Download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts)
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Create a GitLab Pages website from a forked sample project
breadcrumbs:
- doc
- user
- project
- pages
- getting_started
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab provides [sample projects for the most popular Static Site Generators (SSG)](https://gitlab.com/pages).
You can fork one of the sample projects and run the CI/CD pipeline to generate a Pages website.
Fork a sample project when you want to test GitLab Pages or start a new project that's already
configured to generate a Pages site.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=TWqh9MtT4Bg) of how this works.
To fork a sample project and create a Pages website:
1. View the sample projects by navigating to the [GitLab Pages examples](https://gitlab.com/pages) group.
1. Select the name of the project you want to [fork](../../repository/forking_workflow.md#create-a-fork).
1. In the upper-right corner, select **Fork**, then choose a namespace to fork to.
1. For your project, on the left sidebar, select **Build > Pipelines** and then **New pipeline**.
GitLab CI/CD builds and deploys your site.
The site can take approximately 30 minutes to deploy.
When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
For every change pushed to your repository, GitLab CI/CD runs a new pipeline
that immediately publishes your changes to the Pages site.
## Remove the fork relationship
If you want to contribute to the project you forked from,
you can keep the forked relationship. Otherwise:
1. On the left sidebar, select **Settings > General**.
1. Expand **Advanced settings**.
1. Select **Remove fork relationship**.
## Change the URL
You can change the URL to match your namespace.
If your Pages site is hosted on GitLab.com,
you can rename it to `<namespace>.gitlab.io`, where `<namespace>` is your GitLab namespace
(the one you chose when you forked the project).
1. On the left sidebar, select **Settings > General**.
1. Expand **Advanced**.
1. In **Change path**, update the path to `<namespace>.gitlab.io`.
For example, if your project's URL is `gitlab.com/gitlab-tests/jekyll`, your namespace is
`gitlab-tests`.
If you set the repository path to `gitlab-tests.gitlab.io`,
the resulting URL for your Pages website is `https://gitlab-tests.gitlab.io`.

1. Open your SSG configuration file and change the [base URL](../getting_started_part_one.md#urls-and-base-urls)
from `"project-name"` to `""`. The project name setting varies by SSG and may not be in the configuration file.
## Related topics
- [Download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts)
|
https://docs.gitlab.com/user/project/pages/pages_new_project_template
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/pages/pages_new_project_template.md
|
2025-08-13
|
doc/user/project/pages/getting_started
|
[
"doc",
"user",
"project",
"pages",
"getting_started"
] |
pages_new_project_template.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Create a GitLab Pages website from a project template
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab provides templates for the most popular Static Site Generators (SSGs).
You can create a new project from a template and run the CI/CD pipeline to generate a Pages website.
Use a template when you want to test GitLab Pages or start a new project that's already
configured to generate a Pages site.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from Template**.
1. Next to one of the templates starting with **Pages**, select **Use template**.
1. Complete the form and select **Create project**.
1. On the left sidebar, select **Build > Pipelines**
and select **New pipeline** to trigger GitLab CI/CD to build and deploy your
site.
When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
For every change pushed to your repository, GitLab CI/CD runs a new pipeline
that immediately publishes your changes to the Pages site.
To view the HTML and other assets that were created for the site,
[download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts).
## Project templates
{{< history >}}
- [Removed](https://gitlab.com/groups/gitlab-org/-/epics/13847) the following templates from
project templates in GitLab 18.0:
[`Bridgetown`](https://gitlab.com/pages/bridgetown), [`Gatsby`](https://gitlab.com/pages/gatsby),
[`Hexo`](https://gitlab.com/pages/hexo), [`Middleman`](https://gitlab.com/pages/middleman),
`Netlify/GitBook`, [`Netlify/Hexo`](https://gitlab.com/pages/nfhexo),
[`Netlify/Hugo`](https://gitlab.com/pages/nfhugo), [`Netlify/Jekyll`](https://gitlab.com/pages/nfjekyll),
[`Netlify/Plain HTML`](https://gitlab.com/pages/nfplain-html), and [`Pelican`](https://gitlab.com/pages/pelican).
{{< /history >}}
GitLab maintains template projects for these frameworks:
| Realm | Framework | Available project templates |
|----------------|-----------------------------------------------------|-----------------------------|
| **Go** | [`hugo`](https://gitlab.com/pages/hugo) | Pages/Hugo |
| **Markdown** | [`astro`](https://gitlab.com/pages/astro) | Pages/Astro |
| **Markdown** | [`docusaurus`](https://gitlab.com/pages/docusaurus) | Pages/Docusaurus |
| **Plain HTML** | [`plain-html`](https://gitlab.com/pages/plain-html) | Pages/Plain HTML |
| **React** | [`next.js`](https://gitlab.com/pages/nextjs) | Pages/Next.js |
| **Ruby** | [`jekyll`](https://gitlab.com/pages/jekyll) | Pages/Jekyll |
| **Vue.js** | [`nuxt`](https://gitlab.com/pages/nuxt) | Pages/Nuxt |
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Create a GitLab Pages website from a project template
breadcrumbs:
- doc
- user
- project
- pages
- getting_started
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab provides templates for the most popular Static Site Generators (SSGs).
You can create a new project from a template and run the CI/CD pipeline to generate a Pages website.
Use a template when you want to test GitLab Pages or start a new project that's already
configured to generate a Pages site.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from Template**.
1. Next to one of the templates starting with **Pages**, select **Use template**.
1. Complete the form and select **Create project**.
1. On the left sidebar, select **Build > Pipelines**
and select **New pipeline** to trigger GitLab CI/CD to build and deploy your
site.
When the pipeline is finished, go to **Deploy > Pages** to find the link to
your Pages website.
For every change pushed to your repository, GitLab CI/CD runs a new pipeline
that immediately publishes your changes to the Pages site.
To view the HTML and other assets that were created for the site,
[download the job artifacts](../../../../ci/jobs/job_artifacts.md#download-job-artifacts).
## Project templates
{{< history >}}
- [Removed](https://gitlab.com/groups/gitlab-org/-/epics/13847) the following templates from
project templates in GitLab 18.0:
[`Bridgetown`](https://gitlab.com/pages/bridgetown), [`Gatsby`](https://gitlab.com/pages/gatsby),
[`Hexo`](https://gitlab.com/pages/hexo), [`Middleman`](https://gitlab.com/pages/middleman),
`Netlify/GitBook`, [`Netlify/Hexo`](https://gitlab.com/pages/nfhexo),
[`Netlify/Hugo`](https://gitlab.com/pages/nfhugo), [`Netlify/Jekyll`](https://gitlab.com/pages/nfjekyll),
[`Netlify/Plain HTML`](https://gitlab.com/pages/nfplain-html), and [`Pelican`](https://gitlab.com/pages/pelican).
{{< /history >}}
GitLab maintains template projects for these frameworks:
| Realm | Framework | Available project templates |
|----------------|-----------------------------------------------------|-----------------------------|
| **Go** | [`hugo`](https://gitlab.com/pages/hugo) | Pages/Hugo |
| **Markdown** | [`astro`](https://gitlab.com/pages/astro) | Pages/Astro |
| **Markdown** | [`docusaurus`](https://gitlab.com/pages/docusaurus) | Pages/Docusaurus |
| **Plain HTML** | [`plain-html`](https://gitlab.com/pages/plain-html) | Pages/Plain HTML |
| **React** | [`next.js`](https://gitlab.com/pages/nextjs) | Pages/Next.js |
| **Ruby** | [`jekyll`](https://gitlab.com/pages/jekyll) | Pages/Jekyll |
| **Vue.js** | [`nuxt`](https://gitlab.com/pages/nuxt) | Pages/Nuxt |
|
https://docs.gitlab.com/user/project/deploy_tokens
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/deploy_tokens
|
[
"doc",
"user",
"project",
"deploy_tokens"
] |
_index.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Deploy tokens
|
Repository cloning, token creation, and container registry.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Deploy tokens provide secure access to GitLab resources without tying permissions to individual user accounts. Use them with Git operations, container registries, and package registries, giving your deployment
automation access to exactly what it needs.
With deploy tokens, you have:
- More secure deployments by removing personal credentials from automation systems
- Fine-grained access control with specific permissions for each token
- Simplified CI/CD pipelines with built-in authentication variables
- Reliable deployment processes that won't break when team members change
- Better audit trails by tracking deployments through dedicated token identities
- Seamless integration with external build systems and deployment tools
A deploy token is a pair of values:
- **username**: `username` in the HTTP authentication framework. The default username format is
`gitlab+deploy-token-{n}`. You can specify a custom username when you create the deploy token.
- **token**: `password` in the HTTP authentication framework.
Deploy tokens do not support [SSH authentication](../../ssh.md).
You can use a deploy token for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)
to the following endpoints:
- GitLab package registry public API.
- [Git commands](https://git-scm.com/docs/gitcredentials#_description).
- [GitLab virtual registry package operations](../../../api/maven_virtual_registries.md#manage-package-operations).
You can create deploy tokens at either the project or group level:
- **Project deploy token**: Permissions apply only to the project.
- **Group deploy token**: Permissions apply to all projects in the group.
By default, a deploy token does not expire. You can optionally set an expiry date when you create
it. Expiry occurs at midnight UTC on that date.
{{< alert type="warning" >}}
You cannot use new or existing deploy tokens for Git operations and package registry operations if
[external authorization](../../../administration/settings/external_authorization.md) is enabled.
{{< /alert >}}
## Scope
A deploy token's scope determines the actions it can perform.
| Scope | Description |
|--------------------------|--------------------------------------------------------------------------------------------------------------|
| `read_repository` | Read-only access to the repository using `git clone`. |
| `read_registry` | Read-only access to the images in the project's [container registry](../../packages/container_registry/_index.md). |
| `write_registry` | Write access (push) to the project's [container registry](../../packages/container_registry/_index.md). You need both read and write access to push images. |
| `read_virtual_registry` | If a project is private and authorization is required, grants read-only (pull) access to container images through the [dependency proxy](../../packages/dependency_proxy/_index.md). Available only when the dependency proxy is enabled. |
| `write_virtual_registry` | If a project is private and authorization is required, grants read (pull), write (push), and delete access to container images through the [dependency proxy](../../packages/dependency_proxy/_index.md). Available only when the dependency proxy is enabled. |
| `read_package_registry` | Read-only access to the project's package registry. |
| `write_package_registry` | Write access to the project's package registry. |
## GitLab deploy token
{{< history >}}
- Support for `gitlab-deploy-token` at the group level [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214014) in GitLab 15.1 [with a flag](../../../administration/feature_flags/_index.md) named `ci_variable_for_group_gitlab_deploy_token`. Enabled by default.
- [Feature flag `ci_variable_for_group_gitlab_deploy_token`](https://gitlab.com/gitlab-org/gitlab/-/issues/363621) removed in GitLab 15.4.
{{< /history >}}
A GitLab deploy token is a special type of deploy token. If you create a deploy token named
`gitlab-deploy-token`, the deploy token is automatically exposed to project CI/CD jobs as variables:
- `CI_DEPLOY_USER`: Username
- `CI_DEPLOY_PASSWORD`: Token
For example, to use a GitLab token to sign in to your GitLab container registry:
```shell
echo "$CI_DEPLOY_PASSWORD" | docker login $CI_REGISTRY -u $CI_DEPLOY_USER --password-stdin
```
{{< alert type="note" >}}
In GitLab 15.0 and earlier, the special handling for the `gitlab-deploy-token` deploy token does not
work for group deploy tokens. To make a group deploy token available for CI/CD jobs, set the
`CI_DEPLOY_USER` and `CI_DEPLOY_PASSWORD` CI/CD variables in **Settings > CI/CD > Variables** to the
name and token of the group deploy token.
{{< /alert >}}
When `gitlab-deploy-token` is defined in a group, the `CI_DEPLOY_USER` and `CI_DEPLOY_PASSWORD`
CI/CD variables are available only to immediate child projects of the group.
## Deploy token expiration
{{< history >}}
- Email notifications for deploy token expiration [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/512197) in GitLab 18.3 [with a flag](../../../administration/feature_flags/_index.md) named `project_deploy_token_expiring_notifications`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Deploy tokens expire on the date you define at 00:00 AM UTC.
GitLab checks every day at 01:00 AM UTC for deploy tokens that are about to expire.
Project owners and maintainers are notified by email 60, 30, and 7 days before these tokens expire.
These email notifications are sent only once per interval for active (non-revoked) deploy tokens.
### GitLab deploy token security
GitLab deploy tokens are long-lived, making them attractive for attackers.
To prevent leaking the deploy token, you should also configure your
[runners](../../../ci/runners/_index.md) to be secure:
- Avoid using Docker `privileged` mode if the machines are re-used.
- Avoid using the [`shell` executor](https://docs.gitlab.com/runner/executors/shell.html) when jobs
run on the same machine.
An insecure GitLab Runner configuration increases the risk that someone can steal tokens from other
jobs.
### GitLab public API
Deploy tokens can't be used with the GitLab public API. However, you can use deploy tokens with some
endpoints, such as those from the package registry. You can tell an endpoint belongs to the package registry because the URL has the string `packages/<format>`. For example: `https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt`. For more information, see
[Authenticate with the registry](../../packages/package_registry/supported_functionality.md#authenticate-with-the-registry).
## Create a deploy token
Create a deploy token to automate deployment tasks that can run independently of a user account.
Prerequisites:
- To create a group deploy token, you must have the Owner role for the group.
- To create a project deploy token, you must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Repository**.
1. Expand **Deploy tokens**.
1. Select **Add token**.
1. Complete the fields, and select the desired [scopes](#scope).
1. Select **Create deploy token**.
Record the deploy token's values. After you leave or refresh the page, **you cannot access it
again**.
## Revoke a deploy token
Revoke a token when it's no longer required.
Prerequisites:
- To revoke a group deploy token, you must have the Owner role for the group.
- To revoke a project deploy token, you must have at least the Maintainer role for the project.
To revoke a deploy token:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Repository**.
1. Expand **Deploy tokens**.
1. In the **Active Deploy Tokens** section, by the token you want to revoke, select **Revoke**.
## Clone a repository
You can use a deploy token to clone a repository.
Prerequisites:
- A deploy token with the `read_repository` scope.
Example of using a deploy token to clone a repository:
```shell
git clone https://<username>:<deploy_token>@gitlab.example.com/tanuki/awesome_project.git
```
## Pull images from a container registry
You can use a deploy token to pull images from a container registry.
Prerequisites:
- A deploy token with the `read_registry` scope.
Example of using a deploy token to pull images from a container registry:
```shell
echo "$DEPLOY_TOKEN" | docker login -u <username> --password-stdin registry.example.com
docker pull $CONTAINER_TEST_IMAGE
```
## Push images to a container registry
You can use a deploy token to push images to a container registry.
Prerequisites:
- A deploy token with the `read_registry` and `write_registry` scope.
Example of using a deploy token to push an image to a container registry:
```shell
echo "$DEPLOY_TOKEN" | docker login -u <username> --password-stdin registry.example.com
docker push $CONTAINER_TEST_IMAGE
```
## Pull packages from a package registry
You can use a deploy token to pull packages from a package registry.
Prerequisites:
- A deploy token with the `read_package_registry` scope.
For the [package type of your choice](../../packages/package_registry/supported_functionality.md#authenticate-with-the-registry), follow the authentication
instructions for deploy tokens.
Example of installing a NuGet package from a GitLab registry:
```shell
nuget source Add -Name GitLab -Source "https://gitlab.example.com/api/v4/projects/10/packages/nuget/index.json" -UserName <username> -Password <deploy_token>
nuget install mypkg.nupkg
```
## Push packages to a package registry
You can use a deploy token to push packages to a GitLab package registry.
Prerequisites:
- A deploy token with the `write_package_registry` scope.
For the [package type of your choice](../../packages/package_registry/supported_functionality.md#authenticate-with-the-registry), follow the authentication
instructions for deploy tokens.
Example of publishing a NuGet package to a package registry:
```shell
nuget source Add -Name GitLab -Source "https://gitlab.example.com/api/v4/projects/10/packages/nuget/index.json" -UserName <username> -Password <deploy_token>
nuget push mypkg.nupkg -Source GitLab
```
## Pull images from the dependency proxy
You can use a deploy token to pull images from the dependency proxy.
Prerequisites:
- A deploy token with `read_registry` and `write_registry` scopes.
Follow the dependency proxy [authentication instructions](../../packages/dependency_proxy/_index.md).
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Deploy tokens
description: Repository cloning, token creation, and container registry.
breadcrumbs:
- doc
- user
- project
- deploy_tokens
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Deploy tokens provide secure access to GitLab resources without tying permissions to individual user accounts. Use them with Git operations, container registries, and package registries, giving your deployment
automation access to exactly what it needs.
With deploy tokens, you have:
- More secure deployments by removing personal credentials from automation systems
- Fine-grained access control with specific permissions for each token
- Simplified CI/CD pipelines with built-in authentication variables
- Reliable deployment processes that won't break when team members change
- Better audit trails by tracking deployments through dedicated token identities
- Seamless integration with external build systems and deployment tools
A deploy token is a pair of values:
- **username**: `username` in the HTTP authentication framework. The default username format is
`gitlab+deploy-token-{n}`. You can specify a custom username when you create the deploy token.
- **token**: `password` in the HTTP authentication framework.
Deploy tokens do not support [SSH authentication](../../ssh.md).
You can use a deploy token for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)
to the following endpoints:
- GitLab package registry public API.
- [Git commands](https://git-scm.com/docs/gitcredentials#_description).
- [GitLab virtual registry package operations](../../../api/maven_virtual_registries.md#manage-package-operations).
You can create deploy tokens at either the project or group level:
- **Project deploy token**: Permissions apply only to the project.
- **Group deploy token**: Permissions apply to all projects in the group.
By default, a deploy token does not expire. You can optionally set an expiry date when you create
it. Expiry occurs at midnight UTC on that date.
{{< alert type="warning" >}}
You cannot use new or existing deploy tokens for Git operations and package registry operations if
[external authorization](../../../administration/settings/external_authorization.md) is enabled.
{{< /alert >}}
## Scope
A deploy token's scope determines the actions it can perform.
| Scope | Description |
|--------------------------|--------------------------------------------------------------------------------------------------------------|
| `read_repository` | Read-only access to the repository using `git clone`. |
| `read_registry` | Read-only access to the images in the project's [container registry](../../packages/container_registry/_index.md). |
| `write_registry` | Write access (push) to the project's [container registry](../../packages/container_registry/_index.md). You need both read and write access to push images. |
| `read_virtual_registry` | If a project is private and authorization is required, grants read-only (pull) access to container images through the [dependency proxy](../../packages/dependency_proxy/_index.md). Available only when the dependency proxy is enabled. |
| `write_virtual_registry` | If a project is private and authorization is required, grants read (pull), write (push), and delete access to container images through the [dependency proxy](../../packages/dependency_proxy/_index.md). Available only when the dependency proxy is enabled. |
| `read_package_registry` | Read-only access to the project's package registry. |
| `write_package_registry` | Write access to the project's package registry. |
## GitLab deploy token
{{< history >}}
- Support for `gitlab-deploy-token` at the group level [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214014) in GitLab 15.1 [with a flag](../../../administration/feature_flags/_index.md) named `ci_variable_for_group_gitlab_deploy_token`. Enabled by default.
- [Feature flag `ci_variable_for_group_gitlab_deploy_token`](https://gitlab.com/gitlab-org/gitlab/-/issues/363621) removed in GitLab 15.4.
{{< /history >}}
A GitLab deploy token is a special type of deploy token. If you create a deploy token named
`gitlab-deploy-token`, the deploy token is automatically exposed to project CI/CD jobs as variables:
- `CI_DEPLOY_USER`: Username
- `CI_DEPLOY_PASSWORD`: Token
For example, to use a GitLab token to sign in to your GitLab container registry:
```shell
echo "$CI_DEPLOY_PASSWORD" | docker login $CI_REGISTRY -u $CI_DEPLOY_USER --password-stdin
```
{{< alert type="note" >}}
In GitLab 15.0 and earlier, the special handling for the `gitlab-deploy-token` deploy token does not
work for group deploy tokens. To make a group deploy token available for CI/CD jobs, set the
`CI_DEPLOY_USER` and `CI_DEPLOY_PASSWORD` CI/CD variables in **Settings > CI/CD > Variables** to the
name and token of the group deploy token.
{{< /alert >}}
When `gitlab-deploy-token` is defined in a group, the `CI_DEPLOY_USER` and `CI_DEPLOY_PASSWORD`
CI/CD variables are available only to immediate child projects of the group.
## Deploy token expiration
{{< history >}}
- Email notifications for deploy token expiration [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/512197) in GitLab 18.3 [with a flag](../../../administration/feature_flags/_index.md) named `project_deploy_token_expiring_notifications`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Deploy tokens expire on the date you define at 00:00 AM UTC.
GitLab checks every day at 01:00 AM UTC for deploy tokens that are about to expire.
Project owners and maintainers are notified by email 60, 30, and 7 days before these tokens expire.
These email notifications are sent only once per interval for active (non-revoked) deploy tokens.
### GitLab deploy token security
GitLab deploy tokens are long-lived, making them attractive for attackers.
To prevent leaking the deploy token, you should also configure your
[runners](../../../ci/runners/_index.md) to be secure:
- Avoid using Docker `privileged` mode if the machines are re-used.
- Avoid using the [`shell` executor](https://docs.gitlab.com/runner/executors/shell.html) when jobs
run on the same machine.
An insecure GitLab Runner configuration increases the risk that someone can steal tokens from other
jobs.
### GitLab public API
Deploy tokens can't be used with the GitLab public API. However, you can use deploy tokens with some
endpoints, such as those from the package registry. You can tell an endpoint belongs to the package registry because the URL has the string `packages/<format>`. For example: `https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt`. For more information, see
[Authenticate with the registry](../../packages/package_registry/supported_functionality.md#authenticate-with-the-registry).
## Create a deploy token
Create a deploy token to automate deployment tasks that can run independently of a user account.
Prerequisites:
- To create a group deploy token, you must have the Owner role for the group.
- To create a project deploy token, you must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Repository**.
1. Expand **Deploy tokens**.
1. Select **Add token**.
1. Complete the fields, and select the desired [scopes](#scope).
1. Select **Create deploy token**.
Record the deploy token's values. After you leave or refresh the page, **you cannot access it
again**.
## Revoke a deploy token
Revoke a token when it's no longer required.
Prerequisites:
- To revoke a group deploy token, you must have the Owner role for the group.
- To revoke a project deploy token, you must have at least the Maintainer role for the project.
To revoke a deploy token:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Repository**.
1. Expand **Deploy tokens**.
1. In the **Active Deploy Tokens** section, by the token you want to revoke, select **Revoke**.
## Clone a repository
You can use a deploy token to clone a repository.
Prerequisites:
- A deploy token with the `read_repository` scope.
Example of using a deploy token to clone a repository:
```shell
git clone https://<username>:<deploy_token>@gitlab.example.com/tanuki/awesome_project.git
```
## Pull images from a container registry
You can use a deploy token to pull images from a container registry.
Prerequisites:
- A deploy token with the `read_registry` scope.
Example of using a deploy token to pull images from a container registry:
```shell
echo "$DEPLOY_TOKEN" | docker login -u <username> --password-stdin registry.example.com
docker pull $CONTAINER_TEST_IMAGE
```
## Push images to a container registry
You can use a deploy token to push images to a container registry.
Prerequisites:
- A deploy token with the `read_registry` and `write_registry` scope.
Example of using a deploy token to push an image to a container registry:
```shell
echo "$DEPLOY_TOKEN" | docker login -u <username> --password-stdin registry.example.com
docker push $CONTAINER_TEST_IMAGE
```
## Pull packages from a package registry
You can use a deploy token to pull packages from a package registry.
Prerequisites:
- A deploy token with the `read_package_registry` scope.
For the [package type of your choice](../../packages/package_registry/supported_functionality.md#authenticate-with-the-registry), follow the authentication
instructions for deploy tokens.
Example of installing a NuGet package from a GitLab registry:
```shell
nuget source Add -Name GitLab -Source "https://gitlab.example.com/api/v4/projects/10/packages/nuget/index.json" -UserName <username> -Password <deploy_token>
nuget install mypkg.nupkg
```
## Push packages to a package registry
You can use a deploy token to push packages to a GitLab package registry.
Prerequisites:
- A deploy token with the `write_package_registry` scope.
For the [package type of your choice](../../packages/package_registry/supported_functionality.md#authenticate-with-the-registry), follow the authentication
instructions for deploy tokens.
Example of publishing a NuGet package to a package registry:
```shell
nuget source Add -Name GitLab -Source "https://gitlab.example.com/api/v4/projects/10/packages/nuget/index.json" -UserName <username> -Password <deploy_token>
nuget push mypkg.nupkg -Source GitLab
```
## Pull images from the dependency proxy
You can use a deploy token to pull images from the dependency proxy.
Prerequisites:
- A deploy token with `read_registry` and `write_registry` scopes.
Follow the dependency proxy [authentication instructions](../../packages/dependency_proxy/_index.md).
|
https://docs.gitlab.com/user/project/deploy_keys
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/deploy_keys
|
[
"doc",
"user",
"project",
"deploy_keys"
] |
_index.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Deploy keys
|
Public SSH keys, repository access, bot users, and read-only access.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Use deploy keys to access repositories that are hosted in GitLab. In most cases, you use deploy keys
to access a repository from an external host, like a build server or Continuous Integration (CI) server.
Depending on your needs, you might want to use a [deploy token](../deploy_tokens/_index.md) to access a repository instead.
| Attribute | Deploy key | Deploy token |
|------------------|-------------|--------------|
| Sharing | Shareable between multiple projects, even those in different groups. | Belong to a project or group. |
| Source | Public SSH key generated on an external host. | Generated on your GitLab instance, and is provided to users only at creation time. |
| Accessible resources | Git repository over SSH | Git repository over HTTP, package registry, and container registry. |
Deploy keys can't be used for Git operations if [external authorization](../../../administration/settings/external_authorization.md) is enabled.
## Scope
A deploy key has a defined scope when it is created:
- **Project deploy key**: Access is limited to the selected project.
- **Public deploy key**: Access can be granted to any project in a GitLab instance. Access to each
project must be [granted](#grant-project-access-to-a-public-deploy-key) by a user with at least
the Maintainer role.
You cannot change a deploy key's scope after creating it.
## Permissions
A deploy key is given a permission level when it is created:
- **Read-only**: A read-only deploy key can only read from the repository.
- **Read-write**: A read-write deploy key can read from, and write to, the repository.
You can change a deploy key's permission level after creating it. Changing a project deploy key's
permissions only applies for the current project.
If a push that uses a deploy key triggers additional processes, the creator of the key must be authorized. For example:
- When a deploy key is used to push a commit to a [protected branch](../repository/branches/protected.md),
the creator of the deploy key must have access to the branch.
- When a deploy key is used to push a commit that triggers a CI/CD pipeline, the creator of the
deploy key must have access to the CI/CD resources, including protected environments and secret
variables.
### Security implications
Deploy keys are meant to facilitate non-human interaction with GitLab. For example, you can use a deploy key
to grant permissions to a script that automatically runs on a server in your organization.
You should use [a service account](../../profile/service_accounts.md), and create the deploy key with the service account.
If you use another user account to create deploy keys, that user is granted privileges that persist until the deploy key is revoked.
In addition:
- Deploy keys work even if the user who created them is removed from the group or project.
- The creator of a deploy key retains access to the group or project, even if the user is demoted or removed.
- When a deploy key is specified in a protected branch rule, the creator of the deploy key:
- Gains access to the protected branch, as well as to the deploy key itself.
- Can push to the protected branch, if the deploy key has read-write permission.
This is true even if the branch is protected against changes from all users.
- If the creator of the deploy key is blocked or removed from the instance, the user can still pull changes from the group or project, but not push.
As with all sensitive information, you should ensure only those who need access to the secret can read it.
For human interactions, use credentials tied to users such as personal access tokens.
To help detect a potential secret leak, you can use the
[audit event](../../compliance/audit_event_schema.md#example-audit-event-payloads-for-git-over-ssh-events-with-deploy-key) feature.
## View deploy keys
To view the deploy keys available to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
The deploy keys available are listed:
- **Enabled deploy keys**: Deploy keys that have access to the project.
- **Privately accessible deploy keys**: Project deploy keys that don't have access to the project.
- **Public accessible deploy keys**: Public deploy keys that don't have access to the project.
The [GitLab CLI](../../../editor_extensions/gitlab_cli/_index.md) provides a `glab deploy-key list` command.
## Create a project deploy key
Prerequisites:
- You must have at least the Maintainer role for the project.
- [Generate an SSH key pair](../../ssh.md#generate-an-ssh-key-pair). Put the private SSH
key on the host that requires access to the repository.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. Select **Add new key**.
1. Complete the fields.
1. Optional. To grant `read-write` permission, select the **Grant write permissions to this key**
checkbox.
1. Optional. Update the **Expiration date**.
A project deploy key is enabled when it is created. You can modify only a project deploy key's
name and permissions. If the deploy key is enabled in more than one project, you can't modify the deploy key name.
The [GitLab CLI](../../../editor_extensions/gitlab_cli/_index.md) provides a `glab deploy-key add` command.
## Create a public deploy key
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Prerequisites:
- You must have administrator access to the instance.
- You must [generate an SSH key pair](../../ssh.md#generate-an-ssh-key-pair).
- You must put the private SSH key on the host that requires access to the repository.
To create a public deploy key:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Deploy keys**.
1. Select **New deploy key**.
1. Complete the fields.
- Use a meaningful description for **Name**. For example, include the name of the external host
or application that uses the public deploy key.
You can modify only a public deploy key's name.
## Grant project access to a public deploy key
Prerequisites:
- You must have at least the Maintainer role for the project.
To grant a public deploy key access to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. Select **Publicly accessible deploy keys**.
1. In the key's row, select **Enable**.
1. To grant read-write permission to the public deploy key:
1. In the key's row, select **Edit** ({{< icon name="pencil" >}}).
1. Select the **Grant write permissions to this key** checkbox.
### Edit project access permissions of a deploy key
Prerequisites:
- You must have at least the Maintainer role for the project.
To edit the project access permissions of a deploy key:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. In the key's row, select **Edit** ({{< icon name="pencil" >}}).
1. Select or clear the **Grant write permissions to this key** checkbox.
## Revoke project access of a deploy key
To revoke a deploy key's access to a project, you can disable it. Any service that relies on
a deploy key stops working when the key is disabled.
Prerequisites:
- You must have at least the Maintainer role for the project.
To disable a deploy key:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. Select **Disable** ({{< icon name="cancel" >}}).
What happens to the deploy key when it is disabled depends on the following:
- If the key is publicly accessible, it is removed from the project but still available in the
**Publicly accessible deploy keys** tab.
- If the key is privately accessible and only in use by this project, it is deleted.
- If the key is privately accessible and also in use by other projects, it is removed from the
project, but still available in the **Privately accessible deploy keys** tab.
## Related topics
- GitLab CLI [commands for deploy keys](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/deploy-key)
## Troubleshooting
### Deploy key cannot push to a protected branch
There are a few scenarios where a deploy key fails to push to a
[protected branch](../repository/branches/protected.md).
- The owner associated to a deploy key does not have [membership](../members/_index.md) to the project of the protected branch.
- The owner associated to a deploy key has [project membership permissions](../../permissions.md#project-members-permissions) lower than required to **View project code**.
- The deploy key does not have [read-write permissions for the project](#edit-project-access-permissions-of-a-deploy-key).
- The deploy key has been [revoked](#revoke-project-access-of-a-deploy-key).
- **No one** is selected in [the **Allowed to push and merge** section](../repository/branches/protected.md#protect-a-branch) of the protected branch.
This issue occurs because all deploy keys are associated to an account. Because the permissions for an account can change, this might lead to scenarios where a deploy key that was working is suddenly unable to push to a protected branch.
To resolve this issue, you can use the deploy keys API to create deploy keys for project service account users, instead of for your own users:
1. [Create a service account user](../../../api/service_accounts.md#create-a-group-service-account).
1. [Create a personal access token](../../../api/service_accounts.md#create-a-personal-access-token-for-a-group-service-account) for that service account user. This token must have at least the `api` scope.
1. [Invite the service account user to the project](../../profile/service_accounts.md#service-account-access-to-groups-and-projects).
1. Use the deploy key API to [create a deploy key for the service account user](../../../api/deploy_keys.md#add-deploy-key):
```shell
curl --request POST --header "PRIVATE-TOKEN: <service_account_access_token>" \
--header "Content-Type: application/json" \
--data '{"title": "My deploy key", "key": "ssh-rsa AAAA...", "can_push": "true"}' \
--url "https://gitlab.example.com/api/v4/projects/5/deploy_keys/"
```
#### Identify deploy keys associated with non-member and blocked users
If you need to find the keys that belong to a non-member or blocked user,
you can use [the Rails console](../../../administration/operations/rails_console.md#starting-a-rails-console-session) to identify unusable deploy keys using a script similar to the following:
```ruby
ghost_user_id = Users::Internal.ghost.id
DeployKeysProject.with_write_access.find_each do |deploy_key_mapping|
project = deploy_key_mapping.project
deploy_key = deploy_key_mapping.deploy_key
user = deploy_key.user
access_checker = Gitlab::DeployKeyAccess.new(deploy_key, container: project)
# can_push_for_ref? tests if deploy_key can push to default branch, which is likely to be protected
can_push = access_checker.can_do_action?(:push_code)
can_push_to_default = access_checker.can_push_for_ref?(project.repository.root_ref)
next if access_checker.allowed? && can_push && can_push_to_default
if user.nil? || user.id == ghost_user_id
username = 'none'
state = '-'
else
username = user.username
user_state = user.state
end
puts "Deploy key: #{deploy_key.id}, Project: #{project.full_path}, Can push?: " + (can_push ? 'YES' : 'NO') +
", Can push to default branch #{project.repository.root_ref}?: " + (can_push_to_default ? 'YES' : 'NO') +
", User: #{username}, User state: #{user_state}"
end
```
#### Set the owner of a deploy key
Deploy keys belong to a specific user and are deactivated when the user is blocked or removed from the instance.
To keep a deploy key working when a user is removed, change its owner to an active user.
If you have the fingerprint of the deploy key, you can change the user associated with a deploy key with the following commands:
```shell
k = Key.find_by(fingerprint: '5e:51:92:11:27:90:01:b5:83:c3:87:e3:38:82:47:2e')
k.user_id = User.find_by(username: 'anactiveuser').id
k.save()
```
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Deploy keys
description: Public SSH keys, repository access, bot users, and read-only access.
breadcrumbs:
- doc
- user
- project
- deploy_keys
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Use deploy keys to access repositories that are hosted in GitLab. In most cases, you use deploy keys
to access a repository from an external host, like a build server or Continuous Integration (CI) server.
Depending on your needs, you might want to use a [deploy token](../deploy_tokens/_index.md) to access a repository instead.
| Attribute | Deploy key | Deploy token |
|------------------|-------------|--------------|
| Sharing | Shareable between multiple projects, even those in different groups. | Belong to a project or group. |
| Source | Public SSH key generated on an external host. | Generated on your GitLab instance, and is provided to users only at creation time. |
| Accessible resources | Git repository over SSH | Git repository over HTTP, package registry, and container registry. |
Deploy keys can't be used for Git operations if [external authorization](../../../administration/settings/external_authorization.md) is enabled.
## Scope
A deploy key has a defined scope when it is created:
- **Project deploy key**: Access is limited to the selected project.
- **Public deploy key**: Access can be granted to any project in a GitLab instance. Access to each
project must be [granted](#grant-project-access-to-a-public-deploy-key) by a user with at least
the Maintainer role.
You cannot change a deploy key's scope after creating it.
## Permissions
A deploy key is given a permission level when it is created:
- **Read-only**: A read-only deploy key can only read from the repository.
- **Read-write**: A read-write deploy key can read from, and write to, the repository.
You can change a deploy key's permission level after creating it. Changing a project deploy key's
permissions only applies for the current project.
If a push that uses a deploy key triggers additional processes, the creator of the key must be authorized. For example:
- When a deploy key is used to push a commit to a [protected branch](../repository/branches/protected.md),
the creator of the deploy key must have access to the branch.
- When a deploy key is used to push a commit that triggers a CI/CD pipeline, the creator of the
deploy key must have access to the CI/CD resources, including protected environments and secret
variables.
### Security implications
Deploy keys are meant to facilitate non-human interaction with GitLab. For example, you can use a deploy key
to grant permissions to a script that automatically runs on a server in your organization.
You should use [a service account](../../profile/service_accounts.md), and create the deploy key with the service account.
If you use another user account to create deploy keys, that user is granted privileges that persist until the deploy key is revoked.
In addition:
- Deploy keys work even if the user who created them is removed from the group or project.
- The creator of a deploy key retains access to the group or project, even if the user is demoted or removed.
- When a deploy key is specified in a protected branch rule, the creator of the deploy key:
- Gains access to the protected branch, as well as to the deploy key itself.
- Can push to the protected branch, if the deploy key has read-write permission.
This is true even if the branch is protected against changes from all users.
- If the creator of the deploy key is blocked or removed from the instance, the user can still pull changes from the group or project, but not push.
As with all sensitive information, you should ensure only those who need access to the secret can read it.
For human interactions, use credentials tied to users such as personal access tokens.
To help detect a potential secret leak, you can use the
[audit event](../../compliance/audit_event_schema.md#example-audit-event-payloads-for-git-over-ssh-events-with-deploy-key) feature.
## View deploy keys
To view the deploy keys available to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
The deploy keys available are listed:
- **Enabled deploy keys**: Deploy keys that have access to the project.
- **Privately accessible deploy keys**: Project deploy keys that don't have access to the project.
- **Public accessible deploy keys**: Public deploy keys that don't have access to the project.
The [GitLab CLI](../../../editor_extensions/gitlab_cli/_index.md) provides a `glab deploy-key list` command.
## Create a project deploy key
Prerequisites:
- You must have at least the Maintainer role for the project.
- [Generate an SSH key pair](../../ssh.md#generate-an-ssh-key-pair). Put the private SSH
key on the host that requires access to the repository.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. Select **Add new key**.
1. Complete the fields.
1. Optional. To grant `read-write` permission, select the **Grant write permissions to this key**
checkbox.
1. Optional. Update the **Expiration date**.
A project deploy key is enabled when it is created. You can modify only a project deploy key's
name and permissions. If the deploy key is enabled in more than one project, you can't modify the deploy key name.
The [GitLab CLI](../../../editor_extensions/gitlab_cli/_index.md) provides a `glab deploy-key add` command.
## Create a public deploy key
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Prerequisites:
- You must have administrator access to the instance.
- You must [generate an SSH key pair](../../ssh.md#generate-an-ssh-key-pair).
- You must put the private SSH key on the host that requires access to the repository.
To create a public deploy key:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Deploy keys**.
1. Select **New deploy key**.
1. Complete the fields.
- Use a meaningful description for **Name**. For example, include the name of the external host
or application that uses the public deploy key.
You can modify only a public deploy key's name.
## Grant project access to a public deploy key
Prerequisites:
- You must have at least the Maintainer role for the project.
To grant a public deploy key access to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. Select **Publicly accessible deploy keys**.
1. In the key's row, select **Enable**.
1. To grant read-write permission to the public deploy key:
1. In the key's row, select **Edit** ({{< icon name="pencil" >}}).
1. Select the **Grant write permissions to this key** checkbox.
### Edit project access permissions of a deploy key
Prerequisites:
- You must have at least the Maintainer role for the project.
To edit the project access permissions of a deploy key:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. In the key's row, select **Edit** ({{< icon name="pencil" >}}).
1. Select or clear the **Grant write permissions to this key** checkbox.
## Revoke project access of a deploy key
To revoke a deploy key's access to a project, you can disable it. Any service that relies on
a deploy key stops working when the key is disabled.
Prerequisites:
- You must have at least the Maintainer role for the project.
To disable a deploy key:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **Repository**.
1. Expand **Deploy keys**.
1. Select **Disable** ({{< icon name="cancel" >}}).
What happens to the deploy key when it is disabled depends on the following:
- If the key is publicly accessible, it is removed from the project but still available in the
**Publicly accessible deploy keys** tab.
- If the key is privately accessible and only in use by this project, it is deleted.
- If the key is privately accessible and also in use by other projects, it is removed from the
project, but still available in the **Privately accessible deploy keys** tab.
## Related topics
- GitLab CLI [commands for deploy keys](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/deploy-key)
## Troubleshooting
### Deploy key cannot push to a protected branch
There are a few scenarios where a deploy key fails to push to a
[protected branch](../repository/branches/protected.md).
- The owner associated to a deploy key does not have [membership](../members/_index.md) to the project of the protected branch.
- The owner associated to a deploy key has [project membership permissions](../../permissions.md#project-members-permissions) lower than required to **View project code**.
- The deploy key does not have [read-write permissions for the project](#edit-project-access-permissions-of-a-deploy-key).
- The deploy key has been [revoked](#revoke-project-access-of-a-deploy-key).
- **No one** is selected in [the **Allowed to push and merge** section](../repository/branches/protected.md#protect-a-branch) of the protected branch.
This issue occurs because all deploy keys are associated to an account. Because the permissions for an account can change, this might lead to scenarios where a deploy key that was working is suddenly unable to push to a protected branch.
To resolve this issue, you can use the deploy keys API to create deploy keys for project service account users, instead of for your own users:
1. [Create a service account user](../../../api/service_accounts.md#create-a-group-service-account).
1. [Create a personal access token](../../../api/service_accounts.md#create-a-personal-access-token-for-a-group-service-account) for that service account user. This token must have at least the `api` scope.
1. [Invite the service account user to the project](../../profile/service_accounts.md#service-account-access-to-groups-and-projects).
1. Use the deploy key API to [create a deploy key for the service account user](../../../api/deploy_keys.md#add-deploy-key):
```shell
curl --request POST --header "PRIVATE-TOKEN: <service_account_access_token>" \
--header "Content-Type: application/json" \
--data '{"title": "My deploy key", "key": "ssh-rsa AAAA...", "can_push": "true"}' \
--url "https://gitlab.example.com/api/v4/projects/5/deploy_keys/"
```
#### Identify deploy keys associated with non-member and blocked users
If you need to find the keys that belong to a non-member or blocked user,
you can use [the Rails console](../../../administration/operations/rails_console.md#starting-a-rails-console-session) to identify unusable deploy keys using a script similar to the following:
```ruby
ghost_user_id = Users::Internal.ghost.id
DeployKeysProject.with_write_access.find_each do |deploy_key_mapping|
project = deploy_key_mapping.project
deploy_key = deploy_key_mapping.deploy_key
user = deploy_key.user
access_checker = Gitlab::DeployKeyAccess.new(deploy_key, container: project)
# can_push_for_ref? tests if deploy_key can push to default branch, which is likely to be protected
can_push = access_checker.can_do_action?(:push_code)
can_push_to_default = access_checker.can_push_for_ref?(project.repository.root_ref)
next if access_checker.allowed? && can_push && can_push_to_default
if user.nil? || user.id == ghost_user_id
username = 'none'
state = '-'
else
username = user.username
user_state = user.state
end
puts "Deploy key: #{deploy_key.id}, Project: #{project.full_path}, Can push?: " + (can_push ? 'YES' : 'NO') +
", Can push to default branch #{project.repository.root_ref}?: " + (can_push_to_default ? 'YES' : 'NO') +
", User: #{username}, User state: #{user_state}"
end
```
#### Set the owner of a deploy key
Deploy keys belong to a specific user and are deactivated when the user is blocked or removed from the instance.
To keep a deploy key working when a user is removed, change its owner to an active user.
If you have the fingerprint of the deploy key, you can change the user associated with a deploy key with the following commands:
```shell
k = Key.find_by(fingerprint: '5e:51:92:11:27:90:01:b5:83:c3:87:e3:38:82:47:2e')
k.user_id = User.find_by(username: 'anactiveuser').id
k.save()
```
|
https://docs.gitlab.com/user/project/ml
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/ml
|
[
"doc",
"user",
"project",
"ml"
] |
_index.md
|
ModelOps
|
MLOps
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
MLOps
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Machine Learning Operations (MLOps) is set of tools designed to help with
your machine learning workflows.
GitLab MLOps features include:
- Model registry: Manage your machine learning models, along with associated metadata such
as parameters, performance metrics, artifacts, and logs. For more information, see
[model registry](model_registry/_index.md).
- Model experiments: Track and manage machine learning experiments in GitLab.
An experiment is a collection of comparable model candidates, which are variations of the training of a
machine learning model. For more information, see [model experiments](experiment_tracking/_index.md).
## GitLab MLOps Python client
GitLab offers a Python client to interact with the GitLab MLOps features.
For details, see the [GitLab MLOps Python client](https://gitlab.com/gitlab-org/modelops/mlops/gitlab-mlops).
|
---
stage: ModelOps
group: MLOps
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: MLOps
breadcrumbs:
- doc
- user
- project
- ml
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Machine Learning Operations (MLOps) is set of tools designed to help with
your machine learning workflows.
GitLab MLOps features include:
- Model registry: Manage your machine learning models, along with associated metadata such
as parameters, performance metrics, artifacts, and logs. For more information, see
[model registry](model_registry/_index.md).
- Model experiments: Track and manage machine learning experiments in GitLab.
An experiment is a collection of comparable model candidates, which are variations of the training of a
machine learning model. For more information, see [model experiments](experiment_tracking/_index.md).
## GitLab MLOps Python client
GitLab offers a Python client to interact with the GitLab MLOps features.
For details, see the [GitLab MLOps Python client](https://gitlab.com/gitlab-org/modelops/mlops/gitlab-mlops).
|
https://docs.gitlab.com/user/project/ml/model_registry
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/ml/_index.md
|
2025-08-13
|
doc/user/project/ml/model_registry
|
[
"doc",
"user",
"project",
"ml",
"model_registry"
] |
_index.md
|
ModelOps
|
MLOps
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Model registry
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9423) in GitLab 16.8 as an [experiment](../../../../policy/development_stages_support.md#experiment) release [with a flag](../../../../administration/feature_flags/_index.md) named `model_registry`. Disabled by default. To enable the feature, an administrator can [enable the feature flag](../../../../administration/feature_flags/_index.md) named `model_registry`.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/9423) to beta in GitLab 17.1.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/14998) to general availability in GitLab 17.6.
{{< /history >}}
A machine learning model registry serves as a centralized repository for managing machine learning
models throughout their lifecycle. It functions like a specialized database that stores model
versions along with essential metadata including performance metrics, validation results, and
data lineage information.
Use GitLab model registries to:
- Register and version machine learning models systematically
- Track comprehensive metadata including performance metrics, parameters, and data lineage
- Compare model versions and monitor their evolution over time
- Maintain clear documentation of model behavior and requirements
For more information about model registry features and capabilities, see [epic 9423](https://gitlab.com/groups/gitlab-org/-/epics/9423).
## Access the model registry
The model registry is controlled by the package registry setting.
Before using the model registry, make
sure the [package registry is enabled](../../../../administration/packages/_index.md#enable-or-disable-the-package-registry).
To access the model registry, on the left sidebar, select **Deploy > Model registry**.
If **Model registry** is not available, ensure that it has been enabled.
To enable the model registry or set the [visibility level](../../../public_access.md) to public or private:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **Model registry**, ensure the toggle is on and select who you want to have access.
Users must have
at least the [Reporter role](../../../permissions.md#roles) to modify or delete models and model versions.
## Create machine learning models by using the UI
To create a new machine learning model by using the GitLab UI:
1. On the left sidebar, select **Deploy > Model registry**.
1. On the **Model registry** page, select **Create/Import**.
1. In the dropdown, select **Create new model**.
1. Complete the fields:
- Enter a unique name for your model name.
- Optional. Provide a description for the model.
1. Select **Create**.
You can now view the newly created model in the model registry.
## Create a model version by using the UI
To create a new model version:
1. On the model details page, select **Create new version**.
1. Complete the fields:
- Enter a unique version number following semantic versioning.
- Optional. Provide a description for the model version.
- Upload any files, logs, metrics, or parameters associated with the model version.
1. Select on **Create & import**.
The new model version is now available in the model registry.
### Delete a model
To delete a model and all its associated versions:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model you want to delete.
1. In the most right column, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model**.
Alternatively you can delete models from the model details page:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model you want to delete.
1. Select the model name to view its details.
1. Select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model**.
1. Confirm the deletion.
### Delete a model version
To delete a model version:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model with a version you want to delete.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Find the model version you want to delete
1. In the most right column, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model version**.
Alternatively you can delete models from the model version details page:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model with a version you want to delete.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Select the version name to view its details.
1. Select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model version**.
1. Confirm the deletion.
### Add artifacts to a model version
To add artifacts to a model version:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Select the version name to view its details.
1. Select the **Artifacts** tab.
1. Optional. Specify a subfolder path for the files to be uploaded to. For example `config`.
1. Use **select** to choose the files to upload.
1. Select **Upload**.
Alternatively, you can drag and drop files in the drop area. The artifacts are automatically uploaded.
Because each file has a size limit of 5 GB, you must partition larger models.
### Delete artifacts from a model version
To delete artifacts of a version:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Select the version name to view its details.
1. Select the **Artifacts** tab.
1. Select the box next to each artifact you want to delete.
1. Select **Delete**.
1. Confirm the deletion.
## Create machine learning models and model versions by using MLflow
Models and model versions can be created using the [MLflow](https://www.mlflow.org/docs/latest/tracking.html) client compatibility.
For more information about how to create and manage models and model versions, see [MLflow client compatibility](../experiment_tracking/mlflow_client.md#model-registry).
You can also create models directly on GitLab by selecting **Create Model**
on the Model registry page.
### Add artifacts, metrics, and parameters to a model version by using MLflow
Files can either be uploaded to a model version using:
- The package registry, where a model version is associated to a package of name `<model_name>/<model_version>`.
- The MLflow client compatibility. [View details](../experiment_tracking/mlflow_client.md#logging-artifacts-to-a-model-version).
Users can log metrics and a parameters of a model version through the MLflow client compatibility, [see details](../experiment_tracking/mlflow_client.md#logging-metrics-and-parameters-to-a-model-version)
## Link a model version to a CI/CD job
When creating a model version through a GitLab CI/CD job, you can link the model
version to the job, giving convenient access to the job's logs, merge request, and pipeline.
This can be done through the MLflow client compatibility. [View details](../experiment_tracking/mlflow_client.md#linking-a-model-version-to-a-cicd-job).
## Model versions and semantic versioning
The version of a model version in GitLab must follow [Semantic Version specification](https://semver.org/).
Using semantic versioning facilitates model deployment, by communicating which
if a new version can be deployed without changes to the application:
- **Major (integer)**: A change in the major component signifies a breaking change in the model, and that the application
that consumes the model must be updated to properly use this new version.
A new algorithm or the addition of a mandatory feature column are examples of breaking
changes that would require a bump at the major component.
- **Minor (integer)**: A change in the minor component signifies a non-breaking change, and that the
consumer can safely use the new version without breaking, although the consumer might
need to be updated to use its new functionality. For example, adding a non-mandatory
feature column with a default value to the model is a minor bump, because when a value for
the added column is not passed, inference still works.
- **Patch (integer)**: A change in the patch component means that a new version is out that does not
require any action by the application. For example, a daily retrain of the
model does not change the feature set or how the application consumes the
model version. Auto updating to a new patch is a safe update.
- **Prerelease (text)**: Represents a version that is not yet ready for production use.
Used to identify alpha, beta, or release candidate versions of the model.
### Model version examples
- Initial Release: 1.0.0 - The first release of the model, with no changes or patches.
- New Feature: 1.1.0 - A new non-breaking feature has been added to the model, incrementing the minor version.
- Bug Fix: 1.1.1 - A bug has been fixed in the model, incrementing the patch version.
- Breaking Change: 2.0.0 - A breaking change has been made to the model, incrementing the major version.
- Patch Release: 2.0.1 - A bug has been fixed in the model, incrementing the patch version.
- Prerelease: 2.0.1-alpha1 - A prerelease version of the model, with an alpha release.
- Prerelease: 2.0.1-rc2 - A release candidate version of the model.
- New Feature: 2.1.0 - A new feature has been added to the model, so the minor version is incremented.
|
---
stage: ModelOps
group: MLOps
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Model registry
breadcrumbs:
- doc
- user
- project
- ml
- model_registry
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9423) in GitLab 16.8 as an [experiment](../../../../policy/development_stages_support.md#experiment) release [with a flag](../../../../administration/feature_flags/_index.md) named `model_registry`. Disabled by default. To enable the feature, an administrator can [enable the feature flag](../../../../administration/feature_flags/_index.md) named `model_registry`.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/9423) to beta in GitLab 17.1.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/14998) to general availability in GitLab 17.6.
{{< /history >}}
A machine learning model registry serves as a centralized repository for managing machine learning
models throughout their lifecycle. It functions like a specialized database that stores model
versions along with essential metadata including performance metrics, validation results, and
data lineage information.
Use GitLab model registries to:
- Register and version machine learning models systematically
- Track comprehensive metadata including performance metrics, parameters, and data lineage
- Compare model versions and monitor their evolution over time
- Maintain clear documentation of model behavior and requirements
For more information about model registry features and capabilities, see [epic 9423](https://gitlab.com/groups/gitlab-org/-/epics/9423).
## Access the model registry
The model registry is controlled by the package registry setting.
Before using the model registry, make
sure the [package registry is enabled](../../../../administration/packages/_index.md#enable-or-disable-the-package-registry).
To access the model registry, on the left sidebar, select **Deploy > Model registry**.
If **Model registry** is not available, ensure that it has been enabled.
To enable the model registry or set the [visibility level](../../../public_access.md) to public or private:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **Model registry**, ensure the toggle is on and select who you want to have access.
Users must have
at least the [Reporter role](../../../permissions.md#roles) to modify or delete models and model versions.
## Create machine learning models by using the UI
To create a new machine learning model by using the GitLab UI:
1. On the left sidebar, select **Deploy > Model registry**.
1. On the **Model registry** page, select **Create/Import**.
1. In the dropdown, select **Create new model**.
1. Complete the fields:
- Enter a unique name for your model name.
- Optional. Provide a description for the model.
1. Select **Create**.
You can now view the newly created model in the model registry.
## Create a model version by using the UI
To create a new model version:
1. On the model details page, select **Create new version**.
1. Complete the fields:
- Enter a unique version number following semantic versioning.
- Optional. Provide a description for the model version.
- Upload any files, logs, metrics, or parameters associated with the model version.
1. Select on **Create & import**.
The new model version is now available in the model registry.
### Delete a model
To delete a model and all its associated versions:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model you want to delete.
1. In the most right column, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model**.
Alternatively you can delete models from the model details page:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model you want to delete.
1. Select the model name to view its details.
1. Select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model**.
1. Confirm the deletion.
### Delete a model version
To delete a model version:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model with a version you want to delete.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Find the model version you want to delete
1. In the most right column, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model version**.
Alternatively you can delete models from the model version details page:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model with a version you want to delete.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Select the version name to view its details.
1. Select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and **Delete model version**.
1. Confirm the deletion.
### Add artifacts to a model version
To add artifacts to a model version:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Select the version name to view its details.
1. Select the **Artifacts** tab.
1. Optional. Specify a subfolder path for the files to be uploaded to. For example `config`.
1. Use **select** to choose the files to upload.
1. Select **Upload**.
Alternatively, you can drag and drop files in the drop area. The artifacts are automatically uploaded.
Because each file has a size limit of 5 GB, you must partition larger models.
### Delete artifacts from a model version
To delete artifacts of a version:
1. On the left sidebar, select **Deploy > Model registry**.
1. Find the model.
1. Select the model name to view its details.
1. Select the **Versions** tab.
1. Select the version name to view its details.
1. Select the **Artifacts** tab.
1. Select the box next to each artifact you want to delete.
1. Select **Delete**.
1. Confirm the deletion.
## Create machine learning models and model versions by using MLflow
Models and model versions can be created using the [MLflow](https://www.mlflow.org/docs/latest/tracking.html) client compatibility.
For more information about how to create and manage models and model versions, see [MLflow client compatibility](../experiment_tracking/mlflow_client.md#model-registry).
You can also create models directly on GitLab by selecting **Create Model**
on the Model registry page.
### Add artifacts, metrics, and parameters to a model version by using MLflow
Files can either be uploaded to a model version using:
- The package registry, where a model version is associated to a package of name `<model_name>/<model_version>`.
- The MLflow client compatibility. [View details](../experiment_tracking/mlflow_client.md#logging-artifacts-to-a-model-version).
Users can log metrics and a parameters of a model version through the MLflow client compatibility, [see details](../experiment_tracking/mlflow_client.md#logging-metrics-and-parameters-to-a-model-version)
## Link a model version to a CI/CD job
When creating a model version through a GitLab CI/CD job, you can link the model
version to the job, giving convenient access to the job's logs, merge request, and pipeline.
This can be done through the MLflow client compatibility. [View details](../experiment_tracking/mlflow_client.md#linking-a-model-version-to-a-cicd-job).
## Model versions and semantic versioning
The version of a model version in GitLab must follow [Semantic Version specification](https://semver.org/).
Using semantic versioning facilitates model deployment, by communicating which
if a new version can be deployed without changes to the application:
- **Major (integer)**: A change in the major component signifies a breaking change in the model, and that the application
that consumes the model must be updated to properly use this new version.
A new algorithm or the addition of a mandatory feature column are examples of breaking
changes that would require a bump at the major component.
- **Minor (integer)**: A change in the minor component signifies a non-breaking change, and that the
consumer can safely use the new version without breaking, although the consumer might
need to be updated to use its new functionality. For example, adding a non-mandatory
feature column with a default value to the model is a minor bump, because when a value for
the added column is not passed, inference still works.
- **Patch (integer)**: A change in the patch component means that a new version is out that does not
require any action by the application. For example, a daily retrain of the
model does not change the feature set or how the application consumes the
model version. Auto updating to a new patch is a safe update.
- **Prerelease (text)**: Represents a version that is not yet ready for production use.
Used to identify alpha, beta, or release candidate versions of the model.
### Model version examples
- Initial Release: 1.0.0 - The first release of the model, with no changes or patches.
- New Feature: 1.1.0 - A new non-breaking feature has been added to the model, incrementing the minor version.
- Bug Fix: 1.1.1 - A bug has been fixed in the model, incrementing the patch version.
- Breaking Change: 2.0.0 - A breaking change has been made to the model, incrementing the major version.
- Patch Release: 2.0.1 - A bug has been fixed in the model, incrementing the patch version.
- Prerelease: 2.0.1-alpha1 - A prerelease version of the model, with an alpha release.
- Prerelease: 2.0.1-rc2 - A release candidate version of the model.
- New Feature: 2.1.0 - A new feature has been added to the model, so the minor version is incremented.
|
https://docs.gitlab.com/user/project/ml/mlflow_client
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/ml/mlflow_client.md
|
2025-08-13
|
doc/user/project/ml/experiment_tracking
|
[
"doc",
"user",
"project",
"ml",
"experiment_tracking"
] |
mlflow_client.md
|
ModelOps
|
MLOps
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
MLflow client compatibility
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8560) in GitLab 15.11.
- [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/9341) in GitLab 17.8.
{{< /history >}}
[MLflow](https://mlflow.org/) is a popular open source tool for Machine Learning experiment tracking.
GitLab [Model experiment tracking](_index.md) and GitLab
[Model registry](../model_registry/_index.md) are compatible with the MLflow client. The setup requires minimal changes to existing code.
## Enable MLflow client integration
Prerequisites:
- A GitLab-compatible Python client:
- Recommended: The [GitLab MLOps Python client](https://gitlab.com/gitlab-org/modelops/mlops/gitlab-mlops).
- Another option is the MLflow client version. The MLflow client is [compatible with GitLab](https://gitlab.com/gitlab-org/modelops/mlops/mlflow-compatibility-qa).
- A [personal](../../../profile/personal_access_tokens.md), [project](../../settings/project_access_tokens.md), or [group](../../../group/settings/group_access_tokens.md) access token with at least the Developer role and the `api` scope.
- The project ID. To find the project ID:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
To use MLflow client compatibility from a local environment:
1. Set the tracking URI and token environment variables on the host that runs the code.
This can be your local environment, CI pipeline, or remote host. For example:
```shell
export MLFLOW_TRACKING_URI="<your gitlab endpoint>/api/v4/projects/<your project id>/ml/mlflow"
export MLFLOW_TRACKING_TOKEN="<your_access_token>"
```
1. If the training code contains the call to `mlflow.set_tracking_uri()`, remove it.
In the model registry, you can copy the tracking URI from the overflow menu in the top right
by selecting the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
## Model experiments
When running the training code, MLflow client can be used to create experiments, runs,
models, model versions, log parameters, metrics, metadata, and artifacts on GitLab.
After experiments are logged, they are listed under `/<your project>/-/ml/experiments`.
Runs are registered and can be explored by selecting an experiment, model, or model version.
### Creating an experiment
```python
import mlflow
# Create a new experiment
experiment_id = mlflow.create_experiment(name="<your_experiment>")
# Setting the active experiment also creates a new experiment if it doesn't exist.
mlflow.set_experiment(experiment_name="<your_experiment>")
```
### Creating a run
```python
import mlflow
# Creating a run requires an experiment ID or an active experiment
mlflow.set_experiment(experiment_name="<your_experiment>")
# Runs can be created with or without a context manager
with mlflow.start_run() as run:
print(run.info.run_id)
# Your training code
with mlflow.start_run():
# Your training code
```
### Logging parameters and metrics
```python
import mlflow
mlflow.set_experiment(experiment_name="<your_experiment>")
with mlflow.start_run():
# Parameter keys need to be unique in the scope of the run
mlflow.log_param(key="param_1", value=1)
# Metrics can be updated throughout the run
mlflow.log_metric(key="metrics_1", value=1)
mlflow.log_metric(key="metrics_1", value=2)
```
### Logging artifacts
```python
import mlflow
mlflow.set_experiment(experiment_name="<your_experiment>")
with mlflow.start_run():
# Plaintext text files can be logged as artifacts using `log_text`
mlflow.log_text('Hello, World!', artifact_file='hello.txt')
mlflow.log_artifact(
local_path='<local/path/to/file.txt>',
artifact_path='<optional relative path to log the artifact at>'
)
```
### Logging models
Models can be logged using one of the supported [MLflow Model flavors](https://mlflow.org/docs/latest/models.html#built-in-model-flavors).
Logging with a model flavor records the metadata, making it easier to manage, load, and deploy models across different tools and environments.
```python
import mlflow
from sklearn.ensemble import RandomForestClassifier
mlflow.set_experiment(experiment_name="<your_experiment>")
with mlflow.start_run():
# Create and train a simple model
model = RandomForestClassifier(n_estimators=10, random_state=42)
model.fit(X_train, y_train)
# Log the model using MLflow sklearn mode flavour
mlflow.sklearn.log_model(model, artifact_path="")
```
### Loading a run
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/509595) in GitLab 17.9.
{{< /history >}}
You can load a run from the GitLab model registry to, for example, make predictions.
```python
import mlflow
import mlflow.pyfunc
run_id = "<your_run_id>"
download_path = "models" # Local folder to download to
mlflow.pyfunc.load_model(f"runs:/{run_id}/", dst_path=download_path)
sample_input = [[1,0,3,4],[2,0,1,2]]
model.predict(data=sample_input)
```
### Associating a run to a CI/CD job
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119454) in GitLab 16.1.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/9423) to beta in GitLab 17.1.
{{< /history >}}
If your training code is being run from a CI/CD job, GitLab can use that information to enhance
run metadata. To associate a run to a CI/CD job:
1. In the [Project CI variables](../../../../ci/variables/_index.md), include the following variables:
- `MLFLOW_TRACKING_URI`: `"<your gitlab endpoint>/api/v4/projects/<your project id>/ml/mlflow"`
- `MLFLOW_TRACKING_TOKEN`: `<your_access_token>`
1. In your training code within the run execution context, add the following code snippet:
```python
import os
import mlflow
with mlflow.start_run(run_name=f"Run {index}"):
# Your training code
# Start of snippet to be included
if os.getenv('GITLAB_CI'):
mlflow.set_tag('gitlab.CI_JOB_ID', os.getenv('CI_JOB_ID'))
# End of snippet to be included
```
## Model registry
You can also manage models and model versions by using the MLflow
client. Models are registered under `/<your project>/-/ml/models`.
### Models
#### Creating a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
description = 'Model description'
model = client.create_registered_model(model_name, description=description)
```
**Notes**
- `create_registered_model` argument `tags` is ignored.
- `name` must be unique within the project.
- `name` cannot be the name of an existing experiment.
#### Fetching a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
model = client.get_registered_model(model_name)
```
#### Updating a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
description = 'New description'
client.update_registered_model(model_name, description=description)
```
#### Deleting a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
client.delete_registered_model(model_name)
```
### Logging runs to a model
Every model has an associated experiment with the same name prefixed by `[model]`.
To log a run to the model, use the experiment passing the correct name:
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
exp = client.get_experiment_by_name(f"[model]{model_name}")
run = client.create_run(exp.experiment_id)
```
### Model version
#### Creating a model version
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
description = 'Model version description'
model_version = client.create_model_version(model_name, source="", description=description)
```
If the version parameter is not passed, it will be auto-incremented from the latest uploaded
version. You can set the version by passing a tag during model version creation. The version
must follow [SemVer](https://semver.org/) format.
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
tags = { "gitlab.version": version }
client.create_model_version(model_name, version, description=description, tags=tags)
```
**Notes**
- Argument `run_id` is ignored. Every model version behaves as a run. Creating a mode version from a run is not yet supported.
- Argument `source` is ignored. GitLab will create a package location for the model version files.
- Argument `run_link` is ignored.
- Argument `await_creation_for` is ignored.
#### Updating a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
description = 'New description'
client.update_model_version(model_name, version, description=description)
```
#### Fetching a model version
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
client.get_model_version(model_name, version)
```
#### Getting latest versions of a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
client.get_latest_versions(model_name)
```
**Notes**
- Argument `stages` is ignored.
- Versions are ordered by highest semantic version.
#### Loading a model version
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version' # for example: '1.0.0'
# Alternatively search the version
version = mlflow.search_registered_models(filter_string="name='{model_name}'")[0].latest_versions[0].version
model = mlflow.pyfunc.load_model(f"models:/{model_name}/{latest_version}")
# Or load the latest version
model = mlflow.pyfunc.load_model(f"models:/{model_name}/latest")
```
#### Logging metrics and parameters to a model version
Every model version is also a run, allowing users to log parameters
and metrics. The run ID can either be found at the Model version page in GitLab,
or by using the MLflow client:
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
model_version = client.get_model_version(model_name, version)
run_id = model_version.run_id
# Your training code
client.log_metric(run_id, '<metric_name>', '<metric_value>')
client.log_param(run_id, '<param_name>', '<param_value>')
client.log_batch(run_id, metric_list, param_list, tag_list)
```
Because each file has a size limit of 5 GB, you must partition larger models.
#### Logging artifacts to a model version
GitLab creates a package that can be used by the MLflow client to upload files.
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
model_version = client.get_model_version(model_name, version)
run_id = model_version.run_id
# Your training code
client.log_artifact(run_id, '<local/path/to/file.txt>', artifact_path="")
client.log_figure(run_id, figure, artifact_file="my_plot.png")
client.log_dict(run_id, my_dict, artifact_file="my_dict.json")
client.log_image(run_id, image, artifact_file="image.png")
```
Artifacts will then be available under `https/<your project>/-/ml/models/<model_id>/versions/<version_id>`.
#### Linking a model version to a CI/CD job
Similar to runs, it is also possible to link a model version to a CI/CD job:
```python
import os
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
model_version = client.get_model_version(model_name, version)
run_id = model_version.run_id
# Your training code
if os.getenv('GITLAB_CI'):
client.set_tag(model_version.run_id, 'gitlab.CI_JOB_ID', os.getenv('CI_JOB_ID'))
```
## Supported MLflow client methods and caveats
GitLab supports the following methods from the MLflow client. More information can be found in the [MLflow Documentation](https://mlflow.org/docs/latest/index.html). The MlflowClient counterparts
of the methods below are also supported with the same caveats.
| Method | Supported | Version Added | Comments |
|--------------------------|-----------------|---------------|----------------------------------------------------------------------------------------------|
| `create_experiment` | Yes | 15.11 | |
| `get_experiment` | Yes | 15.11 | |
| `get_experiment_by_name` | Yes | 15.11 | |
| `delete_experiment` | Yes | 17.5 | |
| `set_experiment` | Yes | 15.11 | |
| `get_run` | Yes | 15.11 | |
| `delete_run` | Yes | 17.5 | |
| `start_run` | Yes | 15.11 | (16.3) If a name is not provided, the run receives a random nickname. |
| `search_runs` | Yes | 15.11 | (16.4) `experiment_ids` supports only a single experiment ID with order by column or metric. |
| `log_artifact` | Yes with caveat | 15.11 | (15.11) `artifact_path` must be empty. Does not support directories. |
| `log_artifacts` | Yes with caveat | 15.11 | (15.11) `artifact_path` must be empty. Does not support directories. |
| `log_batch` | Yes | 15.11 | |
| `log_metric` | Yes | 15.11 | |
| `log_metrics` | Yes | 15.11 | |
| `log_param` | Yes | 15.11 | |
| `log_params` | Yes | 15.11 | |
| `log_figure` | Yes | 15.11 | |
| `log_image` | Yes | 15.11 | |
| `log_text` | Yes with caveat | 15.11 | (15.11) Does not support directories. |
| `log_dict` | Yes with caveat | 15.11 | (15.11) Does not support directories. |
| `set_tag` | Yes | 15.11 | |
| `set_tags` | Yes | 15.11 | |
| `set_terminated` | Yes | 15.11 | |
| `end_run` | Yes | 15.11 | |
| `update_run` | Yes | 15.11 | |
| `log_model` | Partial | 15.11 | (15.11) Saves the artifacts, but not the model data. `artifact_path` must be empty. |
| `load_model` | Yes | 17.5 | |
| `download_artifacts` | Yes | 17.9 | |
| `list_artifacts` | Yes | 17.9 | |
Other MLflowClient methods:
| Method | Supported | Version added | Comments |
|---------------------------|------------------|---------------|--------------------------------------------------|
| `create_registered_model` | Yes with caveats | 16.8 | [See notes](#creating-a-model) |
| `get_registered_model` | Yes | 16.8 | |
| `delete_registered_model` | Yes | 16.8 | |
| `update_registered_model` | Yes | 16.8 | |
| `create_model_version` | Yes with caveats | 16.8 | [See notes](#creating-a-model-version) |
| `get_model_version` | Yes | 16.8 | |
| `get_latest_versions` | Yes with caveats | 16.8 | [See notes](#getting-latest-versions-of-a-model) |
| `update_model_version` | Yes | 16.8 | |
| `create_registered_model` | Yes | 16.8 | |
| `create_registered_model` | Yes | 16.8 | |
## Known issues
- MLflow client methods not listed in [supported methods](#supported-mlflow-client-methods-and-caveats) might still work but have not been tested.
- During creation of experiments and runs, ExperimentTags are stored, even though they are not displayed.
|
---
stage: ModelOps
group: MLOps
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: MLflow client compatibility
breadcrumbs:
- doc
- user
- project
- ml
- experiment_tracking
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8560) in GitLab 15.11.
- [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/9341) in GitLab 17.8.
{{< /history >}}
[MLflow](https://mlflow.org/) is a popular open source tool for Machine Learning experiment tracking.
GitLab [Model experiment tracking](_index.md) and GitLab
[Model registry](../model_registry/_index.md) are compatible with the MLflow client. The setup requires minimal changes to existing code.
## Enable MLflow client integration
Prerequisites:
- A GitLab-compatible Python client:
- Recommended: The [GitLab MLOps Python client](https://gitlab.com/gitlab-org/modelops/mlops/gitlab-mlops).
- Another option is the MLflow client version. The MLflow client is [compatible with GitLab](https://gitlab.com/gitlab-org/modelops/mlops/mlflow-compatibility-qa).
- A [personal](../../../profile/personal_access_tokens.md), [project](../../settings/project_access_tokens.md), or [group](../../../group/settings/group_access_tokens.md) access token with at least the Developer role and the `api` scope.
- The project ID. To find the project ID:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
To use MLflow client compatibility from a local environment:
1. Set the tracking URI and token environment variables on the host that runs the code.
This can be your local environment, CI pipeline, or remote host. For example:
```shell
export MLFLOW_TRACKING_URI="<your gitlab endpoint>/api/v4/projects/<your project id>/ml/mlflow"
export MLFLOW_TRACKING_TOKEN="<your_access_token>"
```
1. If the training code contains the call to `mlflow.set_tracking_uri()`, remove it.
In the model registry, you can copy the tracking URI from the overflow menu in the top right
by selecting the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
## Model experiments
When running the training code, MLflow client can be used to create experiments, runs,
models, model versions, log parameters, metrics, metadata, and artifacts on GitLab.
After experiments are logged, they are listed under `/<your project>/-/ml/experiments`.
Runs are registered and can be explored by selecting an experiment, model, or model version.
### Creating an experiment
```python
import mlflow
# Create a new experiment
experiment_id = mlflow.create_experiment(name="<your_experiment>")
# Setting the active experiment also creates a new experiment if it doesn't exist.
mlflow.set_experiment(experiment_name="<your_experiment>")
```
### Creating a run
```python
import mlflow
# Creating a run requires an experiment ID or an active experiment
mlflow.set_experiment(experiment_name="<your_experiment>")
# Runs can be created with or without a context manager
with mlflow.start_run() as run:
print(run.info.run_id)
# Your training code
with mlflow.start_run():
# Your training code
```
### Logging parameters and metrics
```python
import mlflow
mlflow.set_experiment(experiment_name="<your_experiment>")
with mlflow.start_run():
# Parameter keys need to be unique in the scope of the run
mlflow.log_param(key="param_1", value=1)
# Metrics can be updated throughout the run
mlflow.log_metric(key="metrics_1", value=1)
mlflow.log_metric(key="metrics_1", value=2)
```
### Logging artifacts
```python
import mlflow
mlflow.set_experiment(experiment_name="<your_experiment>")
with mlflow.start_run():
# Plaintext text files can be logged as artifacts using `log_text`
mlflow.log_text('Hello, World!', artifact_file='hello.txt')
mlflow.log_artifact(
local_path='<local/path/to/file.txt>',
artifact_path='<optional relative path to log the artifact at>'
)
```
### Logging models
Models can be logged using one of the supported [MLflow Model flavors](https://mlflow.org/docs/latest/models.html#built-in-model-flavors).
Logging with a model flavor records the metadata, making it easier to manage, load, and deploy models across different tools and environments.
```python
import mlflow
from sklearn.ensemble import RandomForestClassifier
mlflow.set_experiment(experiment_name="<your_experiment>")
with mlflow.start_run():
# Create and train a simple model
model = RandomForestClassifier(n_estimators=10, random_state=42)
model.fit(X_train, y_train)
# Log the model using MLflow sklearn mode flavour
mlflow.sklearn.log_model(model, artifact_path="")
```
### Loading a run
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/509595) in GitLab 17.9.
{{< /history >}}
You can load a run from the GitLab model registry to, for example, make predictions.
```python
import mlflow
import mlflow.pyfunc
run_id = "<your_run_id>"
download_path = "models" # Local folder to download to
mlflow.pyfunc.load_model(f"runs:/{run_id}/", dst_path=download_path)
sample_input = [[1,0,3,4],[2,0,1,2]]
model.predict(data=sample_input)
```
### Associating a run to a CI/CD job
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119454) in GitLab 16.1.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/9423) to beta in GitLab 17.1.
{{< /history >}}
If your training code is being run from a CI/CD job, GitLab can use that information to enhance
run metadata. To associate a run to a CI/CD job:
1. In the [Project CI variables](../../../../ci/variables/_index.md), include the following variables:
- `MLFLOW_TRACKING_URI`: `"<your gitlab endpoint>/api/v4/projects/<your project id>/ml/mlflow"`
- `MLFLOW_TRACKING_TOKEN`: `<your_access_token>`
1. In your training code within the run execution context, add the following code snippet:
```python
import os
import mlflow
with mlflow.start_run(run_name=f"Run {index}"):
# Your training code
# Start of snippet to be included
if os.getenv('GITLAB_CI'):
mlflow.set_tag('gitlab.CI_JOB_ID', os.getenv('CI_JOB_ID'))
# End of snippet to be included
```
## Model registry
You can also manage models and model versions by using the MLflow
client. Models are registered under `/<your project>/-/ml/models`.
### Models
#### Creating a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
description = 'Model description'
model = client.create_registered_model(model_name, description=description)
```
**Notes**
- `create_registered_model` argument `tags` is ignored.
- `name` must be unique within the project.
- `name` cannot be the name of an existing experiment.
#### Fetching a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
model = client.get_registered_model(model_name)
```
#### Updating a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
description = 'New description'
client.update_registered_model(model_name, description=description)
```
#### Deleting a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
client.delete_registered_model(model_name)
```
### Logging runs to a model
Every model has an associated experiment with the same name prefixed by `[model]`.
To log a run to the model, use the experiment passing the correct name:
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
exp = client.get_experiment_by_name(f"[model]{model_name}")
run = client.create_run(exp.experiment_id)
```
### Model version
#### Creating a model version
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
description = 'Model version description'
model_version = client.create_model_version(model_name, source="", description=description)
```
If the version parameter is not passed, it will be auto-incremented from the latest uploaded
version. You can set the version by passing a tag during model version creation. The version
must follow [SemVer](https://semver.org/) format.
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
tags = { "gitlab.version": version }
client.create_model_version(model_name, version, description=description, tags=tags)
```
**Notes**
- Argument `run_id` is ignored. Every model version behaves as a run. Creating a mode version from a run is not yet supported.
- Argument `source` is ignored. GitLab will create a package location for the model version files.
- Argument `run_link` is ignored.
- Argument `await_creation_for` is ignored.
#### Updating a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
description = 'New description'
client.update_model_version(model_name, version, description=description)
```
#### Fetching a model version
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
client.get_model_version(model_name, version)
```
#### Getting latest versions of a model
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
client.get_latest_versions(model_name)
```
**Notes**
- Argument `stages` is ignored.
- Versions are ordered by highest semantic version.
#### Loading a model version
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version' # for example: '1.0.0'
# Alternatively search the version
version = mlflow.search_registered_models(filter_string="name='{model_name}'")[0].latest_versions[0].version
model = mlflow.pyfunc.load_model(f"models:/{model_name}/{latest_version}")
# Or load the latest version
model = mlflow.pyfunc.load_model(f"models:/{model_name}/latest")
```
#### Logging metrics and parameters to a model version
Every model version is also a run, allowing users to log parameters
and metrics. The run ID can either be found at the Model version page in GitLab,
or by using the MLflow client:
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
model_version = client.get_model_version(model_name, version)
run_id = model_version.run_id
# Your training code
client.log_metric(run_id, '<metric_name>', '<metric_value>')
client.log_param(run_id, '<param_name>', '<param_value>')
client.log_batch(run_id, metric_list, param_list, tag_list)
```
Because each file has a size limit of 5 GB, you must partition larger models.
#### Logging artifacts to a model version
GitLab creates a package that can be used by the MLflow client to upload files.
```python
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
model_version = client.get_model_version(model_name, version)
run_id = model_version.run_id
# Your training code
client.log_artifact(run_id, '<local/path/to/file.txt>', artifact_path="")
client.log_figure(run_id, figure, artifact_file="my_plot.png")
client.log_dict(run_id, my_dict, artifact_file="my_dict.json")
client.log_image(run_id, image, artifact_file="image.png")
```
Artifacts will then be available under `https/<your project>/-/ml/models/<model_id>/versions/<version_id>`.
#### Linking a model version to a CI/CD job
Similar to runs, it is also possible to link a model version to a CI/CD job:
```python
import os
from mlflow import MlflowClient
client = MlflowClient()
model_name = '<your_model_name>'
version = '<your_version>'
model_version = client.get_model_version(model_name, version)
run_id = model_version.run_id
# Your training code
if os.getenv('GITLAB_CI'):
client.set_tag(model_version.run_id, 'gitlab.CI_JOB_ID', os.getenv('CI_JOB_ID'))
```
## Supported MLflow client methods and caveats
GitLab supports the following methods from the MLflow client. More information can be found in the [MLflow Documentation](https://mlflow.org/docs/latest/index.html). The MlflowClient counterparts
of the methods below are also supported with the same caveats.
| Method | Supported | Version Added | Comments |
|--------------------------|-----------------|---------------|----------------------------------------------------------------------------------------------|
| `create_experiment` | Yes | 15.11 | |
| `get_experiment` | Yes | 15.11 | |
| `get_experiment_by_name` | Yes | 15.11 | |
| `delete_experiment` | Yes | 17.5 | |
| `set_experiment` | Yes | 15.11 | |
| `get_run` | Yes | 15.11 | |
| `delete_run` | Yes | 17.5 | |
| `start_run` | Yes | 15.11 | (16.3) If a name is not provided, the run receives a random nickname. |
| `search_runs` | Yes | 15.11 | (16.4) `experiment_ids` supports only a single experiment ID with order by column or metric. |
| `log_artifact` | Yes with caveat | 15.11 | (15.11) `artifact_path` must be empty. Does not support directories. |
| `log_artifacts` | Yes with caveat | 15.11 | (15.11) `artifact_path` must be empty. Does not support directories. |
| `log_batch` | Yes | 15.11 | |
| `log_metric` | Yes | 15.11 | |
| `log_metrics` | Yes | 15.11 | |
| `log_param` | Yes | 15.11 | |
| `log_params` | Yes | 15.11 | |
| `log_figure` | Yes | 15.11 | |
| `log_image` | Yes | 15.11 | |
| `log_text` | Yes with caveat | 15.11 | (15.11) Does not support directories. |
| `log_dict` | Yes with caveat | 15.11 | (15.11) Does not support directories. |
| `set_tag` | Yes | 15.11 | |
| `set_tags` | Yes | 15.11 | |
| `set_terminated` | Yes | 15.11 | |
| `end_run` | Yes | 15.11 | |
| `update_run` | Yes | 15.11 | |
| `log_model` | Partial | 15.11 | (15.11) Saves the artifacts, but not the model data. `artifact_path` must be empty. |
| `load_model` | Yes | 17.5 | |
| `download_artifacts` | Yes | 17.9 | |
| `list_artifacts` | Yes | 17.9 | |
Other MLflowClient methods:
| Method | Supported | Version added | Comments |
|---------------------------|------------------|---------------|--------------------------------------------------|
| `create_registered_model` | Yes with caveats | 16.8 | [See notes](#creating-a-model) |
| `get_registered_model` | Yes | 16.8 | |
| `delete_registered_model` | Yes | 16.8 | |
| `update_registered_model` | Yes | 16.8 | |
| `create_model_version` | Yes with caveats | 16.8 | [See notes](#creating-a-model-version) |
| `get_model_version` | Yes | 16.8 | |
| `get_latest_versions` | Yes with caveats | 16.8 | [See notes](#getting-latest-versions-of-a-model) |
| `update_model_version` | Yes | 16.8 | |
| `create_registered_model` | Yes | 16.8 | |
| `create_registered_model` | Yes | 16.8 | |
## Known issues
- MLflow client methods not listed in [supported methods](#supported-mlflow-client-methods-and-caveats) might still work but have not been tested.
- During creation of experiments and runs, ExperimentTags are stored, even though they are not displayed.
|
https://docs.gitlab.com/user/project/ml/experiment_tracking
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/ml/_index.md
|
2025-08-13
|
doc/user/project/ml/experiment_tracking
|
[
"doc",
"user",
"project",
"ml",
"experiment_tracking"
] |
_index.md
|
ModelOps
|
MLOps
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Machine learning model experiments
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9341) in GitLab 15.11.
- [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/9341) in GitLab 17.8.
{{< /history >}}
As you create machine learning models, you likely experiment with different parameters, configurations,
and feature engineering to improve the model's performance. To replicate your experiments later, you need
to effectively track the metadata and artifacts. Use GitLab model experiments to track and log parameters,
metrics, and artifacts directly into GitLab.
## What is an experiment?
In a project, an experiment is a collection of comparable model runs.
Experiments can be long-lived (for example, when they represent a use case), or
short-lived (results from hyperparameter tuning triggered by a merge request),
but usually hold model runs that have a similar set of parameters measured
by the same metrics.

## Model run
A model run is a variation of the training of a machine learning model, that can be eventually promoted to a version
of the model.

The goal of a data scientist is to find the model run whose parameter values lead to the best model
performance, as indicated by the given metrics.

Some example parameters:
- Algorithm (such as linear regression or decision tree).
- Hyperparameters for the algorithm (learning rate, tree depth, number of epochs).
- Features included.
## Track new experiments and runs
Experiment and trials can only be tracked through the
[MLflow](https://www.mlflow.org/docs/latest/tracking.html) client compatibility.
See [MLflow client compatibility](mlflow_client.md) for more information
on how to use GitLab as a backend for the MLflow Client.
## Explore model runs
To list the current active experiments, either go to `https/-/ml/experiments` or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Analyze > Model experiments**.
1. To display all runs that have been logged, along with their metrics, parameters, and metadata, select an experiment.
1. To display details for a run, select **Details**.
## View log artifacts
Trial artifacts are saved as packages. After an artifact is logged for a run, all artifacts logged for the run are listed in the package registry. The package name for a run is `ml_experiment_<experiment_id>`, where the version is the run IID. The link to the artifacts can also be accessed from the **Experiment Runs** list or **Run detail**.
## View CI information
You can associate runs to the CI job that created them, allowing quick links to the merge request, pipeline, and user that triggered the pipeline:

## View logged metrics
When you run an experiment, GitLab logs certain related data, including its metrics, parameters, and metadata. You can view the metrics in a chart for analysis.
To view logged metrics:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Analyze > Model experiments**.
1. Select the experiment you want to view.
1. Select the **Performance** tab.

|
---
stage: ModelOps
group: MLOps
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Machine learning model experiments
breadcrumbs:
- doc
- user
- project
- ml
- experiment_tracking
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9341) in GitLab 15.11.
- [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/9341) in GitLab 17.8.
{{< /history >}}
As you create machine learning models, you likely experiment with different parameters, configurations,
and feature engineering to improve the model's performance. To replicate your experiments later, you need
to effectively track the metadata and artifacts. Use GitLab model experiments to track and log parameters,
metrics, and artifacts directly into GitLab.
## What is an experiment?
In a project, an experiment is a collection of comparable model runs.
Experiments can be long-lived (for example, when they represent a use case), or
short-lived (results from hyperparameter tuning triggered by a merge request),
but usually hold model runs that have a similar set of parameters measured
by the same metrics.

## Model run
A model run is a variation of the training of a machine learning model, that can be eventually promoted to a version
of the model.

The goal of a data scientist is to find the model run whose parameter values lead to the best model
performance, as indicated by the given metrics.

Some example parameters:
- Algorithm (such as linear regression or decision tree).
- Hyperparameters for the algorithm (learning rate, tree depth, number of epochs).
- Features included.
## Track new experiments and runs
Experiment and trials can only be tracked through the
[MLflow](https://www.mlflow.org/docs/latest/tracking.html) client compatibility.
See [MLflow client compatibility](mlflow_client.md) for more information
on how to use GitLab as a backend for the MLflow Client.
## Explore model runs
To list the current active experiments, either go to `https/-/ml/experiments` or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Analyze > Model experiments**.
1. To display all runs that have been logged, along with their metrics, parameters, and metadata, select an experiment.
1. To display details for a run, select **Details**.
## View log artifacts
Trial artifacts are saved as packages. After an artifact is logged for a run, all artifacts logged for the run are listed in the package registry. The package name for a run is `ml_experiment_<experiment_id>`, where the version is the run IID. The link to the artifacts can also be accessed from the **Experiment Runs** list or **Run detail**.
## View CI information
You can associate runs to the CI job that created them, allowing quick links to the merge request, pipeline, and user that triggered the pipeline:

## View logged metrics
When you run an experiment, GitLab logs certain related data, including its metrics, parameters, and metadata. You can view the metrics in a chart for analysis.
To view logged metrics:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Analyze > Model experiments**.
1. Select the experiment you want to view.
1. Select the **Performance** tab.

|
https://docs.gitlab.com/user/project/release_cli
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/release_cli.md
|
2025-08-13
|
doc/user/project/releases
|
[
"doc",
"user",
"project",
"releases"
] |
release_cli.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Release CLI tool
| null |
**The `release-cli` is in maintenance mode**.
The `release-cli` does not accept new features.
All new feature development happens in the `glab` CLI,
so you should use the [`glab` CLI](../../../editor_extensions/gitlab_cli/_index.md) whenever possible.
You can use [the feedback issue](https://gitlab.com/gitlab-org/cli/-/issues/7859) to share any comments.
## Switch from `release-cli` to `glab` CLI
- For API usage details, see [the `glab` CLI project documentation](https://gitlab.com/gitlab-org/cli).
- With a CI/CD job and the [`release`](../../../ci/yaml/_index.md#release) keyword,
change the job's `image` to use the `cli:latest` image. For example:
```yaml
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Running the release job."
release:
tag_name: $CI_COMMIT_TAG
name: 'Release $CI_COMMIT_TAG'
description: 'Release created using the cli.'
```
## Fall back to `release-cli`
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/524346) in GitLab 18.0, [with a flag](../../../administration/feature_flags/_index.md) named `ci_glab_for_release`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
CI/CD jobs that use the `release` keyword use a script that falls back to using `release-cli`
if the required `glab` version is not available on the runner. The fallback logic
is a safe-guard to ensure that projects that have not yet migrated to use `glab` CLI
can continue working.
This fallback is [scheduled to be removed](https://gitlab.com/gitlab-org/gitlab/-/issues/537919)
in GitLab 19.0 with the removal of `release-cli`.
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Release CLI tool
breadcrumbs:
- doc
- user
- project
- releases
---
**The `release-cli` is in maintenance mode**.
The `release-cli` does not accept new features.
All new feature development happens in the `glab` CLI,
so you should use the [`glab` CLI](../../../editor_extensions/gitlab_cli/_index.md) whenever possible.
You can use [the feedback issue](https://gitlab.com/gitlab-org/cli/-/issues/7859) to share any comments.
## Switch from `release-cli` to `glab` CLI
- For API usage details, see [the `glab` CLI project documentation](https://gitlab.com/gitlab-org/cli).
- With a CI/CD job and the [`release`](../../../ci/yaml/_index.md#release) keyword,
change the job's `image` to use the `cli:latest` image. For example:
```yaml
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Running the release job."
release:
tag_name: $CI_COMMIT_TAG
name: 'Release $CI_COMMIT_TAG'
description: 'Release created using the cli.'
```
## Fall back to `release-cli`
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/524346) in GitLab 18.0, [with a flag](../../../administration/feature_flags/_index.md) named `ci_glab_for_release`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
CI/CD jobs that use the `release` keyword use a script that falls back to using `release-cli`
if the required `glab` version is not available on the runner. The fallback logic
is a safe-guard to ensure that projects that have not yet migrated to use `glab` CLI
can continue working.
This fallback is [scheduled to be removed](https://gitlab.com/gitlab-org/gitlab/-/issues/537919)
in GitLab 19.0 with the removal of `release-cli`.
|
https://docs.gitlab.com/user/project/release_evidence
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/release_evidence.md
|
2025-08-13
|
doc/user/project/releases
|
[
"doc",
"user",
"project",
"releases"
] |
release_evidence.md
|
Software Supply Chain Security
|
Compliance
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Release evidence
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Each time a release is created, GitLab takes a snapshot of data that's related to it.
This data is saved in a JSON file and called *release evidence*. The feature
includes test artifacts and linked milestones to facilitate
internal processes, like external audits.
To access the release evidence, on the Releases page, select the link to the JSON file that's listed
under the **Evidence collection** heading.
You can also [use the API](../../../api/releases/_index.md#collect-release-evidence) to
generate release evidence for an existing release. Because of this, each release
can have multiple release evidence snapshots. You can view the release evidence and
its details on the Releases page.
When the issue tracker is disabled, release evidence [can't be downloaded](https://gitlab.com/gitlab-org/gitlab/-/issues/208397).
Here is an example of a release evidence object:
```json
{
"release": {
"id": 5,
"tag_name": "v4.0",
"name": "New release",
"project": {
"id": 20,
"name": "Project name",
"created_at": "2019-04-14T11:12:13.940Z",
"description": "Project description"
},
"created_at": "2019-06-28 13:23:40 UTC",
"description": "Release description",
"milestones": [
{
"id": 11,
"title": "v4.0-rc1",
"state": "closed",
"due_date": "2019-05-12 12:00:00 UTC",
"created_at": "2019-04-17 15:45:12 UTC",
"description": "milestone description",
},
{
"id": 12,
"title": "v4.0-rc2",
"state": "closed",
"due_date": "2019-05-30 18:30:00 UTC",
"created_at": "2019-04-17 15:45:12 UTC",
"description": "milestone description",
}
],
"report_artifacts": [
{
"url":"https://gitlab.example.com/root/project-name/-/jobs/111/artifacts/download"
}
]
}
}
```
## Collect release evidence
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When a release is created, release evidence is automatically collected. To initiate evidence collection any other time, use an [API call](../../../api/releases/_index.md#collect-release-evidence). You can collect release evidence multiple times for one release.
Evidence collection snapshots are visible on the Releases page, along with the timestamp the evidence was collected.
## Include report artifacts as release evidence
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you create a release, if [job artifacts](../../../ci/yaml/_index.md#artifactsreports) are included in the last pipeline that ran, they are automatically included in the release as release evidence.
Although job artifacts usually expire, artifacts included in release evidence do not expire.
To enable job artifact collection you must specify both:
1. [`artifacts:paths`](../../../ci/yaml/_index.md#artifactspaths)
1. [`artifacts:reports`](../../../ci/yaml/_index.md#artifactsreports)
```yaml
ruby:
script:
- gem install bundler
- bundle install
- bundle exec rspec --format progress --format RspecJunitFormatter --out rspec.xml
artifacts:
paths:
- rspec.xml
reports:
junit: rspec.xml
```
If the pipeline ran successfully, when you create your release, the `rspec.xml` file is saved as
release evidence.
If you [schedule release evidence collection](#schedule-release-evidence-collection),
some artifacts may already be expired by the time of evidence collection. To avoid this you can use
the [`artifacts:expire_in`](../../../ci/yaml/_index.md#artifactsexpire_in)
keyword. For more information, see [issue 222351](https://gitlab.com/gitlab-org/gitlab/-/issues/222351).
## Schedule release evidence collection
In the API:
- If you specify a future `released_at` date, the release becomes an **Upcoming release**
and the evidence is collected on the date of the release. You cannot collect
release evidence before then.
- If you specify a past `released_at` date, the release becomes an **Historical
release** and no evidence is collected.
- If you do not specify a `released_at` date, release evidence is collected on the
date the release is created.
|
---
stage: Software Supply Chain Security
group: Compliance
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Release evidence
breadcrumbs:
- doc
- user
- project
- releases
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Each time a release is created, GitLab takes a snapshot of data that's related to it.
This data is saved in a JSON file and called *release evidence*. The feature
includes test artifacts and linked milestones to facilitate
internal processes, like external audits.
To access the release evidence, on the Releases page, select the link to the JSON file that's listed
under the **Evidence collection** heading.
You can also [use the API](../../../api/releases/_index.md#collect-release-evidence) to
generate release evidence for an existing release. Because of this, each release
can have multiple release evidence snapshots. You can view the release evidence and
its details on the Releases page.
When the issue tracker is disabled, release evidence [can't be downloaded](https://gitlab.com/gitlab-org/gitlab/-/issues/208397).
Here is an example of a release evidence object:
```json
{
"release": {
"id": 5,
"tag_name": "v4.0",
"name": "New release",
"project": {
"id": 20,
"name": "Project name",
"created_at": "2019-04-14T11:12:13.940Z",
"description": "Project description"
},
"created_at": "2019-06-28 13:23:40 UTC",
"description": "Release description",
"milestones": [
{
"id": 11,
"title": "v4.0-rc1",
"state": "closed",
"due_date": "2019-05-12 12:00:00 UTC",
"created_at": "2019-04-17 15:45:12 UTC",
"description": "milestone description",
},
{
"id": 12,
"title": "v4.0-rc2",
"state": "closed",
"due_date": "2019-05-30 18:30:00 UTC",
"created_at": "2019-04-17 15:45:12 UTC",
"description": "milestone description",
}
],
"report_artifacts": [
{
"url":"https://gitlab.example.com/root/project-name/-/jobs/111/artifacts/download"
}
]
}
}
```
## Collect release evidence
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When a release is created, release evidence is automatically collected. To initiate evidence collection any other time, use an [API call](../../../api/releases/_index.md#collect-release-evidence). You can collect release evidence multiple times for one release.
Evidence collection snapshots are visible on the Releases page, along with the timestamp the evidence was collected.
## Include report artifacts as release evidence
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you create a release, if [job artifacts](../../../ci/yaml/_index.md#artifactsreports) are included in the last pipeline that ran, they are automatically included in the release as release evidence.
Although job artifacts usually expire, artifacts included in release evidence do not expire.
To enable job artifact collection you must specify both:
1. [`artifacts:paths`](../../../ci/yaml/_index.md#artifactspaths)
1. [`artifacts:reports`](../../../ci/yaml/_index.md#artifactsreports)
```yaml
ruby:
script:
- gem install bundler
- bundle install
- bundle exec rspec --format progress --format RspecJunitFormatter --out rspec.xml
artifacts:
paths:
- rspec.xml
reports:
junit: rspec.xml
```
If the pipeline ran successfully, when you create your release, the `rspec.xml` file is saved as
release evidence.
If you [schedule release evidence collection](#schedule-release-evidence-collection),
some artifacts may already be expired by the time of evidence collection. To avoid this you can use
the [`artifacts:expire_in`](../../../ci/yaml/_index.md#artifactsexpire_in)
keyword. For more information, see [issue 222351](https://gitlab.com/gitlab-org/gitlab/-/issues/222351).
## Schedule release evidence collection
In the API:
- If you specify a future `released_at` date, the release becomes an **Upcoming release**
and the evidence is collected on the date of the release. You cannot collect
release evidence before then.
- If you specify a past `released_at` date, the release becomes an **Historical
release** and no evidence is collected.
- If you do not specify a `released_at` date, release evidence is collected on the
date the release is created.
|
https://docs.gitlab.com/user/project/release_cicd_examples
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/release_cicd_examples.md
|
2025-08-13
|
doc/user/project/releases
|
[
"doc",
"user",
"project",
"releases"
] |
release_cicd_examples.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Release CI/CD examples
| null |
GitLab release functionality is flexible, able to be configured to match your workflow. This page
features example CI/CD release jobs. Each example demonstrates a method of creating a release in a
CI/CD pipeline.
## Create a release when a Git tag is created
In this CI/CD example, the release is triggered by one of the following events:
- Pushing a Git tag to the repository.
- Creating a Git tag in the UI.
You can use this method if you prefer to create the Git tag manually, and create a release as a
result.
{{< alert type="note" >}}
Do not provide Release notes when you create the Git tag in the UI. Providing release notes
creates a release, resulting in the pipeline failing.
{{< /alert >}}
Key points in the following extract of an example `.gitlab-ci.yml` file:
- The `rules` stanza defines when the job is added to the pipeline.
- The Git tag is used in the release's name and description.
```yaml
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
```
## Create a release when a commit is merged to the default branch
In this CI/CD example, the release is triggered when you merge a commit to the default branch. You
can use this method if your release workflow does not create a tag manually.
Key points in the following extract of an example `.gitlab-ci.yml` file:
- The Git tag, description, and reference are created automatically in the pipeline.
- If you manually create a tag, the `release_job` job does not run.
```yaml
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "running release_job for $TAG"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: 'v0.$CI_PIPELINE_IID' # The version is incremented per pipeline.
description: 'v0.$CI_PIPELINE_IID'
ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
```
{{< alert type="note" >}}
Environment variables set in `before_script` or `script` are not available for expanding
in the same job. Read more about
[potentially making variables available for expanding](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/6400).
{{< /alert >}}
## Create release metadata in a custom script
In this CI/CD example the release preparation is split into separate jobs for greater flexibility:
- The `prepare_job` job generates the release metadata. Any image can be used to run the job,
including a custom image. The generated metadata is stored in the variable file `variables.env`.
This metadata is [passed to the downstream job](../../../ci/variables/job_scripts.md#pass-an-environment-variable-to-another-job).
- The `release_job` uses the content from the variables file to create a release, using the
metadata passed to it in the variables file. This job must use the
`registry.gitlab.com/gitlab-org/release-cli:latest` image because it contains the release CLI.
```yaml
prepare_job:
stage: prepare # This stage must run before the release stage
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "EXTRA_DESCRIPTION=some message" >> variables.env # Generate the EXTRA_DESCRIPTION and TAG environment variables
- echo "TAG=v$(cat VERSION)" >> variables.env # and append to the variables.env file
artifacts:
reports:
dotenv: variables.env # Use artifacts:reports:dotenv to expose the variables to other jobs
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare_job
artifacts: true
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "running release_job for $TAG"
release:
name: 'Release $TAG'
description: 'Created using the release-cli $EXTRA_DESCRIPTION' # $EXTRA_DESCRIPTION and the $TAG
tag_name: '$TAG' # variables must be defined elsewhere
ref: '$CI_COMMIT_SHA' # in the pipeline. For example, in the
milestones: # prepare_job
- 'm1'
- 'm2'
- 'm3'
released_at: '2020-07-15T08:00:00Z' # Optional, is auto generated if not defined, or can use a variable.
assets:
links:
- name: 'asset1'
url: 'https://example.com/assets/1'
- name: 'asset2'
url: 'https://example.com/assets/2'
filepath: '/pretty/url/1' # optional
link_type: 'other' # optional
```
## Skip multiple pipelines when creating a release
Creating a release using a CI/CD job could potentially trigger multiple pipelines if the associated tag does not exist already. To understand how this might happen, consider the following workflows:
- Tag first, release second:
1. A tag is created from the UI or pushed.
1. A tag pipeline is triggered, and runs `release` job.
1. A release is created.
- Release first, tag second:
1. A pipeline is triggered when commits are pushed or merged to default branch. The pipeline runs `release` job.
1. A release is created.
1. A tag is created.
1. A tag pipeline is triggered. The pipeline also runs `release` job.
In the second workflow, the `release` job runs in multiple pipelines. To prevent this, you can use the [`workflow:rules` keyword](../../../ci/yaml/_index.md#workflowrules) to determine if a release job should run in a tag pipeline:
```yaml
release_job:
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job in a tag pipeline
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "Create release"
release:
name: 'My awesome release'
tag_name: '$CI_COMMIT_TAG'
```
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Release CI/CD examples
breadcrumbs:
- doc
- user
- project
- releases
---
GitLab release functionality is flexible, able to be configured to match your workflow. This page
features example CI/CD release jobs. Each example demonstrates a method of creating a release in a
CI/CD pipeline.
## Create a release when a Git tag is created
In this CI/CD example, the release is triggered by one of the following events:
- Pushing a Git tag to the repository.
- Creating a Git tag in the UI.
You can use this method if you prefer to create the Git tag manually, and create a release as a
result.
{{< alert type="note" >}}
Do not provide Release notes when you create the Git tag in the UI. Providing release notes
creates a release, resulting in the pipeline failing.
{{< /alert >}}
Key points in the following extract of an example `.gitlab-ci.yml` file:
- The `rules` stanza defines when the job is added to the pipeline.
- The Git tag is used in the release's name and description.
```yaml
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
```
## Create a release when a commit is merged to the default branch
In this CI/CD example, the release is triggered when you merge a commit to the default branch. You
can use this method if your release workflow does not create a tag manually.
Key points in the following extract of an example `.gitlab-ci.yml` file:
- The Git tag, description, and reference are created automatically in the pipeline.
- If you manually create a tag, the `release_job` job does not run.
```yaml
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "running release_job for $TAG"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: 'v0.$CI_PIPELINE_IID' # The version is incremented per pipeline.
description: 'v0.$CI_PIPELINE_IID'
ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
```
{{< alert type="note" >}}
Environment variables set in `before_script` or `script` are not available for expanding
in the same job. Read more about
[potentially making variables available for expanding](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/6400).
{{< /alert >}}
## Create release metadata in a custom script
In this CI/CD example the release preparation is split into separate jobs for greater flexibility:
- The `prepare_job` job generates the release metadata. Any image can be used to run the job,
including a custom image. The generated metadata is stored in the variable file `variables.env`.
This metadata is [passed to the downstream job](../../../ci/variables/job_scripts.md#pass-an-environment-variable-to-another-job).
- The `release_job` uses the content from the variables file to create a release, using the
metadata passed to it in the variables file. This job must use the
`registry.gitlab.com/gitlab-org/release-cli:latest` image because it contains the release CLI.
```yaml
prepare_job:
stage: prepare # This stage must run before the release stage
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "EXTRA_DESCRIPTION=some message" >> variables.env # Generate the EXTRA_DESCRIPTION and TAG environment variables
- echo "TAG=v$(cat VERSION)" >> variables.env # and append to the variables.env file
artifacts:
reports:
dotenv: variables.env # Use artifacts:reports:dotenv to expose the variables to other jobs
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare_job
artifacts: true
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "running release_job for $TAG"
release:
name: 'Release $TAG'
description: 'Created using the release-cli $EXTRA_DESCRIPTION' # $EXTRA_DESCRIPTION and the $TAG
tag_name: '$TAG' # variables must be defined elsewhere
ref: '$CI_COMMIT_SHA' # in the pipeline. For example, in the
milestones: # prepare_job
- 'm1'
- 'm2'
- 'm3'
released_at: '2020-07-15T08:00:00Z' # Optional, is auto generated if not defined, or can use a variable.
assets:
links:
- name: 'asset1'
url: 'https://example.com/assets/1'
- name: 'asset2'
url: 'https://example.com/assets/2'
filepath: '/pretty/url/1' # optional
link_type: 'other' # optional
```
## Skip multiple pipelines when creating a release
Creating a release using a CI/CD job could potentially trigger multiple pipelines if the associated tag does not exist already. To understand how this might happen, consider the following workflows:
- Tag first, release second:
1. A tag is created from the UI or pushed.
1. A tag pipeline is triggered, and runs `release` job.
1. A release is created.
- Release first, tag second:
1. A pipeline is triggered when commits are pushed or merged to default branch. The pipeline runs `release` job.
1. A release is created.
1. A tag is created.
1. A tag pipeline is triggered. The pipeline also runs `release` job.
In the second workflow, the `release` job runs in multiple pipelines. To prevent this, you can use the [`workflow:rules` keyword](../../../ci/yaml/_index.md#workflowrules) to determine if a release job should run in a tag pipeline:
```yaml
release_job:
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job in a tag pipeline
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "Create release"
release:
name: 'My awesome release'
tag_name: '$CI_COMMIT_TAG'
```
|
https://docs.gitlab.com/user/project/releases
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/releases
|
[
"doc",
"user",
"project",
"releases"
] |
_index.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Releases
|
Releases, versioning, assets, tags, milestones, and evidence.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Create a release to package your project at critical milestones. Releases combine code, binaries, documentation,
and release notes into a complete snapshot of your project.
When a release is created, GitLab automatically tags your code, archives a snapshot, and generates
audit-ready evidence. This creates a permanent record that's perfect for compliance requirements and
can give your users confidence in your development process.
Your users benefit from:
- Easy access to the latest stable version and installation packages
- Clear documentation about new features and fixes
- Ability to download specific versions with their corresponding assets
- Simple way to track your project's evolution over time
{{< alert type="warning" >}}
Deleting a Git tag associated with a release also deletes the release.
{{< /alert >}}
When you create a release, or after, you can:
- Add release notes.
- Add a message for the Git tag associated with the release.
- [Associate milestones with it](#associate-milestones-with-a-release).
- Attach [release assets](release_fields.md#release-assets), like runbooks or packages.
## View releases
To view a list of releases:
- On the left sidebar, select **Deploy > Releases**, or
- On the project's overview page, if at least one release exists, select the number of releases.

- On public projects, this number is visible to all users.
- On private projects, this number is visible to users with at least the Reporter
[role](../../permissions.md#project-members-permissions).
### Sort releases
To sort releases by **Released date** or **Created date**, select from the sort order dropdown list. To
switch between ascending or descending order, select **Sort order**.

### Permanent link to latest release
You can access the latest release page through a permanent link.
GitLab always redirects the permanent link URL to the address of the latest release page.
The format of the URL is:
```plaintext
https://gitlab.example.com/namespace/project/-/releases/permalink/latest
```
You can also add a suffix to the permanent link URL. For example, if the latest release is `v17.7.0#release` in the `gitlab-org` namespace and `gitlab-runner` project, the readable link would be:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.7.0#release
```
You can access the latest release URL with the following permanent link:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/permalink/latest#release
```
To learn about adding permanent links to release assets, see [Permanent links to latest release assets](release_fields.md#permanent-links-to-latest-release-assets).
#### Sorting preferences
By default, GitLab fetches the release using `released_at` time. The use of the query parameter `?order_by=released_at` is optional, and support for `?order_by=semver` is tracked [in this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/352945).
### Track releases with an RSS feed
GitLab provides an RSS feed of a project's releases, in Atom format. To view the feed:
1. For projects you are a member of:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Releases**.
1. For all projects:
1. Go to the **Project overview** page.
1. On the right sidebar, select **Releases** ({{< icon name="rocket-launch" >}}).
1. In the upper-right corner, select the feed symbol ({{< icon name="rss" >}}).
## Create a release
You can create a release:
- [Using a job in your CI/CD pipeline](#creating-a-release-by-using-a-cicd-job).
- [In the Releases page](#create-a-release-in-the-releases-page).
- Using the [Releases API](../../../api/releases/_index.md#create-a-release).
### Create a release in the Releases page
Prerequisites:
- You must have at least the Developer role for a project. For more information, read
[Release permissions](#release-permissions).
To create a release in the Releases page:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Releases** and select **New release**.
1. From the [**Tag name**](release_fields.md#tag-name) dropdown list, either:
- Select an existing Git tag. Selecting an existing tag that is already associated with a release
results in a validation error.
- Enter a new Git tag name.
1. From the **Create tag** popover, select a branch or commit SHA to use when
creating the new tag.
1. Optional. In the **Set tag message** text box, enter a message to create an
[annotated tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging#_annotated_tags).
1. Select **Save**.
1. Optional. Enter additional information about the release, including:
- [Title](release_fields.md#title).
- [Milestones](#associate-milestones-with-a-release).
- [Release notes](release_fields.md#release-notes-description).
- Whether or not to include the [Tag message](../repository/tags/_index.md).
- [Asset links](release_fields.md#links).
1. Select **Create release**.
### Creating a release by using a CI/CD job
You can create a release directly as part of the GitLab CI/CD pipeline by using the
[`release` keyword](../../../ci/yaml/_index.md#release) in the job definition.
You should likely create a release as one of the last steps in your CI/CD pipeline.
The release is created only if the job processes without error. If the API returns an error during
release creation, the release job fails.
The following links show typical example configurations for creating a release using a CI/CD job:
- [Create a release when a Git tag is created](release_cicd_examples.md#create-a-release-when-a-git-tag-is-created).
- [Create a release when a commit is merged to the default branch](release_cicd_examples.md#create-a-release-when-a-commit-is-merged-to-the-default-branch).
- [Create release metadata in a custom script](release_cicd_examples.md#create-release-metadata-in-a-custom-script).
### Use a custom SSL CA certificate authority
You can use the `ADDITIONAL_CA_CERT_BUNDLE` CI/CD variable to configure a custom SSL CA certificate authority,
which is used to verify the peer when the `release-cli` creates a release through the API using HTTPS with custom certificates.
The `ADDITIONAL_CA_CERT_BUNDLE` value should contain the
[text representation of the X.509 PEM public-key certificate](https://www.rfc-editor.org/rfc/rfc7468#section-5.1)
or the `path/to/file` containing the certificate authority.
For example, to configure this value in the `.gitlab-ci.yml` file, use the following:
```yaml
release:
variables:
ADDITIONAL_CA_CERT_BUNDLE: |
-----BEGIN CERTIFICATE-----
MIIGqTCCBJGgAwIBAgIQI7AVxxVwg2kch4d56XNdDjANBgkqhkiG9w0BAQsFADCB
...
jWgmPqF3vUbZE0EyScetPJquRFRKIesyJuBFMAs=
-----END CERTIFICATE-----
script:
- echo "Create release"
release:
name: 'My awesome release'
tag_name: '$CI_COMMIT_TAG'
```
The `ADDITIONAL_CA_CERT_BUNDLE` value can also be configured as a
[custom variable in the UI](../../../ci/variables/_index.md#for-a-project),
either as a `file`, which requires the path to the certificate, or as a variable,
which requires the text representation of the certificate.
### Create multiple releases in a single pipeline
A pipeline can have multiple `release` jobs, for example:
```yaml
ios-release:
script:
- echo "iOS release job"
release:
tag_name: v1.0.0-ios
description: 'iOS release v1.0.0'
android-release:
script:
- echo "Android release job"
release:
tag_name: v1.0.0-android
description: 'Android release v1.0.0'
```
### Release assets as Generic packages
You can use [Generic packages](../../packages/generic_packages/_index.md) to host your release assets.
For a complete example, see the [Release assets as Generic packages](https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs/examples/release-assets-as-generic-package/)
project.
To create a release with packaged assets:
1. From a CI/CD pipeline, build your package files.
1. Upload the package files to the [generic package repository](../../packages/generic_packages/_index.md):
```yaml
Upload Package:
stage: deploy
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file path/to/your/file \
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${VERSION}/filename
```
1. Create a release with the `release-cli` job:
```yaml
Create Release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create \
--name "Release ${VERSION}" \
--tag-name $CI_COMMIT_TAG \
--description "Your release notes here" \
--assets-link "{\"name\":\"Asset Name\",\"url\":\"${PACKAGE_REGISTRY_URL}/filename\"}"
```
For every asset you want to include, add an additional `--assets-link` link.
## Upcoming releases
You can create a release ahead of time by using the [Releases API](../../../api/releases/_index.md#upcoming-releases).
When you set a future `released_at` date, an **Upcoming Release** badge is displayed next to the
release tag. When the `released_at` date and time has passed, the badge is automatically removed.

## Historical releases
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/199429) in GitLab 15.2.
{{< /history >}}
You can create a release in the past using either the
[Releases API](../../../api/releases/_index.md#historical-releases) or the UI. When you set
a past `released_at` date, an **Historical release** badge is displayed next to
the release tag. Due to being released in the past, [release evidence](release_evidence.md)
is not available.
## Edit a release
To edit the details of a release after it's created, you can use the
[Update a release API](../../../api/releases/_index.md#update-a-release) or the UI.
Prerequisites:
- You must have at least the Developer role.
In the UI:
1. On the left sidebar, select **Deploy > Releases**.
1. In the upper-right corner of the release you want to modify, select **Edit this release** (the pencil icon).
1. On the **Edit Release** page, change the release's details.
1. Select **Save changes**.
## Delete a release
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213862) in GitLab 15.2
{{< /history >}}
When you delete a release, its assets are also deleted. However, the associated
Git tag is not deleted.
Deleting a Git tag associated with a release also deletes the release.
Prerequisites:
- You must have at least the Developer role. Read more about [Release permissions](#release-permissions).
To delete a release, use either the
[Delete a release API](../../../api/releases/_index.md#delete-a-release) or the UI.
In the UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Releases**.
1. In the upper-right corner of the release you want to delete, select **Edit this release**
({{< icon name="pencil" >}}).
1. On the **Edit Release** page, select **Delete**.
1. Select **Delete release**.
## Associate milestones with a release
You can associate a release with one or more [project milestones](../milestones/_index.md#project-milestones-and-group-milestones).
[GitLab Premium](https://about.gitlab.com/pricing/) customers can specify [group milestones](../milestones/_index.md#project-milestones-and-group-milestones) to associate with a release.
You can do this in the user interface, or by including a `milestones` array in your request to
the [Releases API](../../../api/releases/_index.md#create-a-release).
In the user interface, to associate milestones to a release:
1. On the left sidebar, select **Deploy > Releases**.
1. In the upper-right corner of the release you want to modify, select **Edit this release** (the pencil icon).
1. From the **Milestones** list, select each milestone you want to associate. You can select multiple milestones.
1. Select **Save changes**.
On the **Deploy > Releases** page, the **Milestone** is listed in the top
section, along with statistics about the issues in the milestones.

Releases are also visible on the **Plan > Milestones** page, and when you select a milestone
on this page.
Here is an example of milestones with no releases, one release, and two releases.

{{< alert type="note" >}}
A subgroup's project releases cannot be associated with a parent group's milestone. To learn
more, read issue #328054,
[Releases cannot be associated with a supergroup milestone](https://gitlab.com/gitlab-org/gitlab/-/issues/328054).
{{< /alert >}}
## Get notified when a release is created
You can be notified by email when a new release is created for your project.
To subscribe to notifications for releases:
1. On the left sidebar, select **Project overview**.
1. Select **Notification setting** (the bell icon).
1. In the list, select **Custom**.
1. Select the **New release** checkbox.
1. Close the dialog box to save.
## Prevent unintentional releases by setting a deploy freeze
Prevent unintended production releases during a period of time you specify by
setting a [*deploy freeze* period](../../../ci/environments/deployment_safety.md).
Deploy freezes help reduce uncertainty and risk when automating deployments.
A maintainer can set a deploy freeze window in the user interface or by using the [Freeze Periods API](../../../api/freeze_periods.md) to set a `freeze_start` and a `freeze_end`, which
are defined as [crontab](https://crontab.guru/) entries.
If the job that's executing is in a freeze period, GitLab CI/CD creates an environment
variable named `$CI_DEPLOY_FREEZE`.
To prevent the deployment job from executing in multiple projects in a group,
define the `.freezedeployment` job in a file shared across the group.
Use the [`includes`](../../../ci/yaml/includes.md) keyword to incorporate the
template in your project's `.gitlab-ci.yml` file:
```yaml
.freezedeployment:
stage: deploy
before_script:
- '[[ ! -z "$CI_DEPLOY_FREEZE" ]] && echo "INFRASTRUCTURE OUTAGE WINDOW" && exit 1; '
rules:
- if: '$CI_DEPLOY_FREEZE'
when: manual
allow_failure: true
- when: on_success
```
To prevent the deployment job from executing, use the [`extends`](../../../ci/yaml/_index.md#extends) keyword in the `deploy_to_production` job of your `.gitlab-ci.yml` file to inherit the configuration from the `.freezedeployment` template job:
```yaml
deploy_to_production:
extends: .freezedeployment
script: deploy_to_prod.sh
environment: production
```
This configuration blocks deployment jobs conditionally and maintains pipeline continuity. When a freeze period is defined, the job fails and the pipeline can proceed without deployment. Manual deployment is possible after the freeze period.
This approach offers deployment control during critical maintenance, and ensures the uninterrupted flow of the CI/CD pipeline.
To set a deploy freeze window in the UI, complete these steps:
1. Sign in to GitLab as a user with the Maintainer role.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > CI/CD**.
1. Scroll to **Deploy freezes**.
1. Select **Expand** to see the deploy freeze table.
1. Select **Add deploy freeze** to open the deploy freeze modal.
1. Enter the start time, end time, and time zone of the desired deploy freeze period.
1. Select **Add deploy freeze** in the modal.
1. After the deploy freeze is saved, you can edit it by selecting the edit button ({{< icon name="pencil" >}}) and remove it by selecting the delete button ({{< icon name="remove" >}}).

If a project contains multiple freeze periods, all periods apply. If they overlap, the freeze covers the
complete overlapping period.
For more information, see [Deployment safety](../../../ci/environments/deployment_safety.md).
## Release permissions
### View a release and download assets
- Users with at least the Reporter role
have read and download access to the project releases.
- Users with the Guest role
have read and download access to the project releases.
This includes associated Git-tag-names, release description, author information of the releases.
However, other repository-related information, such as [source code](release_fields.md#source-code) and
[release evidence](release_evidence.md) are redacted.
### Publish releases without giving access to source code
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216485) in GitLab 15.6.
{{< /history >}}
You can make releases accessible to non-project members while keeping repository-related information, such as [source code](release_fields.md#source-code) and [release evidence](release_evidence.md), available only to project members. These settings are ideal for
projects that use releases to give access to new versions of software, but do not want the source code to be publicly available.
To make releases available publicly, set the following [project settings](../settings/_index.md#configure-project-features-and-permissions):
- **Project visibility** is set to **Public**
- **Repository** is enabled and set to **Only Project Members**
- **Releases** is enabled and set to **Everyone With Access**
### Create, update, and delete a release and its assets
- Users with at least the Developer role
have write access to the project releases and assets.
- If a release is associated with a [protected tag](../protected_tags.md),
the user must be [allowed to create the protected tag](../protected_tags.md#configuring-protected-tags) too.
As an example of release permission control, you can allow only
users with at least the Maintainer role
to create, update, and delete releases by protecting the tag with a wildcard (`*`),
and set **Maintainer** in the **Allowed to create** column.
## Release Metrics
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/259703) in GitLab Premium 13.9.
{{< /history >}}
Group-level release metrics are available by navigating to **Group > Analytics > CI/CD**.
These metrics include:
- Total number of releases in the group
- Percentage of projects in the group that have at least one release
## Working example project
The Guided Exploration project [Utterly Automated Software and Artifact Versioning with GitVersion](https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning) demonstrates:
- Using GitLab releases.
- Using the GitLab `release-cli`.
- Creating a generic package.
- Linking the package to the release.
- Using a tool called [GitVersion](https://gitversion.net/) to automatically determine and increment versions for complex repositories.
You can copy the example project to your own group or instance for testing. More details on what other GitLab CI patterns are demonstrated are available at the project page.
## Troubleshooting
### Errors when creating, updating or deleting releases and their assets
If the release is associated with a [protected tag](../protected_tags.md),
the UI/API request might result in an authorization failures, such as:
- `403 Forbidden`
- `Something went wrong while creating a new release`
Make sure that the user or a service/bot account is allowed to
[create the protected tag](../protected_tags.md#configuring-protected-tags) too.
See [the release permissions](#release-permissions) for more information.
### Note about storage
This feature is built on top of Git tags, so virtually no extra data is needed besides to create the release itself. Additional assets and the release evidence that is automatically generated consume storage.
### GitLab CLI version requirement
The way of using the [`release` keyword](../../../ci/yaml/_index.md#release) is planned to change.
The `release-cli` tool is [being replaced](https://gitlab.com/groups/gitlab-org/-/epics/15437) by the [GitLab CLI tool](https://gitlab.com/gitlab-org/cli/).
You must use GitLab CLI tool `v1.58.0` or higher, or you could receive one of these error messages or warnings:
- `Error: glab command not found. Please install glab v1.58.0 or higher.`
- `Error: Please use glab v1.58.0 or higher.`
- `Warning: release-cli will not be supported after 19.0. Please use glab version >= 1.58.0.`
There are two ways to have the GitLab CLI tool:
- If you use the `registry.gitlab.com/gitlab-org/release-cli:<version>` container image,
you can start using either `registry.gitlab.com/gitlab-org/cli:v1.58.0` or
`registry.gitlab.com/gitlab-org/release-cli:v0.24.0`, which contains `glab` `v1.58.0`.
- If you manually installed the release-cli or GitLab CLI tool on your runners,
make sure the GitLab CLI version is at least `v1.58.0`.
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Releases
description: Releases, versioning, assets, tags, milestones, and evidence.
breadcrumbs:
- doc
- user
- project
- releases
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Create a release to package your project at critical milestones. Releases combine code, binaries, documentation,
and release notes into a complete snapshot of your project.
When a release is created, GitLab automatically tags your code, archives a snapshot, and generates
audit-ready evidence. This creates a permanent record that's perfect for compliance requirements and
can give your users confidence in your development process.
Your users benefit from:
- Easy access to the latest stable version and installation packages
- Clear documentation about new features and fixes
- Ability to download specific versions with their corresponding assets
- Simple way to track your project's evolution over time
{{< alert type="warning" >}}
Deleting a Git tag associated with a release also deletes the release.
{{< /alert >}}
When you create a release, or after, you can:
- Add release notes.
- Add a message for the Git tag associated with the release.
- [Associate milestones with it](#associate-milestones-with-a-release).
- Attach [release assets](release_fields.md#release-assets), like runbooks or packages.
## View releases
To view a list of releases:
- On the left sidebar, select **Deploy > Releases**, or
- On the project's overview page, if at least one release exists, select the number of releases.

- On public projects, this number is visible to all users.
- On private projects, this number is visible to users with at least the Reporter
[role](../../permissions.md#project-members-permissions).
### Sort releases
To sort releases by **Released date** or **Created date**, select from the sort order dropdown list. To
switch between ascending or descending order, select **Sort order**.

### Permanent link to latest release
You can access the latest release page through a permanent link.
GitLab always redirects the permanent link URL to the address of the latest release page.
The format of the URL is:
```plaintext
https://gitlab.example.com/namespace/project/-/releases/permalink/latest
```
You can also add a suffix to the permanent link URL. For example, if the latest release is `v17.7.0#release` in the `gitlab-org` namespace and `gitlab-runner` project, the readable link would be:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.7.0#release
```
You can access the latest release URL with the following permanent link:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/permalink/latest#release
```
To learn about adding permanent links to release assets, see [Permanent links to latest release assets](release_fields.md#permanent-links-to-latest-release-assets).
#### Sorting preferences
By default, GitLab fetches the release using `released_at` time. The use of the query parameter `?order_by=released_at` is optional, and support for `?order_by=semver` is tracked [in this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/352945).
### Track releases with an RSS feed
GitLab provides an RSS feed of a project's releases, in Atom format. To view the feed:
1. For projects you are a member of:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Releases**.
1. For all projects:
1. Go to the **Project overview** page.
1. On the right sidebar, select **Releases** ({{< icon name="rocket-launch" >}}).
1. In the upper-right corner, select the feed symbol ({{< icon name="rss" >}}).
## Create a release
You can create a release:
- [Using a job in your CI/CD pipeline](#creating-a-release-by-using-a-cicd-job).
- [In the Releases page](#create-a-release-in-the-releases-page).
- Using the [Releases API](../../../api/releases/_index.md#create-a-release).
### Create a release in the Releases page
Prerequisites:
- You must have at least the Developer role for a project. For more information, read
[Release permissions](#release-permissions).
To create a release in the Releases page:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Releases** and select **New release**.
1. From the [**Tag name**](release_fields.md#tag-name) dropdown list, either:
- Select an existing Git tag. Selecting an existing tag that is already associated with a release
results in a validation error.
- Enter a new Git tag name.
1. From the **Create tag** popover, select a branch or commit SHA to use when
creating the new tag.
1. Optional. In the **Set tag message** text box, enter a message to create an
[annotated tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging#_annotated_tags).
1. Select **Save**.
1. Optional. Enter additional information about the release, including:
- [Title](release_fields.md#title).
- [Milestones](#associate-milestones-with-a-release).
- [Release notes](release_fields.md#release-notes-description).
- Whether or not to include the [Tag message](../repository/tags/_index.md).
- [Asset links](release_fields.md#links).
1. Select **Create release**.
### Creating a release by using a CI/CD job
You can create a release directly as part of the GitLab CI/CD pipeline by using the
[`release` keyword](../../../ci/yaml/_index.md#release) in the job definition.
You should likely create a release as one of the last steps in your CI/CD pipeline.
The release is created only if the job processes without error. If the API returns an error during
release creation, the release job fails.
The following links show typical example configurations for creating a release using a CI/CD job:
- [Create a release when a Git tag is created](release_cicd_examples.md#create-a-release-when-a-git-tag-is-created).
- [Create a release when a commit is merged to the default branch](release_cicd_examples.md#create-a-release-when-a-commit-is-merged-to-the-default-branch).
- [Create release metadata in a custom script](release_cicd_examples.md#create-release-metadata-in-a-custom-script).
### Use a custom SSL CA certificate authority
You can use the `ADDITIONAL_CA_CERT_BUNDLE` CI/CD variable to configure a custom SSL CA certificate authority,
which is used to verify the peer when the `release-cli` creates a release through the API using HTTPS with custom certificates.
The `ADDITIONAL_CA_CERT_BUNDLE` value should contain the
[text representation of the X.509 PEM public-key certificate](https://www.rfc-editor.org/rfc/rfc7468#section-5.1)
or the `path/to/file` containing the certificate authority.
For example, to configure this value in the `.gitlab-ci.yml` file, use the following:
```yaml
release:
variables:
ADDITIONAL_CA_CERT_BUNDLE: |
-----BEGIN CERTIFICATE-----
MIIGqTCCBJGgAwIBAgIQI7AVxxVwg2kch4d56XNdDjANBgkqhkiG9w0BAQsFADCB
...
jWgmPqF3vUbZE0EyScetPJquRFRKIesyJuBFMAs=
-----END CERTIFICATE-----
script:
- echo "Create release"
release:
name: 'My awesome release'
tag_name: '$CI_COMMIT_TAG'
```
The `ADDITIONAL_CA_CERT_BUNDLE` value can also be configured as a
[custom variable in the UI](../../../ci/variables/_index.md#for-a-project),
either as a `file`, which requires the path to the certificate, or as a variable,
which requires the text representation of the certificate.
### Create multiple releases in a single pipeline
A pipeline can have multiple `release` jobs, for example:
```yaml
ios-release:
script:
- echo "iOS release job"
release:
tag_name: v1.0.0-ios
description: 'iOS release v1.0.0'
android-release:
script:
- echo "Android release job"
release:
tag_name: v1.0.0-android
description: 'Android release v1.0.0'
```
### Release assets as Generic packages
You can use [Generic packages](../../packages/generic_packages/_index.md) to host your release assets.
For a complete example, see the [Release assets as Generic packages](https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs/examples/release-assets-as-generic-package/)
project.
To create a release with packaged assets:
1. From a CI/CD pipeline, build your package files.
1. Upload the package files to the [generic package repository](../../packages/generic_packages/_index.md):
```yaml
Upload Package:
stage: deploy
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file path/to/your/file \
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${VERSION}/filename
```
1. Create a release with the `release-cli` job:
```yaml
Create Release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create \
--name "Release ${VERSION}" \
--tag-name $CI_COMMIT_TAG \
--description "Your release notes here" \
--assets-link "{\"name\":\"Asset Name\",\"url\":\"${PACKAGE_REGISTRY_URL}/filename\"}"
```
For every asset you want to include, add an additional `--assets-link` link.
## Upcoming releases
You can create a release ahead of time by using the [Releases API](../../../api/releases/_index.md#upcoming-releases).
When you set a future `released_at` date, an **Upcoming Release** badge is displayed next to the
release tag. When the `released_at` date and time has passed, the badge is automatically removed.

## Historical releases
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/199429) in GitLab 15.2.
{{< /history >}}
You can create a release in the past using either the
[Releases API](../../../api/releases/_index.md#historical-releases) or the UI. When you set
a past `released_at` date, an **Historical release** badge is displayed next to
the release tag. Due to being released in the past, [release evidence](release_evidence.md)
is not available.
## Edit a release
To edit the details of a release after it's created, you can use the
[Update a release API](../../../api/releases/_index.md#update-a-release) or the UI.
Prerequisites:
- You must have at least the Developer role.
In the UI:
1. On the left sidebar, select **Deploy > Releases**.
1. In the upper-right corner of the release you want to modify, select **Edit this release** (the pencil icon).
1. On the **Edit Release** page, change the release's details.
1. Select **Save changes**.
## Delete a release
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213862) in GitLab 15.2
{{< /history >}}
When you delete a release, its assets are also deleted. However, the associated
Git tag is not deleted.
Deleting a Git tag associated with a release also deletes the release.
Prerequisites:
- You must have at least the Developer role. Read more about [Release permissions](#release-permissions).
To delete a release, use either the
[Delete a release API](../../../api/releases/_index.md#delete-a-release) or the UI.
In the UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Deploy > Releases**.
1. In the upper-right corner of the release you want to delete, select **Edit this release**
({{< icon name="pencil" >}}).
1. On the **Edit Release** page, select **Delete**.
1. Select **Delete release**.
## Associate milestones with a release
You can associate a release with one or more [project milestones](../milestones/_index.md#project-milestones-and-group-milestones).
[GitLab Premium](https://about.gitlab.com/pricing/) customers can specify [group milestones](../milestones/_index.md#project-milestones-and-group-milestones) to associate with a release.
You can do this in the user interface, or by including a `milestones` array in your request to
the [Releases API](../../../api/releases/_index.md#create-a-release).
In the user interface, to associate milestones to a release:
1. On the left sidebar, select **Deploy > Releases**.
1. In the upper-right corner of the release you want to modify, select **Edit this release** (the pencil icon).
1. From the **Milestones** list, select each milestone you want to associate. You can select multiple milestones.
1. Select **Save changes**.
On the **Deploy > Releases** page, the **Milestone** is listed in the top
section, along with statistics about the issues in the milestones.

Releases are also visible on the **Plan > Milestones** page, and when you select a milestone
on this page.
Here is an example of milestones with no releases, one release, and two releases.

{{< alert type="note" >}}
A subgroup's project releases cannot be associated with a parent group's milestone. To learn
more, read issue #328054,
[Releases cannot be associated with a supergroup milestone](https://gitlab.com/gitlab-org/gitlab/-/issues/328054).
{{< /alert >}}
## Get notified when a release is created
You can be notified by email when a new release is created for your project.
To subscribe to notifications for releases:
1. On the left sidebar, select **Project overview**.
1. Select **Notification setting** (the bell icon).
1. In the list, select **Custom**.
1. Select the **New release** checkbox.
1. Close the dialog box to save.
## Prevent unintentional releases by setting a deploy freeze
Prevent unintended production releases during a period of time you specify by
setting a [*deploy freeze* period](../../../ci/environments/deployment_safety.md).
Deploy freezes help reduce uncertainty and risk when automating deployments.
A maintainer can set a deploy freeze window in the user interface or by using the [Freeze Periods API](../../../api/freeze_periods.md) to set a `freeze_start` and a `freeze_end`, which
are defined as [crontab](https://crontab.guru/) entries.
If the job that's executing is in a freeze period, GitLab CI/CD creates an environment
variable named `$CI_DEPLOY_FREEZE`.
To prevent the deployment job from executing in multiple projects in a group,
define the `.freezedeployment` job in a file shared across the group.
Use the [`includes`](../../../ci/yaml/includes.md) keyword to incorporate the
template in your project's `.gitlab-ci.yml` file:
```yaml
.freezedeployment:
stage: deploy
before_script:
- '[[ ! -z "$CI_DEPLOY_FREEZE" ]] && echo "INFRASTRUCTURE OUTAGE WINDOW" && exit 1; '
rules:
- if: '$CI_DEPLOY_FREEZE'
when: manual
allow_failure: true
- when: on_success
```
To prevent the deployment job from executing, use the [`extends`](../../../ci/yaml/_index.md#extends) keyword in the `deploy_to_production` job of your `.gitlab-ci.yml` file to inherit the configuration from the `.freezedeployment` template job:
```yaml
deploy_to_production:
extends: .freezedeployment
script: deploy_to_prod.sh
environment: production
```
This configuration blocks deployment jobs conditionally and maintains pipeline continuity. When a freeze period is defined, the job fails and the pipeline can proceed without deployment. Manual deployment is possible after the freeze period.
This approach offers deployment control during critical maintenance, and ensures the uninterrupted flow of the CI/CD pipeline.
To set a deploy freeze window in the UI, complete these steps:
1. Sign in to GitLab as a user with the Maintainer role.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > CI/CD**.
1. Scroll to **Deploy freezes**.
1. Select **Expand** to see the deploy freeze table.
1. Select **Add deploy freeze** to open the deploy freeze modal.
1. Enter the start time, end time, and time zone of the desired deploy freeze period.
1. Select **Add deploy freeze** in the modal.
1. After the deploy freeze is saved, you can edit it by selecting the edit button ({{< icon name="pencil" >}}) and remove it by selecting the delete button ({{< icon name="remove" >}}).

If a project contains multiple freeze periods, all periods apply. If they overlap, the freeze covers the
complete overlapping period.
For more information, see [Deployment safety](../../../ci/environments/deployment_safety.md).
## Release permissions
### View a release and download assets
- Users with at least the Reporter role
have read and download access to the project releases.
- Users with the Guest role
have read and download access to the project releases.
This includes associated Git-tag-names, release description, author information of the releases.
However, other repository-related information, such as [source code](release_fields.md#source-code) and
[release evidence](release_evidence.md) are redacted.
### Publish releases without giving access to source code
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216485) in GitLab 15.6.
{{< /history >}}
You can make releases accessible to non-project members while keeping repository-related information, such as [source code](release_fields.md#source-code) and [release evidence](release_evidence.md), available only to project members. These settings are ideal for
projects that use releases to give access to new versions of software, but do not want the source code to be publicly available.
To make releases available publicly, set the following [project settings](../settings/_index.md#configure-project-features-and-permissions):
- **Project visibility** is set to **Public**
- **Repository** is enabled and set to **Only Project Members**
- **Releases** is enabled and set to **Everyone With Access**
### Create, update, and delete a release and its assets
- Users with at least the Developer role
have write access to the project releases and assets.
- If a release is associated with a [protected tag](../protected_tags.md),
the user must be [allowed to create the protected tag](../protected_tags.md#configuring-protected-tags) too.
As an example of release permission control, you can allow only
users with at least the Maintainer role
to create, update, and delete releases by protecting the tag with a wildcard (`*`),
and set **Maintainer** in the **Allowed to create** column.
## Release Metrics
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/259703) in GitLab Premium 13.9.
{{< /history >}}
Group-level release metrics are available by navigating to **Group > Analytics > CI/CD**.
These metrics include:
- Total number of releases in the group
- Percentage of projects in the group that have at least one release
## Working example project
The Guided Exploration project [Utterly Automated Software and Artifact Versioning with GitVersion](https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning) demonstrates:
- Using GitLab releases.
- Using the GitLab `release-cli`.
- Creating a generic package.
- Linking the package to the release.
- Using a tool called [GitVersion](https://gitversion.net/) to automatically determine and increment versions for complex repositories.
You can copy the example project to your own group or instance for testing. More details on what other GitLab CI patterns are demonstrated are available at the project page.
## Troubleshooting
### Errors when creating, updating or deleting releases and their assets
If the release is associated with a [protected tag](../protected_tags.md),
the UI/API request might result in an authorization failures, such as:
- `403 Forbidden`
- `Something went wrong while creating a new release`
Make sure that the user or a service/bot account is allowed to
[create the protected tag](../protected_tags.md#configuring-protected-tags) too.
See [the release permissions](#release-permissions) for more information.
### Note about storage
This feature is built on top of Git tags, so virtually no extra data is needed besides to create the release itself. Additional assets and the release evidence that is automatically generated consume storage.
### GitLab CLI version requirement
The way of using the [`release` keyword](../../../ci/yaml/_index.md#release) is planned to change.
The `release-cli` tool is [being replaced](https://gitlab.com/groups/gitlab-org/-/epics/15437) by the [GitLab CLI tool](https://gitlab.com/gitlab-org/cli/).
You must use GitLab CLI tool `v1.58.0` or higher, or you could receive one of these error messages or warnings:
- `Error: glab command not found. Please install glab v1.58.0 or higher.`
- `Error: Please use glab v1.58.0 or higher.`
- `Warning: release-cli will not be supported after 19.0. Please use glab version >= 1.58.0.`
There are two ways to have the GitLab CLI tool:
- If you use the `registry.gitlab.com/gitlab-org/release-cli:<version>` container image,
you can start using either `registry.gitlab.com/gitlab-org/cli:v1.58.0` or
`registry.gitlab.com/gitlab-org/release-cli:v0.24.0`, which contains `glab` `v1.58.0`.
- If you manually installed the release-cli or GitLab CLI tool on your runners,
make sure the GitLab CLI version is at least `v1.58.0`.
|
https://docs.gitlab.com/user/project/release_fields
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/release_fields.md
|
2025-08-13
|
doc/user/project/releases
|
[
"doc",
"user",
"project",
"releases"
] |
release_fields.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Release fields
| null |
The following fields are available when you create or edit a release.
## Title
The release title can be customized using the **Release title** field when
creating or editing a release. If no title is provided, the release's tag name
is used instead.
## Tag name
The release tag name should include the release version. GitLab uses [Semantic Versioning](https://semver.org/)
for our releases, and we recommend you do too. Use `(Major).(Minor).(Patch)`, as detailed in the
[GitLab Policy for Versioning](../../../policy/maintenance.md#versioning).
For example, for GitLab version `16.1.1`:
- `16` represents the major version. The major release was `16.0.0`, but often referred to as `16.0`.
- `10` represents the minor version. The minor release was `16.1.0`, but often referred to as `16.1`.
- `1` represents the patch number.
Any part of the version number can be multiple digits, for example, `16.10.11`.
## Release notes description
Every release has a description. You can add any text you like, but we recommend
including a changelog to describe the content of your release. This helps users
quickly scan the differences between each release you publish.
[Tagging messages in Git](https://git-scm.com/book/en/v2/Git-Basics-Tagging) can
be included in Release note descriptions by selecting **Include tag message in
the release notes**.
Description supports [Markdown](../../markdown.md).
## Release assets
A release contains the following types of assets:
- [Source code](#source-code)
- [Link](#links)
### Source code
GitLab automatically generates `zip`, `tar.gz`, `tar.bz2`, and `tar`
archived source code from the given Git tag. These assets are read-only,
and [can be downloaded](../repository/_index.md#download-repository-source-code).
### Links
A link is any URL which can point to whatever you like: documentation, built
binaries, or other related materials. These can be both internal or external
links from your GitLab instance.
Each link as an asset has the following attributes:
| Attribute | Description | Required |
|-------------|--------------------------------------------------------------------------------------------------------------|----------|
| `name` | The name of the link. | Yes |
| `url` | The URL to download a file. | Yes |
| `filepath` | The redirect link to the `url`. Must start with a slash (`/`). See [this section](#permanent-links-to-release-assets) for more information. | No |
| `link_type` | The content kind of what users can download with `url`. See [this section](#link-types) for more information. | No |
#### Permanent links to release assets
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/375489) in GitLab 15.9, links for private releases can be accessed using a personal access token.
{{< /history >}}
The assets associated with a release are accessible through a permanent URL.
GitLab always redirects this URL to the actual asset
location, so even if the assets move to a different location, you can continue
to use the same URL. This is defined during [link creation](../../../api/releases/links.md#create-a-release-link) or [updating](../../../api/releases/links.md#update-a-release-link) using the `filepath` API attribute.
The format of the URL is:
```plaintext
https://host/namespace/project/-/releases/:release/downloads:filepath
```
If you have an asset for the `v16.9.0-rc2` release in the `gitlab-org`
namespace and `gitlab-runner` project on `gitlab.com`, for example:
```json
{
"name": "linux amd64",
"filepath": "/binaries/gitlab-runner-linux-amd64",
"url": "https://gitlab-runner-downloads.s3.amazonaws.com/v16.9.0-rc2/binaries/gitlab-runner-linux-amd64",
"link_type": "other"
}
```
This asset has a direct link of:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.9.0-rc2/downloads/binaries/gitlab-runner-linux-amd64
```
The physical location of the asset can change at any time and the direct link remains unchanged.
If the release is private, you need to provide a personal access token with either `api` or `read_api` scopes using
a `private_token` query parameter or a `HTTP_PRIVATE_TOKEN` header when making the request. For example:
```shell
curl --location --output filename "https://gitlab.example.com/my-group/my-project/-/releases/myrelease/downloads</path-to-file>?private_token=<your_access_token>"
curl --location --output filename --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/my-group/my-project/-/releases/myrelease/downloads</path-to-file>
```
#### Permanent links to latest release assets
You can use the `filepath` from [permanent links to release assets](#permanent-links-to-release-assets) in combination with a [permanent link to the latest release](_index.md#permanent-link-to-latest-release). The `filepath` must start with a slash (`/`).
The format of the URL is:
```plaintext
https://host/namespace/project/-/releases/permalink/latest/downloads:filepath
```
You can use this format to provide a permanent link to an asset from the latest release.
If you have an asset with [`filepath`](../../../api/releases/links.md#create-a-release-link) for the `v16.9.0-rc2` latest release in the `gitlab-org`
namespace and `gitlab-runner` project on `gitlab.com`, for example:
```json
{
"name": "linux amd64",
"filepath": "/binaries/gitlab-runner-linux-amd64",
"url": "https://gitlab-runner-downloads.s3.amazonaws.com/v16.9.0-rc2/binaries/gitlab-runner-linux-amd64",
"link_type": "other"
}
```
This asset has a direct link of:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/permalink/latest/downloads/binaries/gitlab-runner-linux-amd64
```
#### Link Types
The four types of links are "Runbook," "Package," "Image," and "Other."
The `link_type` parameter accepts one of the following four values:
- `runbook`
- `package`
- `image`
- `other` (default)
This field has no effect on the URL and it's only used for visual purposes in the Releases page of your project.
#### Use a generic package for attaching binaries
You can use [generic packages](../../packages/generic_packages/_index.md)
to store any artifacts from a release or tag pipeline,
that can also be used for attaching binary files to an individual release entry.
You basically need to:
1. [Push the artifacts to the Generic package registry](../../packages/generic_packages/_index.md#publish-a-package).
1. [Attach the package link to the release](#links).
The following example generates release assets, publishes them
as a generic package, and then creates a release:
```yaml
stages:
- build
- upload
- release
variables:
# Package version can only contain numbers (0-9), and dots (.).
# Must be in the format of X.Y.Z, and should match the /\A\d+\.\d+\.\d+\z/ regular expression.
# See https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-package-file
PACKAGE_VERSION: "1.2.3"
DARWIN_AMD64_BINARY: "myawesomerelease-darwin-amd64-${PACKAGE_VERSION}"
LINUX_AMD64_BINARY: "myawesomerelease-linux-amd64-${PACKAGE_VERSION}"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/myawesomerelease/${PACKAGE_VERSION}"
build:
stage: build
image: alpine:latest
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir bin
- echo "Mock binary for ${DARWIN_AMD64_BINARY}" > bin/${DARWIN_AMD64_BINARY}
- echo "Mock binary for ${LINUX_AMD64_BINARY}" > bin/${LINUX_AMD64_BINARY}
artifacts:
paths:
- bin/
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${DARWIN_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}"
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${LINUX_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}"
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"${DARWIN_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}\"}" \
--assets-link "{\"name\":\"${LINUX_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}\"}"
```
PowerShell users may need to escape the double quote `"` inside a JSON
string with a `` ` `` (back tick) for `--assets-link` and `ConvertTo-Json`
before passing on to the `release-cli`.
For example:
```yaml
release:
script:
- $env:asset = "{`"name`":`"MyFooAsset`",`"url`":`"https://gitlab.com/upack/artifacts/download/$env:UPACK_GROUP/$env:UPACK_NAME/$($env:GitVersion_SemVer)?contentOnly=zip`"}"
- $env:assetjson = $env:asset | ConvertTo-Json
- release-cli create --name $CI_COMMIT_TAG --description "Release $CI_COMMIT_TAG" --ref $CI_COMMIT_TAG --tag-name $CI_COMMIT_TAG --assets-link=$env:assetjson
```
{{< alert type="note" >}}
Directly attaching [job artifacts](../../../ci/jobs/job_artifacts.md)
links to a release is not recommended, because artifacts are ephemeral and
are used to pass data in the same pipeline. This means there's a risk that
they could either expire or someone might manually delete them.
{{< /alert >}}
### Number of new and total features
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
On [GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/releases), you can view the number of new and total features in the project.

The totals are displayed on [shields](https://shields.io/) and are generated per release by
[a Rake task in the `www-gitlab-com` repository](https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/lib/tasks/update_gitlab_project_releases_page.rake).
| Item | Formula |
|------------------|------------------------------------------------------------------------------------|
| `New features` | Total count of release posts across all tiers for a single release in the project. |
| `Total features` | Total count of release posts in reverse order for all releases in the project. |
The counts are also shown by license tier.
| Item | Formula |
|------------------|-----------------------------------------------------------------------------------------------------|
| `New features` | Total count of release posts across a single tier for a single release in the project. |
| `Total features` | Total count of release posts across a single tier in reverse order for all releases in the project. |
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Release fields
breadcrumbs:
- doc
- user
- project
- releases
---
The following fields are available when you create or edit a release.
## Title
The release title can be customized using the **Release title** field when
creating or editing a release. If no title is provided, the release's tag name
is used instead.
## Tag name
The release tag name should include the release version. GitLab uses [Semantic Versioning](https://semver.org/)
for our releases, and we recommend you do too. Use `(Major).(Minor).(Patch)`, as detailed in the
[GitLab Policy for Versioning](../../../policy/maintenance.md#versioning).
For example, for GitLab version `16.1.1`:
- `16` represents the major version. The major release was `16.0.0`, but often referred to as `16.0`.
- `10` represents the minor version. The minor release was `16.1.0`, but often referred to as `16.1`.
- `1` represents the patch number.
Any part of the version number can be multiple digits, for example, `16.10.11`.
## Release notes description
Every release has a description. You can add any text you like, but we recommend
including a changelog to describe the content of your release. This helps users
quickly scan the differences between each release you publish.
[Tagging messages in Git](https://git-scm.com/book/en/v2/Git-Basics-Tagging) can
be included in Release note descriptions by selecting **Include tag message in
the release notes**.
Description supports [Markdown](../../markdown.md).
## Release assets
A release contains the following types of assets:
- [Source code](#source-code)
- [Link](#links)
### Source code
GitLab automatically generates `zip`, `tar.gz`, `tar.bz2`, and `tar`
archived source code from the given Git tag. These assets are read-only,
and [can be downloaded](../repository/_index.md#download-repository-source-code).
### Links
A link is any URL which can point to whatever you like: documentation, built
binaries, or other related materials. These can be both internal or external
links from your GitLab instance.
Each link as an asset has the following attributes:
| Attribute | Description | Required |
|-------------|--------------------------------------------------------------------------------------------------------------|----------|
| `name` | The name of the link. | Yes |
| `url` | The URL to download a file. | Yes |
| `filepath` | The redirect link to the `url`. Must start with a slash (`/`). See [this section](#permanent-links-to-release-assets) for more information. | No |
| `link_type` | The content kind of what users can download with `url`. See [this section](#link-types) for more information. | No |
#### Permanent links to release assets
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/375489) in GitLab 15.9, links for private releases can be accessed using a personal access token.
{{< /history >}}
The assets associated with a release are accessible through a permanent URL.
GitLab always redirects this URL to the actual asset
location, so even if the assets move to a different location, you can continue
to use the same URL. This is defined during [link creation](../../../api/releases/links.md#create-a-release-link) or [updating](../../../api/releases/links.md#update-a-release-link) using the `filepath` API attribute.
The format of the URL is:
```plaintext
https://host/namespace/project/-/releases/:release/downloads:filepath
```
If you have an asset for the `v16.9.0-rc2` release in the `gitlab-org`
namespace and `gitlab-runner` project on `gitlab.com`, for example:
```json
{
"name": "linux amd64",
"filepath": "/binaries/gitlab-runner-linux-amd64",
"url": "https://gitlab-runner-downloads.s3.amazonaws.com/v16.9.0-rc2/binaries/gitlab-runner-linux-amd64",
"link_type": "other"
}
```
This asset has a direct link of:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.9.0-rc2/downloads/binaries/gitlab-runner-linux-amd64
```
The physical location of the asset can change at any time and the direct link remains unchanged.
If the release is private, you need to provide a personal access token with either `api` or `read_api` scopes using
a `private_token` query parameter or a `HTTP_PRIVATE_TOKEN` header when making the request. For example:
```shell
curl --location --output filename "https://gitlab.example.com/my-group/my-project/-/releases/myrelease/downloads</path-to-file>?private_token=<your_access_token>"
curl --location --output filename --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/my-group/my-project/-/releases/myrelease/downloads</path-to-file>
```
#### Permanent links to latest release assets
You can use the `filepath` from [permanent links to release assets](#permanent-links-to-release-assets) in combination with a [permanent link to the latest release](_index.md#permanent-link-to-latest-release). The `filepath` must start with a slash (`/`).
The format of the URL is:
```plaintext
https://host/namespace/project/-/releases/permalink/latest/downloads:filepath
```
You can use this format to provide a permanent link to an asset from the latest release.
If you have an asset with [`filepath`](../../../api/releases/links.md#create-a-release-link) for the `v16.9.0-rc2` latest release in the `gitlab-org`
namespace and `gitlab-runner` project on `gitlab.com`, for example:
```json
{
"name": "linux amd64",
"filepath": "/binaries/gitlab-runner-linux-amd64",
"url": "https://gitlab-runner-downloads.s3.amazonaws.com/v16.9.0-rc2/binaries/gitlab-runner-linux-amd64",
"link_type": "other"
}
```
This asset has a direct link of:
```plaintext
https://gitlab.com/gitlab-org/gitlab-runner/-/releases/permalink/latest/downloads/binaries/gitlab-runner-linux-amd64
```
#### Link Types
The four types of links are "Runbook," "Package," "Image," and "Other."
The `link_type` parameter accepts one of the following four values:
- `runbook`
- `package`
- `image`
- `other` (default)
This field has no effect on the URL and it's only used for visual purposes in the Releases page of your project.
#### Use a generic package for attaching binaries
You can use [generic packages](../../packages/generic_packages/_index.md)
to store any artifacts from a release or tag pipeline,
that can also be used for attaching binary files to an individual release entry.
You basically need to:
1. [Push the artifacts to the Generic package registry](../../packages/generic_packages/_index.md#publish-a-package).
1. [Attach the package link to the release](#links).
The following example generates release assets, publishes them
as a generic package, and then creates a release:
```yaml
stages:
- build
- upload
- release
variables:
# Package version can only contain numbers (0-9), and dots (.).
# Must be in the format of X.Y.Z, and should match the /\A\d+\.\d+\.\d+\z/ regular expression.
# See https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-package-file
PACKAGE_VERSION: "1.2.3"
DARWIN_AMD64_BINARY: "myawesomerelease-darwin-amd64-${PACKAGE_VERSION}"
LINUX_AMD64_BINARY: "myawesomerelease-linux-amd64-${PACKAGE_VERSION}"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/myawesomerelease/${PACKAGE_VERSION}"
build:
stage: build
image: alpine:latest
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir bin
- echo "Mock binary for ${DARWIN_AMD64_BINARY}" > bin/${DARWIN_AMD64_BINARY}
- echo "Mock binary for ${LINUX_AMD64_BINARY}" > bin/${LINUX_AMD64_BINARY}
artifacts:
paths:
- bin/
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${DARWIN_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}"
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${LINUX_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}"
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"${DARWIN_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}\"}" \
--assets-link "{\"name\":\"${LINUX_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}\"}"
```
PowerShell users may need to escape the double quote `"` inside a JSON
string with a `` ` `` (back tick) for `--assets-link` and `ConvertTo-Json`
before passing on to the `release-cli`.
For example:
```yaml
release:
script:
- $env:asset = "{`"name`":`"MyFooAsset`",`"url`":`"https://gitlab.com/upack/artifacts/download/$env:UPACK_GROUP/$env:UPACK_NAME/$($env:GitVersion_SemVer)?contentOnly=zip`"}"
- $env:assetjson = $env:asset | ConvertTo-Json
- release-cli create --name $CI_COMMIT_TAG --description "Release $CI_COMMIT_TAG" --ref $CI_COMMIT_TAG --tag-name $CI_COMMIT_TAG --assets-link=$env:assetjson
```
{{< alert type="note" >}}
Directly attaching [job artifacts](../../../ci/jobs/job_artifacts.md)
links to a release is not recommended, because artifacts are ephemeral and
are used to pass data in the same pipeline. This means there's a risk that
they could either expire or someone might manually delete them.
{{< /alert >}}
### Number of new and total features
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
On [GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/releases), you can view the number of new and total features in the project.

The totals are displayed on [shields](https://shields.io/) and are generated per release by
[a Rake task in the `www-gitlab-com` repository](https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/lib/tasks/update_gitlab_project_releases_page.rake).
| Item | Formula |
|------------------|------------------------------------------------------------------------------------|
| `New features` | Total count of release posts across all tiers for a single release in the project. |
| `Total features` | Total count of release posts in reverse order for all releases in the project. |
The counts are also shown by license tier.
| Item | Formula |
|------------------|-----------------------------------------------------------------------------------------------------|
| `New features` | Total count of release posts across a single tier for a single release in the project. |
| `Total features` | Total count of release posts across a single tier in reverse order for all releases in the project. |
|
https://docs.gitlab.com/user/project/manifest
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/manifest.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
manifest.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import multiple repositories by uploading a manifest file
|
Import multiple repositories to GitLab with manifest files.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
{{< /history >}}
GitLab allows you to import all the required Git repositories
based on a manifest file like the one used by the
[Android repository](https://android.googlesource.com/platform/manifest/+/2d6f081a3b05d8ef7a2b1b52b0d536b2b74feab4/default.xml).
Use the manifest to import a project with many
repositories like the Android Open Source Project (AOSP).
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Manifest import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Manifest import source is enabled
by default on GitLab.com.
- GitLab must use PostgreSQL for its database, because [subgroups](../../group/subgroups/_index.md) are needed for the manifest import
to work. Read more about the [database requirements](../../../install/requirements.md#postgresql).
- At least the Maintainer role on the destination group to import to.
## Manifest format
A manifest must be an XML file up to 1 MB in size. There must be one `remote` tag with a `review`
attribute that contains a URL to a Git server, and each `project` tag must have
a `name` and `path` attribute. GitLab then builds the URL to the repository
by combining the URL from the `remote` tag with a project name.
A path attribute is used to represent the project path in GitLab.
Below is a valid example of a manifest file:
```xml
<manifest>
<remote review="https://android.googlesource.com/" />
<project path="build/make" name="platform/build" />
<project path="build/blueprint" name="platform/build/blueprint" />
</manifest>
```
As a result, the following projects are created:
| GitLab | Import URL |
|:------------------------------------------------|:------------------------------------------------------------|
| `https://gitlab.com/YOUR_GROUP/build/make` | <https://android.googlesource.com/platform/build> |
| `https://gitlab.com/YOUR_GROUP/build/blueprint` | <https://android.googlesource.com/platform/build/blueprint> |
## Import the repositories
To start the import:
1. From your GitLab dashboard select **New project**.
1. Switch to the **Import project** tab.
1. Select **Manifest file**.
1. Provide GitLab with a manifest XML file.
1. Select a group you want to import to (you need to create a group first if you don't have one).
1. Select **List available repositories**. At this point, you are redirected
to the import status page with projects list based on the manifest file.
1. To import:
- All projects for the first time: Select **Import all repositories**.
- Individual projects again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import multiple repositories by uploading a manifest file
description: Import multiple repositories to GitLab with manifest files.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
{{< /history >}}
GitLab allows you to import all the required Git repositories
based on a manifest file like the one used by the
[Android repository](https://android.googlesource.com/platform/manifest/+/2d6f081a3b05d8ef7a2b1b52b0d536b2b74feab4/default.xml).
Use the manifest to import a project with many
repositories like the Android Open Source Project (AOSP).
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Manifest import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Manifest import source is enabled
by default on GitLab.com.
- GitLab must use PostgreSQL for its database, because [subgroups](../../group/subgroups/_index.md) are needed for the manifest import
to work. Read more about the [database requirements](../../../install/requirements.md#postgresql).
- At least the Maintainer role on the destination group to import to.
## Manifest format
A manifest must be an XML file up to 1 MB in size. There must be one `remote` tag with a `review`
attribute that contains a URL to a Git server, and each `project` tag must have
a `name` and `path` attribute. GitLab then builds the URL to the repository
by combining the URL from the `remote` tag with a project name.
A path attribute is used to represent the project path in GitLab.
Below is a valid example of a manifest file:
```xml
<manifest>
<remote review="https://android.googlesource.com/" />
<project path="build/make" name="platform/build" />
<project path="build/blueprint" name="platform/build/blueprint" />
</manifest>
```
As a result, the following projects are created:
| GitLab | Import URL |
|:------------------------------------------------|:------------------------------------------------------------|
| `https://gitlab.com/YOUR_GROUP/build/make` | <https://android.googlesource.com/platform/build> |
| `https://gitlab.com/YOUR_GROUP/build/blueprint` | <https://android.googlesource.com/platform/build/blueprint> |
## Import the repositories
To start the import:
1. From your GitLab dashboard select **New project**.
1. Switch to the **Import project** tab.
1. Select **Manifest file**.
1. Provide GitLab with a manifest XML file.
1. Select a group you want to import to (you need to create a group first if you don't have one).
1. Select **List available repositories**. At this point, you are redirected
to the import status page with projects list based on the manifest file.
1. To import:
- All projects for the first time: Select **Import all repositories**.
- Individual projects again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
|
https://docs.gitlab.com/user/project/import
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
_index.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import and migrate groups and projects
|
Repository migration, third-party repositories, and user contribution mapping.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Bring your existing work into GitLab and preserve your contribution history.
Consolidate projects from multiple platforms or transfer data between GitLab instances.
GitLab offers different methods to:
- Migrate GitLab groups and projects by using direct transfer.
- Import projects from a variety of supported sources.
## Migrate from GitLab to GitLab by using direct transfer
The best way to copy GitLab groups and projects between GitLab instances, or in the same GitLab instance, is
[by using direct transfer](../../group/import/_index.md).
Another option is to move GitLab groups using [group transfer](../../group/manage.md#transfer-a-group).
You can also copy GitLab projects by using a GitLab file export, which is a supported import source.
## Supported import sources
{{< history >}}
- All importers default to disabled for GitLab Self-Managed instances. This change was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118970) in GitLab 16.0.
{{< /history >}}
The import sources that are available to you by default depend on which GitLab you use:
- GitLab.com: all available import sources are [enabled by default](../../gitlab_com/_index.md#default-import-sources).
- GitLab Self-Managed: no import sources are enabled by default and must be
[enabled](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources).
GitLab can import projects from these supported import sources.
| Import source | Description |
|:----------------------------------------------|:------------|
| [Bitbucket Cloud](bitbucket.md) | Using [Bitbucket.org as an OmniAuth provider](../../../integration/bitbucket.md), import Bitbucket repositories. |
| [Bitbucket Server](bitbucket_server.md) | Import repositories from Bitbucket Server (also known as Stash). |
| [FogBugz](fogbugz.md) | Import FogBugz projects. |
| [Gitea](gitea.md) | Import Gitea projects. |
| [GitHub](github.md) | Import from either GitHub.com or GitHub Enterprise. |
| [GitLab export](../settings/import_export.md) | Migrate projects one by one by using a GitLab export file. |
| [Manifest file](manifest.md) | Upload a manifest file. |
| [Repository by URL](repo_by_url.md) | Provide a Git repository URL to create a new project from. |
After you start a migration, you should not make any changes to imported groups or projects
on the source instance because these changes might not be copied to the destination instance.
### Disable unused import sources
Only import projects from sources you trust. If you import a project from an untrusted source,
an attacker could steal your sensitive data. For example, an imported project
with a malicious `.gitlab-ci.yml` file could allow an attacker to exfiltrate group CI/CD variables.
GitLab Self-Managed administrators can reduce their attack surface by disabling import sources they don't need:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > General**.
1. Expand **Import and export settings**.
1. Scroll to **Import sources**.
1. Clear checkboxes for importers that are not required.
## Other import sources
You can also read information on importing from these other import sources:
- [ClearCase](clearcase.md)
- [Concurrent Versions System (CVS)](cvs.md)
- [Jira (issues only)](jira.md)
- [Perforce Helix](perforce.md)
- [Team Foundation Version Control (TFVC)](tfvc.md)
### Import repositories from Subversion
GitLab can not automatically migrate Subversion repositories to Git. Converting Subversion repositories to Git can be
difficult, but several tools exist including:
- [`git svn`](https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git), for very small and basic repositories.
- [`reposurgeon`](http://www.catb.org/~esr/reposurgeon/repository-editing.html), for larger and more complex repositories.
## User contribution and membership mapping
{{< details >}}
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/443557) in GitLab 17.4 for direct transfer [with flags](../../../administration/feature_flags/_index.md) named `importer_user_mapping` and `bulk_import_importer_user_mapping`. Disabled by default.
- Introduced in GitLab 17.6 for [Gitea](https://gitlab.com/gitlab-org/gitlab/-/issues/467084) [with flags](../../../administration/feature_flags/_index.md) named `importer_user_mapping` and `gitea_user_mapping`, and for [GitHub](https://gitlab.com/gitlab-org/gitlab/-/issues/466355) with flags named `importer_user_mapping` and `github_user_mapping`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/466356) in GitLab 17.7 for Bitbucket Server [with flags](../../../administration/feature_flags/_index.md) named `importer_user_mapping` and `bitbucket_server_user_mapping`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/472735) in GitLab 17.7 for direct transfer.
- Enabled on GitLab.com in GitLab 17.7 for [Bitbucket Server](https://gitlab.com/gitlab-org/gitlab/-/issues/509897), [Gitea](https://gitlab.com/gitlab-org/gitlab/-/issues/498390), and [GitHub](https://gitlab.com/gitlab-org/gitlab/-/issues/499993).
- Enabled on GitLab Self-Managed in GitLab 17.8 for [Bitbucket Server](https://gitlab.com/gitlab-org/gitlab/-/issues/509897), [Gitea](https://gitlab.com/gitlab-org/gitlab/-/issues/498390), and [GitHub](https://gitlab.com/gitlab-org/gitlab/-/issues/499993).
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by feature flags.
For more information, see the history.
{{< /alert >}}
{{< alert type="note" >}}
To leave feedback about this feature, add a comment to [issue 502565](https://gitlab.com/gitlab-org/gitlab/-/issues/502565).
{{< /alert >}}
This method of user contribution and membership mapping is available by default for
[direct transfer](../../group/import/_index.md), [GitHub importer](github.md),
[Bitbucket Server importer](bitbucket_server.md), and [Gitea importer](gitea.md) on
GitLab.com and GitLab Self-Managed.
For information on the other method available for GitLab Self-Managed with disabled feature flags,
see the documentation for each importer.
Any memberships and contributions you import are first mapped to [placeholder users](#placeholder-users).
These placeholders are created on the destination instance even if
users with the same email addresses exist on the source instance.
Until you reassign contributions on the destination instance,
all contributions display as associated with placeholders.
{{< alert type="note" >}}
Contributions from a deleted user on the source instance are
mapped automatically to that user on the destination instance.
{{< /alert >}}
After the import has completed, you can:
- Reassign memberships and contributions to existing users on the destination instance
after you review the results.
You can map memberships and contributions for users with different email addresses
on source and destination instances.
- Create new users on the destination instance to reassign memberships and contributions to.
When you reassign contributions to a user on the destination instance, the user can
[accept](#accept-contribution-reassignment) or [reject](#reject-contribution-reassignment) the reassignment.
When the user accepts the reassignment:
- Contributions are reassigned. This process might take a few minutes.
- In subsequent imports from the same source instance to the same top-level group or subgroup
on the destination instance, contributions are mapped automatically to the user.
[In GitLab 18.0 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/510673), if your top-level group
has at least one [enterprise user](../../enterprise_user/_index.md), you can reassign contributions
only to enterprise users in your organization in the UI or by using a CSV file.
This feature is meant to prevent accidental reassignment to users outside your organization.
{{< alert type="note" >}}
When you use a supported method to import projects to a
[personal namespace](../../namespace/_index.md#types-of-namespaces),
user contribution mapping is not supported.
When you import to a personal namespace, all contributions are assigned to
a single non-functional user called `Import User` and they cannot be reassigned.
[Issue 525342](https://gitlab.com/gitlab-org/gitlab/-/issues/525342) proposes to map all contributions to the importing user instead.
{{< /alert >}}
### Requirements
- You must be able to create enough users, subject to [user limits](#placeholder-user-limits).
- If you import to GitLab.com, you must set up your paid namespace before the import.
- If you import to GitLab.com and use [SAML SSO for GitLab.com groups](../../group/saml_sso/_index.md),
all users must link their SAML identity to their GitLab.com account before you can
[reassign contributions and memberships](#reassign-contributions-and-memberships).
### Placeholder users
Instead of immediately assigning contributions and memberships to users on the destination instance, a
placeholder user is created for any active, inactive, or bot user with imported contributions or memberships.
For deleted users on the source instance, placeholders are created
without all [placeholder user attributes](#placeholder-user-attributes).
You should [keep these users as placeholders](#keep-as-placeholder).
For more information, see [issue 506432](https://gitlab.com/gitlab-org/gitlab/-/issues/506432).
Both contributions and memberships are first assigned to these placeholder users and can be reassigned after import
to existing users on the destination instance.
Until they are reassigned, contributions display as associated with the placeholder. Placeholder memberships
do not display in member lists.
Placeholder users do not count towards license limits.
#### Exceptions
A placeholder user is created for each user on the source instance, except in the following scenarios:
- You're importing a project from [Gitea](gitea.md), and the user was deleted on Gitea before the import.
Contributions from these users are mapped to the user who imported the project, not to a placeholder user.
- You have exceeded your [placeholder user limit](#placeholder-user-limits). Contributions from any new users after exceeding your limit are
mapped to a single non-functional user called `Import User`.
- You are importing to a [personal namespace](../../namespace/_index.md#types-of-namespaces).
Contributions are assigned to a single non-functional user called `Import User`.
[Issue 525342](https://gitlab.com/gitlab-org/gitlab/-/issues/525342) proposes to map all contributions to the importing user instead.
#### Placeholder user attributes
Placeholder users are different to regular users and cannot:
- Sign in.
- Perform any actions. For example, running pipelines.
- Appear in suggestions as assignees or reviewers for issues and merge requests.
- Be members of projects and groups.
To maintain a connection with a user on a source instance, placeholder users have:
- A unique identifier (`source_user_id`) used by the import process to determine if a new placeholder user is required.
- A source hostname or domain (`source_hostname`).
- A source user's name (`source_name`) to help with reassignment of contributions.
- A source user's username (`source_username`) to facilitate group owners during the reassignment of the contribution.
- An import type (`import_type`) to distinguish which importer created the placeholder.
- A timestamp of when the source user was created (`created_at`) in local time for migration tracking
([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/507297) in GitLab 17.10).
To preserve historical context, the placeholder user name and username are derived from the source user name and username:
- Placeholder user's name is `Placeholder <source user name>`.
- Placeholder user's username is `%{source_username}_placeholder_user_%{incremental_number}`.
#### View placeholder users
Prerequisites:
- You must have the Owner role for the group.
Placeholder users are created on the destination instance while a group or project is imported.
To view placeholder users created during imports to a top-level group and its subgroups:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
#### Filter for placeholder users
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/521974) in GitLab 17.11.
{{< /history >}}
Prerequisites:
- You must have administrator access to the instance.
Placeholder users are created on the destination instance while a group or project is imported.
To filter for placeholder users created during imports for an entire instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Overview > Users**.
1. In the search box, filter users by **type**.
#### Creating placeholder users
Placeholder users are created per [import source](#supported-import-sources) and per top-level group:
- If you import the same project twice to the same top-level group on the destination instance, the second import uses
the same placeholder users as the first import.
- If you import the same project twice, but to a different top-level group on the destination instance, the second import
creates new placeholder users under that top-level group.
{{< alert type="note" >}}
Placeholder users are associated only with the top-level group.
When you delete a subgroup or project, their placeholder users
no longer reference any contributions in the top-level group.
For testing, you should use a designated top-level group.
Deleting placeholder users is proposed in [issue 519391](https://gitlab.com/gitlab-org/gitlab/-/issues/519391)
and [issue 537340](https://gitlab.com/gitlab-org/gitlab/-/issues/537340).
{{< /alert >}}
When a user [accepts the reassignment](#accept-contribution-reassignment),
subsequent imports from the same source instance to the same top-level group or
subgroup on the destination instance do not create placeholder users.
Instead, contributions are mapped automatically to the user.
#### Placeholder user deletion
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/473256) in GitLab 18.0.
{{< /history >}}
When you delete a top-level group that contains placeholder users,
these users are automatically scheduled for removal.
This process might take some time to complete.
However, placeholder users remain in the system if
they're also associated with other projects or groups.
{{< alert type="note" >}}
There is no other way to delete placeholder users, but support for improvements is proposed in
[issue 519391](https://gitlab.com/gitlab-org/gitlab/-/issues/519391) and
[issue 537340](https://gitlab.com/gitlab-org/gitlab/-/issues/537340).
{{< /alert >}}
#### Placeholder user limits
If importing to GitLab.com, placeholder users are limited per top-level group on the destination instance. The limits differ depending on your plan and seat count. Placeholder users do not count towards license limits.
| GitLab.com plan | Number of seats | Placeholder user limit on top-level group |
|:-------------------------|:----------------|:------------------------------------------|
| Free and any trial | Any amount | 200 |
| Premium | < 100 | 500 |
| Premium | 101-500 | 2000 |
| Premium | 501 - 1000 | 4000 |
| Premium | > 1000 | 6000 |
| Ultimate and open source | < 100 | 1000 |
| Ultimate and open source | 101-500 | 4000 |
| Ultimate and open source | 501 - 1000 | 6000 |
| Ultimate and open source | > 1000 | 8000 |
For GitLab Self-Managed and GitLab Dedicated, no placeholder limits apply by default.
A GitLab administrator can [set a placeholder limit](../../../administration/instance_limits.md#import-placeholder-user-limits) on their instance.
To view your current placeholder user usage and limits:
1. On the left sidebar, select **Search or go to** and
find your group. This group must be at the top level.
1. Select **Settings > Usage quotas**.
1. Select the **Import** tab.
You cannot determine the number of placeholder users you need in advance.
When the placeholder user limit is reached, all contributions
are assigned to a single non-functional user called `Import User`.
Contributions assigned to `Import User` might be deduplicated,
and some contributions might not be created during the import.
For example, if multiple approvals from a merge request approver are assigned
to `Import User`, only the first approval is created and the others are ignored.
The contributions that might be deduplicated are:
- Approval rules
- Emoji reactions
- Issue assignees
- Memberships
- Merge request approvals, assignees, and reviewers
- Push, merge request, and deploy access levels
Every change creates a system note, which is not affected by the placeholder user limit.
### Reassign contributions and memberships
Users with the Owner role for a top-level group can reassign contributions and memberships
from placeholder users to existing active non-bot users.
On the destination instance, users with the Owner role for a top-level group can:
- Request users to review reassignment of contributions and memberships [in the UI](#request-reassignment-in-ui)
or [through a CSV file](#request-reassignment-by-using-a-csv-file).
For a large number of placeholder users, you should use a CSV file.
In both cases, users receive a request by email to accept or reject the reassignment.
The reassignment starts only after the selected user
[accepts the reassignment request](#accept-contribution-reassignment).
- Choose not to reassign contributions and memberships and [keep them assigned to placeholder users](#keep-as-placeholder).
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
#### Reassigning contributions from multiple placeholder users
All the contributions initially assigned to a single placeholder user can only be reassigned to a single active regular
user on the destination instance. The contributions assigned to a single placeholder user cannot be split among multiple
active regular users.
You can reassign contributions from multiple placeholder users to the same user
on the destination instance if the placeholder users are from:
- Different source instances
- The same source instance and are imported to different top-level groups on the destination instance
If an assigned user becomes inactive before accepting the reassignment request,
the pending reassignment remains linked to the user until they accept it.
Bot user contributions and memberships on the source instance cannot be reassigned to bot users on the destination instance.
You might choose to keep source bot user contributions [assigned to a placeholder user](#keep-as-placeholder).
Users that receive a reassignment request can:
- [Accept the request](#accept-contribution-reassignment). All contributions and membership previously attributed to the placeholder user are re-attributed
to the accepting user. This process can take a few minutes, depending on the number of contributions.
- [Reject the request](#reject-contribution-reassignment) or report it as spam. This option is available in the reassignment
request email.
In subsequent imports to the same top-level group, contributions and memberships that belong to the same source user
are mapped automatically to the user who previously accepted reassignments for that source user.
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
#### Completing the reassignment
The reassignment process must be fully completed before you:
- [Move an imported group in the same GitLab instance](../../group/manage.md#transfer-a-group).
- [Move an imported project to a different group](../settings/migrate_projects.md).
- Duplicate an imported issue.
- Promote an imported issue to an epic.
If the process isn't complete, contributions still assigned to placeholder users cannot be reassigned to real users and
they stay associated with placeholder users.
#### Security considerations
Contribution and membership reassignment cannot be undone, so check everything carefully before you start.
Reassigning contributions and membership to an incorrect user poses a security threat, because the user becomes a member
of your group. They can, therefore, view information they should not be able to see.
Reassigning contributions to users with administrator access is disabled by default, but you can
[enable](../../../administration/settings/import_and_export_settings.md#allow-contribution-mapping-to-administrators) it.
##### Membership security considerations
Because of the GitLab permissions model, when a group or project is imported into an existing parent group, members of
the parent group are granted [inherited membership](../members/_index.md#membership-types) of the imported group or project.
Selecting a user for contribution and membership reassignment who already has an
existing inherited membership of the imported group or project can affect how memberships
are reassigned to them.
GitLab does not allow a membership in a child project or group to have a lower role
than an inherited membership. If an imported membership for an assigned user has a lower role
than their existing inherited membership, the imported membership is not reassigned to the user.
This results in their membership for the imported group or project being higher than it was on the source.
#### Request reassignment in UI
Prerequisites:
- You must have the Owner role for the group.
You can reassign contributions and memberships in the top-level group.
To request reassignment of contributions and memberships:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. For each placeholder, review information in table columns **Placeholder user** and **Source**.
1. In the **Reassign placeholder to** column, select the a user from the dropdown list.
1. Select **Reassign**.
Contributions of only one placeholder user can be reassigned to an active non-bot user on destination instance.
Before a user accepts the reassignment, you can [cancel the request](#cancel-reassignment-request).
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
#### Request reassignment by using a CSV file
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/455901) in GitLab 17.10 [with a flag](../../../administration/feature_flags/_index.md) named `importer_user_mapping_reassignment_csv`. Enabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/478022) in GitLab 18.0. Feature flag `importer_user_mapping_reassignment_csv` removed.
{{< /history >}}
Prerequisites:
- You must have the Owner role for the group.
For a large number of placeholder users, you might want to
reassign contributions and memberships by using a CSV file.
You can download a prefilled CSV template with the following information.
For example:
| Source host | Import type | Source user identifier | Source user name | Source username |
|----------------------|-------------|------------------------|------------------|-----------------|
| `gitlab.example.com` | `gitlab` | `alice` | `Alice Coder` | `a.coer` |
Do not update **Source host**, **Import type**, or **Source user identifier**.
This information locates the corresponding database record
after you've uploaded the completed CSV file.
**Source user name** and **Source username** identify the source user
and are not used after you've uploaded the CSV file.
You do not have to update every row of the CSV file.
Only rows with **GitLab username** or **GitLab public email** are processed.
All other rows are skipped.
To request reassignment of contributions and memberships by using a CSV file:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Select **Reassign with CSV**.
1. Download the prefilled CSV template.
1. In **GitLab username** or **GitLab public email**, enter the username or public email address
of the GitLab user on the destination instance.
Instance administrators can reassign users with any confirmed email address.
1. Upload the completed CSV file.
1. Select **Reassign**.
You can assign only contributions from a single placeholder user
to each active non-bot user on the destination instance.
Users receive an email to review and [accept any contributions](#accept-contribution-reassignment) you've reassigned to them.
You can [cancel the reassignment request](#cancel-reassignment-request) before the user reviews it.
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
After you reassign contributions, GitLab sends you an email with the number of:
- Successfully processed rows
- Unsuccessfully processed rows
- Skipped rows
If any rows have not been successfully processed, the email has a CSV file with more detailed results.
To reassign placeholder users in bulk without using the UI,
see [Group placeholder reassignments API](../../../api/group_placeholder_reassignments.md).
#### Keep as placeholder
You might not want to reassign contributions and memberships to users on the destination instance. For example, you
might have former employees that contributed on the source instance, but they do not exist as users on the destination
instance.
In these cases, you can keep the contributions assigned to placeholder users. Placeholder users do not keep
membership information because they [cannot be members of projects or groups](#placeholder-user-attributes).
Because names and usernames of placeholder users resemble names and usernames of source users, you keep a lot of
historical context.
Remember that if you keep remaining placeholder users as placeholders, you cannot reassign their contributions to
actual users later. Ensure all required reassignments are completed before keeping the remaining placeholder users as
placeholders.
You can keep contributions assigned to placeholder users either one at a time or in bulk.
When you reassign contributions in bulk, the entire namespace and users with the following
[reassignment statuses](#view-and-filter-by-reassignment-status) are affected:
- `Not started`
- `Rejected`
To keep placeholder users one at a time:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. Find placeholder user you want to keep by reviewing **Placeholder user** and **Source** columns.
1. In **Reassign placeholder to** column, select **Do not reassign**.
1. Select **Confirm**.
To keep placeholder users in bulk:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Above the list, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **Keep all as placeholders**.
1. On the confirmation dialog, select **Confirm**.
#### Cancel reassignment request
Before a user accepts a reassignment request, you can cancel the request:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. Select **Cancel** in the correct row.
#### Notify user again about pending reassignment requests
If a user is not acting on a reassignment request, you can prompt them again by sending another email:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. Select **Notify** in the correct row.
#### View and filter by reassignment status
To view the reassignment status of all placeholder users:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. See the status of each placeholder user in **Reassignment status** column.
In the **Awaiting reassignment** tab, possible statuses are:
- `Not started` - Reassignment has not started.
- `Pending approval` - Reassignment is waiting on user approval.
- `Reassigning` - Reassignment is in progress.
- `Rejected` - Reassignment was rejected by user.
- `Failed` - Reassignment failed.
In the **Reassigned** tab, possible statuses are:
- `Success` - Reassignment succeeded.
- `Kept as placeholder` - Placeholder user was made permanent.
By default, the table is sorted alphabetically by placeholder user name.
You can also sort the table by reassignment status.
### Confirm contribution reassignment
When [**Skip confirmation when administrators reassign placeholder users**](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users) is enabled:
- Administrators can reassign contributions immediately without user confirmation.
- Administrators can reassign contributions to active and inactive non-bot users.
- You receive an email informing you that you've been reassigned contributions.
If this setting is not enabled, you can [accept](#accept-contribution-reassignment)
or [reject](#reject-contribution-reassignment) the reassignment.
#### Accept contribution reassignment
You might receive an email informing you that an import process took place and asking you to confirm reassignment of
contributions to yourself.
If you were informed about this import process, you must still review reassignment details very carefully. Details
listed in the email are:
- **Imported from** - The platform the imported content originates from. For example, another instance of GitLab,
GitHub, or Bitbucket.
- **Original user** - The name and username of the user on the source platform. This could be your name and user name on
that platform.
- **Imported to** - The name of the new platform, which can only be a GitLab instance.
- **Reassigned to** - Your full name and username on the GitLab instance.
- **Reassigned by** - The full name and username of your colleague or manager that performed the import.
#### Reject contribution reassignment
If you receive an email asking you to confirm reassignment of contributions to yourself and you don't recognize or you
notice mistakes in this information:
1. Do not proceed at all or reject the contribution reassignment.
1. Talk to a trusted colleague or your manager.
#### Security considerations
You must review the reassignment details of any reassignment request very carefully. If you were not already informed
about this process by a trusted colleague or your manager, take extra care.
Rather than accept any reassignments that you have any doubts about:
1. Don't act on the emails.
1. Talk to a trusted colleague or your manager.
Accept reassignments only from the users that you know and trust. Reassignment of contributions is permanent and cannot
be undone. Accepting the reassignment might cause contributions to be incorrectly attributed to you.
The contribution reassignment process starts only after you accept the reassignment request by selecting
**Approve reassignment** in GitLab. The process doesn't start by selecting links in the email.
## View project import history
You can view all project imports created by you. This list includes the following:
- Paths of source projects if projects were imported from external systems, or import method if GitLab projects were migrated.
- Paths of destination projects.
- Start date of each import.
- Status of each import.
- Error details if any errors occurred.
To view project import history:
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. In the upper-right corner, select the **History** link.
1. If there are any errors for a particular import, select **Details** to see them.
The history also includes projects created from [built-in](../_index.md#create-a-project-from-a-built-in-template)
or [custom](../_index.md#create-a-project-from-a-custom-template)
templates. GitLab uses [import repository by URL](repo_by_url.md)
to create a new project from a template.
## Importing projects with LFS objects
When importing a project that contains LFS objects, if the project has an [`.lfsconfig`](https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-config.adoc)
file with a URL host (`lfs.url`) different from the repository URL host, LFS files are not downloaded.
## Migrate by engaging Professional Services
If you prefer, you can engage GitLab Professional Services to migrate groups and projects to GitLab instead of doing it
yourself. For more information, see the [Professional Services Full Catalog](https://about.gitlab.com/services/catalog/).
## Sidekiq configuration
Importers rely heavily on Sidekiq jobs to handle the import and export of groups and projects.
Some of these jobs might consume significant resources (CPU and memory) and
take a long time to complete, which might affect the execution of other jobs.
To resolve this issue, you should route importer jobs to a dedicated Sidekiq queue and
assign a dedicated Sidekiq process to handle that queue.
For example, you can use the following configuration:
```conf
sidekiq['concurrency'] = 20
sidekiq['routing_rules'] = [
# Route import and export jobs to the importer queue
['feature_category=importers', 'importers'],
# Route all other jobs to the default queue by using wildcard matching
['*', 'default']
]
sidekiq['queue_groups'] = [
# Run a dedicated process for the importer queue
'importers',
# Run a separate process for the default and mailer queues
'default,mailers'
]
```
In this setup:
- A dedicated Sidekiq process handles import and export jobs through the importer queue.
- Another Sidekiq process handles all other jobs (the default and mailer queues).
- Both Sidekiq processes are configured to run with 20 concurrent threads by default.
For memory-constrained environments, you might want to reduce this number.
If your instance has enough resources to support more concurrent jobs,
you can configure additional Sidekiq processes to speed up migrations.
For example:
```conf
sidekiq['queue_groups'] = [
# Run three processes for importer jobs
'importers',
'importers',
'importers',
# Run a separate process for the default and mailer queues
'default,mailers'
]
```
With this setup, multiple Sidekiq processes handle import and export jobs concurrently,
which speeds up migration as long as the instance has sufficient resources.
For the maximum number of Sidekiq processes, keep the following in mind:
- The number of processes should not exceed the number of available CPU cores.
- Each process can use up to 2 GB of memory, so ensure the instance
has enough memory for any additional processes.
- Each process adds one database connection per thread
as defined in `sidekiq['concurrency']`.
For more information, see [running multiple Sidekiq processes](../../../administration/sidekiq/extra_sidekiq_processes.md)
and [processing specific job classes](../../../administration/sidekiq/processing_specific_job_classes.md).
## Troubleshooting
### Imported repository is missing branches
If an imported repository does not contain all branches of the source repository:
1. Set the [environment variable](../../../administration/logs/_index.md#override-default-log-level) `IMPORT_DEBUG=true`.
1. Retry the import with a [different group, subgroup, or project name](https://about.gitlab.com/releases/2023/02/22/gitlab-15-9-released/#re-import-projects-from-external-providers).
1. If some branches are still missing, inspect [`importer.log`](../../../administration/logs/_index.md#importerlog)
(for example, with [`jq`](../../../administration/logs/log_parsing.md#parsing-gitlab-railsimporterlog)).
### Exception: `Error Importing repository - No such file or directory @ rb_sysopen - (filename)`
The error occurs if you attempt to import a `tar.gz` file download of a repository's source code.
Imports require a [GitLab export](../settings/import_export.md#export-a-project-and-its-data) file, not just a repository download file.
### Diagnosing prolonged or failed imports
If you're experiencing prolonged delays or failures with file-based imports, especially those using S3, the following may help identify the root cause of the problem:
- [Check import steps](#check-import-status)
- [Review logs](#review-logs)
- [Identify common issues](#identify-common-issues)
#### Check import status
Check the import status:
1. Use the GitLab API to check the [import status](../../../api/project_import_export.md#import-status) of the affected project.
1. Review the response for any error messages or status information, especially the `status` and `import_error` values.
1. Make note of the `correlation_id` in the response, as it's crucial for further troubleshooting.
#### Review logs
Search logs for relevant information:
For GitLab Self-Managed instances:
1. Check the [Sidekiq logs](../../../administration/logs/_index.md#sidekiqlog) and [`exceptions_json` logs](../../../administration/logs/_index.md#exceptions_jsonlog).
1. Search for entries related to `RepositoryImportWorker` and the correlation ID from [Check import status](#check-import-status).
1. Look for fields such as `job_status`, `interrupted_count`, and `exception`.
For GitLab.com (GitLab team members only):
1. Use [Kibana](https://log.gprd.gitlab.net/) to search the Sidekiq logs with queries like:
Target: `pubsub-sidekiq-inf-gprd*`
```plaintext
json.class: "RepositoryImportWorker" AND json.correlation_id.keyword: "<CORRELATION_ID>"
```
or
```plaintext
json.class: "RepositoryImportWorker" AND json.meta.project: "<project.full_path>"
```
1. Look for the same fields as mentioned for GitLab Self-Managed instances.
#### Identify common issues
Check the information gathered in [Review logs](#review-logs) against the following common issues:
- **Interrupted jobs**: If you see a high `interrupted_count` or `job_status` indicating failure, the import job may have been interrupted multiple times and placed in a dead queue.
- **S3 connectivity**: For imports using S3, check for any S3-related error messages in the logs.
- **Large repository**: If the repository is very large, the import might time out. Consider using [Direct transfer](../../group/import/_index.md) in this case.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import and migrate groups and projects
description: Repository migration, third-party repositories, and user contribution
mapping.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Bring your existing work into GitLab and preserve your contribution history.
Consolidate projects from multiple platforms or transfer data between GitLab instances.
GitLab offers different methods to:
- Migrate GitLab groups and projects by using direct transfer.
- Import projects from a variety of supported sources.
## Migrate from GitLab to GitLab by using direct transfer
The best way to copy GitLab groups and projects between GitLab instances, or in the same GitLab instance, is
[by using direct transfer](../../group/import/_index.md).
Another option is to move GitLab groups using [group transfer](../../group/manage.md#transfer-a-group).
You can also copy GitLab projects by using a GitLab file export, which is a supported import source.
## Supported import sources
{{< history >}}
- All importers default to disabled for GitLab Self-Managed instances. This change was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118970) in GitLab 16.0.
{{< /history >}}
The import sources that are available to you by default depend on which GitLab you use:
- GitLab.com: all available import sources are [enabled by default](../../gitlab_com/_index.md#default-import-sources).
- GitLab Self-Managed: no import sources are enabled by default and must be
[enabled](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources).
GitLab can import projects from these supported import sources.
| Import source | Description |
|:----------------------------------------------|:------------|
| [Bitbucket Cloud](bitbucket.md) | Using [Bitbucket.org as an OmniAuth provider](../../../integration/bitbucket.md), import Bitbucket repositories. |
| [Bitbucket Server](bitbucket_server.md) | Import repositories from Bitbucket Server (also known as Stash). |
| [FogBugz](fogbugz.md) | Import FogBugz projects. |
| [Gitea](gitea.md) | Import Gitea projects. |
| [GitHub](github.md) | Import from either GitHub.com or GitHub Enterprise. |
| [GitLab export](../settings/import_export.md) | Migrate projects one by one by using a GitLab export file. |
| [Manifest file](manifest.md) | Upload a manifest file. |
| [Repository by URL](repo_by_url.md) | Provide a Git repository URL to create a new project from. |
After you start a migration, you should not make any changes to imported groups or projects
on the source instance because these changes might not be copied to the destination instance.
### Disable unused import sources
Only import projects from sources you trust. If you import a project from an untrusted source,
an attacker could steal your sensitive data. For example, an imported project
with a malicious `.gitlab-ci.yml` file could allow an attacker to exfiltrate group CI/CD variables.
GitLab Self-Managed administrators can reduce their attack surface by disabling import sources they don't need:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > General**.
1. Expand **Import and export settings**.
1. Scroll to **Import sources**.
1. Clear checkboxes for importers that are not required.
## Other import sources
You can also read information on importing from these other import sources:
- [ClearCase](clearcase.md)
- [Concurrent Versions System (CVS)](cvs.md)
- [Jira (issues only)](jira.md)
- [Perforce Helix](perforce.md)
- [Team Foundation Version Control (TFVC)](tfvc.md)
### Import repositories from Subversion
GitLab can not automatically migrate Subversion repositories to Git. Converting Subversion repositories to Git can be
difficult, but several tools exist including:
- [`git svn`](https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git), for very small and basic repositories.
- [`reposurgeon`](http://www.catb.org/~esr/reposurgeon/repository-editing.html), for larger and more complex repositories.
## User contribution and membership mapping
{{< details >}}
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/443557) in GitLab 17.4 for direct transfer [with flags](../../../administration/feature_flags/_index.md) named `importer_user_mapping` and `bulk_import_importer_user_mapping`. Disabled by default.
- Introduced in GitLab 17.6 for [Gitea](https://gitlab.com/gitlab-org/gitlab/-/issues/467084) [with flags](../../../administration/feature_flags/_index.md) named `importer_user_mapping` and `gitea_user_mapping`, and for [GitHub](https://gitlab.com/gitlab-org/gitlab/-/issues/466355) with flags named `importer_user_mapping` and `github_user_mapping`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/466356) in GitLab 17.7 for Bitbucket Server [with flags](../../../administration/feature_flags/_index.md) named `importer_user_mapping` and `bitbucket_server_user_mapping`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/472735) in GitLab 17.7 for direct transfer.
- Enabled on GitLab.com in GitLab 17.7 for [Bitbucket Server](https://gitlab.com/gitlab-org/gitlab/-/issues/509897), [Gitea](https://gitlab.com/gitlab-org/gitlab/-/issues/498390), and [GitHub](https://gitlab.com/gitlab-org/gitlab/-/issues/499993).
- Enabled on GitLab Self-Managed in GitLab 17.8 for [Bitbucket Server](https://gitlab.com/gitlab-org/gitlab/-/issues/509897), [Gitea](https://gitlab.com/gitlab-org/gitlab/-/issues/498390), and [GitHub](https://gitlab.com/gitlab-org/gitlab/-/issues/499993).
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by feature flags.
For more information, see the history.
{{< /alert >}}
{{< alert type="note" >}}
To leave feedback about this feature, add a comment to [issue 502565](https://gitlab.com/gitlab-org/gitlab/-/issues/502565).
{{< /alert >}}
This method of user contribution and membership mapping is available by default for
[direct transfer](../../group/import/_index.md), [GitHub importer](github.md),
[Bitbucket Server importer](bitbucket_server.md), and [Gitea importer](gitea.md) on
GitLab.com and GitLab Self-Managed.
For information on the other method available for GitLab Self-Managed with disabled feature flags,
see the documentation for each importer.
Any memberships and contributions you import are first mapped to [placeholder users](#placeholder-users).
These placeholders are created on the destination instance even if
users with the same email addresses exist on the source instance.
Until you reassign contributions on the destination instance,
all contributions display as associated with placeholders.
{{< alert type="note" >}}
Contributions from a deleted user on the source instance are
mapped automatically to that user on the destination instance.
{{< /alert >}}
After the import has completed, you can:
- Reassign memberships and contributions to existing users on the destination instance
after you review the results.
You can map memberships and contributions for users with different email addresses
on source and destination instances.
- Create new users on the destination instance to reassign memberships and contributions to.
When you reassign contributions to a user on the destination instance, the user can
[accept](#accept-contribution-reassignment) or [reject](#reject-contribution-reassignment) the reassignment.
When the user accepts the reassignment:
- Contributions are reassigned. This process might take a few minutes.
- In subsequent imports from the same source instance to the same top-level group or subgroup
on the destination instance, contributions are mapped automatically to the user.
[In GitLab 18.0 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/510673), if your top-level group
has at least one [enterprise user](../../enterprise_user/_index.md), you can reassign contributions
only to enterprise users in your organization in the UI or by using a CSV file.
This feature is meant to prevent accidental reassignment to users outside your organization.
{{< alert type="note" >}}
When you use a supported method to import projects to a
[personal namespace](../../namespace/_index.md#types-of-namespaces),
user contribution mapping is not supported.
When you import to a personal namespace, all contributions are assigned to
a single non-functional user called `Import User` and they cannot be reassigned.
[Issue 525342](https://gitlab.com/gitlab-org/gitlab/-/issues/525342) proposes to map all contributions to the importing user instead.
{{< /alert >}}
### Requirements
- You must be able to create enough users, subject to [user limits](#placeholder-user-limits).
- If you import to GitLab.com, you must set up your paid namespace before the import.
- If you import to GitLab.com and use [SAML SSO for GitLab.com groups](../../group/saml_sso/_index.md),
all users must link their SAML identity to their GitLab.com account before you can
[reassign contributions and memberships](#reassign-contributions-and-memberships).
### Placeholder users
Instead of immediately assigning contributions and memberships to users on the destination instance, a
placeholder user is created for any active, inactive, or bot user with imported contributions or memberships.
For deleted users on the source instance, placeholders are created
without all [placeholder user attributes](#placeholder-user-attributes).
You should [keep these users as placeholders](#keep-as-placeholder).
For more information, see [issue 506432](https://gitlab.com/gitlab-org/gitlab/-/issues/506432).
Both contributions and memberships are first assigned to these placeholder users and can be reassigned after import
to existing users on the destination instance.
Until they are reassigned, contributions display as associated with the placeholder. Placeholder memberships
do not display in member lists.
Placeholder users do not count towards license limits.
#### Exceptions
A placeholder user is created for each user on the source instance, except in the following scenarios:
- You're importing a project from [Gitea](gitea.md), and the user was deleted on Gitea before the import.
Contributions from these users are mapped to the user who imported the project, not to a placeholder user.
- You have exceeded your [placeholder user limit](#placeholder-user-limits). Contributions from any new users after exceeding your limit are
mapped to a single non-functional user called `Import User`.
- You are importing to a [personal namespace](../../namespace/_index.md#types-of-namespaces).
Contributions are assigned to a single non-functional user called `Import User`.
[Issue 525342](https://gitlab.com/gitlab-org/gitlab/-/issues/525342) proposes to map all contributions to the importing user instead.
#### Placeholder user attributes
Placeholder users are different to regular users and cannot:
- Sign in.
- Perform any actions. For example, running pipelines.
- Appear in suggestions as assignees or reviewers for issues and merge requests.
- Be members of projects and groups.
To maintain a connection with a user on a source instance, placeholder users have:
- A unique identifier (`source_user_id`) used by the import process to determine if a new placeholder user is required.
- A source hostname or domain (`source_hostname`).
- A source user's name (`source_name`) to help with reassignment of contributions.
- A source user's username (`source_username`) to facilitate group owners during the reassignment of the contribution.
- An import type (`import_type`) to distinguish which importer created the placeholder.
- A timestamp of when the source user was created (`created_at`) in local time for migration tracking
([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/507297) in GitLab 17.10).
To preserve historical context, the placeholder user name and username are derived from the source user name and username:
- Placeholder user's name is `Placeholder <source user name>`.
- Placeholder user's username is `%{source_username}_placeholder_user_%{incremental_number}`.
#### View placeholder users
Prerequisites:
- You must have the Owner role for the group.
Placeholder users are created on the destination instance while a group or project is imported.
To view placeholder users created during imports to a top-level group and its subgroups:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
#### Filter for placeholder users
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/521974) in GitLab 17.11.
{{< /history >}}
Prerequisites:
- You must have administrator access to the instance.
Placeholder users are created on the destination instance while a group or project is imported.
To filter for placeholder users created during imports for an entire instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Overview > Users**.
1. In the search box, filter users by **type**.
#### Creating placeholder users
Placeholder users are created per [import source](#supported-import-sources) and per top-level group:
- If you import the same project twice to the same top-level group on the destination instance, the second import uses
the same placeholder users as the first import.
- If you import the same project twice, but to a different top-level group on the destination instance, the second import
creates new placeholder users under that top-level group.
{{< alert type="note" >}}
Placeholder users are associated only with the top-level group.
When you delete a subgroup or project, their placeholder users
no longer reference any contributions in the top-level group.
For testing, you should use a designated top-level group.
Deleting placeholder users is proposed in [issue 519391](https://gitlab.com/gitlab-org/gitlab/-/issues/519391)
and [issue 537340](https://gitlab.com/gitlab-org/gitlab/-/issues/537340).
{{< /alert >}}
When a user [accepts the reassignment](#accept-contribution-reassignment),
subsequent imports from the same source instance to the same top-level group or
subgroup on the destination instance do not create placeholder users.
Instead, contributions are mapped automatically to the user.
#### Placeholder user deletion
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/473256) in GitLab 18.0.
{{< /history >}}
When you delete a top-level group that contains placeholder users,
these users are automatically scheduled for removal.
This process might take some time to complete.
However, placeholder users remain in the system if
they're also associated with other projects or groups.
{{< alert type="note" >}}
There is no other way to delete placeholder users, but support for improvements is proposed in
[issue 519391](https://gitlab.com/gitlab-org/gitlab/-/issues/519391) and
[issue 537340](https://gitlab.com/gitlab-org/gitlab/-/issues/537340).
{{< /alert >}}
#### Placeholder user limits
If importing to GitLab.com, placeholder users are limited per top-level group on the destination instance. The limits differ depending on your plan and seat count. Placeholder users do not count towards license limits.
| GitLab.com plan | Number of seats | Placeholder user limit on top-level group |
|:-------------------------|:----------------|:------------------------------------------|
| Free and any trial | Any amount | 200 |
| Premium | < 100 | 500 |
| Premium | 101-500 | 2000 |
| Premium | 501 - 1000 | 4000 |
| Premium | > 1000 | 6000 |
| Ultimate and open source | < 100 | 1000 |
| Ultimate and open source | 101-500 | 4000 |
| Ultimate and open source | 501 - 1000 | 6000 |
| Ultimate and open source | > 1000 | 8000 |
For GitLab Self-Managed and GitLab Dedicated, no placeholder limits apply by default.
A GitLab administrator can [set a placeholder limit](../../../administration/instance_limits.md#import-placeholder-user-limits) on their instance.
To view your current placeholder user usage and limits:
1. On the left sidebar, select **Search or go to** and
find your group. This group must be at the top level.
1. Select **Settings > Usage quotas**.
1. Select the **Import** tab.
You cannot determine the number of placeholder users you need in advance.
When the placeholder user limit is reached, all contributions
are assigned to a single non-functional user called `Import User`.
Contributions assigned to `Import User` might be deduplicated,
and some contributions might not be created during the import.
For example, if multiple approvals from a merge request approver are assigned
to `Import User`, only the first approval is created and the others are ignored.
The contributions that might be deduplicated are:
- Approval rules
- Emoji reactions
- Issue assignees
- Memberships
- Merge request approvals, assignees, and reviewers
- Push, merge request, and deploy access levels
Every change creates a system note, which is not affected by the placeholder user limit.
### Reassign contributions and memberships
Users with the Owner role for a top-level group can reassign contributions and memberships
from placeholder users to existing active non-bot users.
On the destination instance, users with the Owner role for a top-level group can:
- Request users to review reassignment of contributions and memberships [in the UI](#request-reassignment-in-ui)
or [through a CSV file](#request-reassignment-by-using-a-csv-file).
For a large number of placeholder users, you should use a CSV file.
In both cases, users receive a request by email to accept or reject the reassignment.
The reassignment starts only after the selected user
[accepts the reassignment request](#accept-contribution-reassignment).
- Choose not to reassign contributions and memberships and [keep them assigned to placeholder users](#keep-as-placeholder).
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
#### Reassigning contributions from multiple placeholder users
All the contributions initially assigned to a single placeholder user can only be reassigned to a single active regular
user on the destination instance. The contributions assigned to a single placeholder user cannot be split among multiple
active regular users.
You can reassign contributions from multiple placeholder users to the same user
on the destination instance if the placeholder users are from:
- Different source instances
- The same source instance and are imported to different top-level groups on the destination instance
If an assigned user becomes inactive before accepting the reassignment request,
the pending reassignment remains linked to the user until they accept it.
Bot user contributions and memberships on the source instance cannot be reassigned to bot users on the destination instance.
You might choose to keep source bot user contributions [assigned to a placeholder user](#keep-as-placeholder).
Users that receive a reassignment request can:
- [Accept the request](#accept-contribution-reassignment). All contributions and membership previously attributed to the placeholder user are re-attributed
to the accepting user. This process can take a few minutes, depending on the number of contributions.
- [Reject the request](#reject-contribution-reassignment) or report it as spam. This option is available in the reassignment
request email.
In subsequent imports to the same top-level group, contributions and memberships that belong to the same source user
are mapped automatically to the user who previously accepted reassignments for that source user.
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
#### Completing the reassignment
The reassignment process must be fully completed before you:
- [Move an imported group in the same GitLab instance](../../group/manage.md#transfer-a-group).
- [Move an imported project to a different group](../settings/migrate_projects.md).
- Duplicate an imported issue.
- Promote an imported issue to an epic.
If the process isn't complete, contributions still assigned to placeholder users cannot be reassigned to real users and
they stay associated with placeholder users.
#### Security considerations
Contribution and membership reassignment cannot be undone, so check everything carefully before you start.
Reassigning contributions and membership to an incorrect user poses a security threat, because the user becomes a member
of your group. They can, therefore, view information they should not be able to see.
Reassigning contributions to users with administrator access is disabled by default, but you can
[enable](../../../administration/settings/import_and_export_settings.md#allow-contribution-mapping-to-administrators) it.
##### Membership security considerations
Because of the GitLab permissions model, when a group or project is imported into an existing parent group, members of
the parent group are granted [inherited membership](../members/_index.md#membership-types) of the imported group or project.
Selecting a user for contribution and membership reassignment who already has an
existing inherited membership of the imported group or project can affect how memberships
are reassigned to them.
GitLab does not allow a membership in a child project or group to have a lower role
than an inherited membership. If an imported membership for an assigned user has a lower role
than their existing inherited membership, the imported membership is not reassigned to the user.
This results in their membership for the imported group or project being higher than it was on the source.
#### Request reassignment in UI
Prerequisites:
- You must have the Owner role for the group.
You can reassign contributions and memberships in the top-level group.
To request reassignment of contributions and memberships:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. For each placeholder, review information in table columns **Placeholder user** and **Source**.
1. In the **Reassign placeholder to** column, select the a user from the dropdown list.
1. Select **Reassign**.
Contributions of only one placeholder user can be reassigned to an active non-bot user on destination instance.
Before a user accepts the reassignment, you can [cancel the request](#cancel-reassignment-request).
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
#### Request reassignment by using a CSV file
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/455901) in GitLab 17.10 [with a flag](../../../administration/feature_flags/_index.md) named `importer_user_mapping_reassignment_csv`. Enabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/478022) in GitLab 18.0. Feature flag `importer_user_mapping_reassignment_csv` removed.
{{< /history >}}
Prerequisites:
- You must have the Owner role for the group.
For a large number of placeholder users, you might want to
reassign contributions and memberships by using a CSV file.
You can download a prefilled CSV template with the following information.
For example:
| Source host | Import type | Source user identifier | Source user name | Source username |
|----------------------|-------------|------------------------|------------------|-----------------|
| `gitlab.example.com` | `gitlab` | `alice` | `Alice Coder` | `a.coer` |
Do not update **Source host**, **Import type**, or **Source user identifier**.
This information locates the corresponding database record
after you've uploaded the completed CSV file.
**Source user name** and **Source username** identify the source user
and are not used after you've uploaded the CSV file.
You do not have to update every row of the CSV file.
Only rows with **GitLab username** or **GitLab public email** are processed.
All other rows are skipped.
To request reassignment of contributions and memberships by using a CSV file:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Select **Reassign with CSV**.
1. Download the prefilled CSV template.
1. In **GitLab username** or **GitLab public email**, enter the username or public email address
of the GitLab user on the destination instance.
Instance administrators can reassign users with any confirmed email address.
1. Upload the completed CSV file.
1. Select **Reassign**.
You can assign only contributions from a single placeholder user
to each active non-bot user on the destination instance.
Users receive an email to review and [accept any contributions](#accept-contribution-reassignment) you've reassigned to them.
You can [cancel the reassignment request](#cancel-reassignment-request) before the user reviews it.
On GitLab Self-Managed and GitLab Dedicated, administrators can reassign
contributions and memberships to active and inactive non-bot users immediately without their confirmation.
For more information, see [skip confirmation when administrators reassign placeholder users](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users).
After you reassign contributions, GitLab sends you an email with the number of:
- Successfully processed rows
- Unsuccessfully processed rows
- Skipped rows
If any rows have not been successfully processed, the email has a CSV file with more detailed results.
To reassign placeholder users in bulk without using the UI,
see [Group placeholder reassignments API](../../../api/group_placeholder_reassignments.md).
#### Keep as placeholder
You might not want to reassign contributions and memberships to users on the destination instance. For example, you
might have former employees that contributed on the source instance, but they do not exist as users on the destination
instance.
In these cases, you can keep the contributions assigned to placeholder users. Placeholder users do not keep
membership information because they [cannot be members of projects or groups](#placeholder-user-attributes).
Because names and usernames of placeholder users resemble names and usernames of source users, you keep a lot of
historical context.
Remember that if you keep remaining placeholder users as placeholders, you cannot reassign their contributions to
actual users later. Ensure all required reassignments are completed before keeping the remaining placeholder users as
placeholders.
You can keep contributions assigned to placeholder users either one at a time or in bulk.
When you reassign contributions in bulk, the entire namespace and users with the following
[reassignment statuses](#view-and-filter-by-reassignment-status) are affected:
- `Not started`
- `Rejected`
To keep placeholder users one at a time:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. Find placeholder user you want to keep by reviewing **Placeholder user** and **Source** columns.
1. In **Reassign placeholder to** column, select **Do not reassign**.
1. Select **Confirm**.
To keep placeholder users in bulk:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Above the list, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **Keep all as placeholders**.
1. On the confirmation dialog, select **Confirm**.
#### Cancel reassignment request
Before a user accepts a reassignment request, you can cancel the request:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. Select **Cancel** in the correct row.
#### Notify user again about pending reassignment requests
If a user is not acting on a reassignment request, you can prompt them again by sending another email:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. Select **Notify** in the correct row.
#### View and filter by reassignment status
To view the reassignment status of all placeholder users:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Manage > Members**.
1. Select the **Placeholders** tab.
1. Go to **Awaiting reassignment** sub-tab, where placeholders are listed in a table.
1. See the status of each placeholder user in **Reassignment status** column.
In the **Awaiting reassignment** tab, possible statuses are:
- `Not started` - Reassignment has not started.
- `Pending approval` - Reassignment is waiting on user approval.
- `Reassigning` - Reassignment is in progress.
- `Rejected` - Reassignment was rejected by user.
- `Failed` - Reassignment failed.
In the **Reassigned** tab, possible statuses are:
- `Success` - Reassignment succeeded.
- `Kept as placeholder` - Placeholder user was made permanent.
By default, the table is sorted alphabetically by placeholder user name.
You can also sort the table by reassignment status.
### Confirm contribution reassignment
When [**Skip confirmation when administrators reassign placeholder users**](../../../administration/settings/import_and_export_settings.md#skip-confirmation-when-administrators-reassign-placeholder-users) is enabled:
- Administrators can reassign contributions immediately without user confirmation.
- Administrators can reassign contributions to active and inactive non-bot users.
- You receive an email informing you that you've been reassigned contributions.
If this setting is not enabled, you can [accept](#accept-contribution-reassignment)
or [reject](#reject-contribution-reassignment) the reassignment.
#### Accept contribution reassignment
You might receive an email informing you that an import process took place and asking you to confirm reassignment of
contributions to yourself.
If you were informed about this import process, you must still review reassignment details very carefully. Details
listed in the email are:
- **Imported from** - The platform the imported content originates from. For example, another instance of GitLab,
GitHub, or Bitbucket.
- **Original user** - The name and username of the user on the source platform. This could be your name and user name on
that platform.
- **Imported to** - The name of the new platform, which can only be a GitLab instance.
- **Reassigned to** - Your full name and username on the GitLab instance.
- **Reassigned by** - The full name and username of your colleague or manager that performed the import.
#### Reject contribution reassignment
If you receive an email asking you to confirm reassignment of contributions to yourself and you don't recognize or you
notice mistakes in this information:
1. Do not proceed at all or reject the contribution reassignment.
1. Talk to a trusted colleague or your manager.
#### Security considerations
You must review the reassignment details of any reassignment request very carefully. If you were not already informed
about this process by a trusted colleague or your manager, take extra care.
Rather than accept any reassignments that you have any doubts about:
1. Don't act on the emails.
1. Talk to a trusted colleague or your manager.
Accept reassignments only from the users that you know and trust. Reassignment of contributions is permanent and cannot
be undone. Accepting the reassignment might cause contributions to be incorrectly attributed to you.
The contribution reassignment process starts only after you accept the reassignment request by selecting
**Approve reassignment** in GitLab. The process doesn't start by selecting links in the email.
## View project import history
You can view all project imports created by you. This list includes the following:
- Paths of source projects if projects were imported from external systems, or import method if GitLab projects were migrated.
- Paths of destination projects.
- Start date of each import.
- Status of each import.
- Error details if any errors occurred.
To view project import history:
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. In the upper-right corner, select the **History** link.
1. If there are any errors for a particular import, select **Details** to see them.
The history also includes projects created from [built-in](../_index.md#create-a-project-from-a-built-in-template)
or [custom](../_index.md#create-a-project-from-a-custom-template)
templates. GitLab uses [import repository by URL](repo_by_url.md)
to create a new project from a template.
## Importing projects with LFS objects
When importing a project that contains LFS objects, if the project has an [`.lfsconfig`](https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-config.adoc)
file with a URL host (`lfs.url`) different from the repository URL host, LFS files are not downloaded.
## Migrate by engaging Professional Services
If you prefer, you can engage GitLab Professional Services to migrate groups and projects to GitLab instead of doing it
yourself. For more information, see the [Professional Services Full Catalog](https://about.gitlab.com/services/catalog/).
## Sidekiq configuration
Importers rely heavily on Sidekiq jobs to handle the import and export of groups and projects.
Some of these jobs might consume significant resources (CPU and memory) and
take a long time to complete, which might affect the execution of other jobs.
To resolve this issue, you should route importer jobs to a dedicated Sidekiq queue and
assign a dedicated Sidekiq process to handle that queue.
For example, you can use the following configuration:
```conf
sidekiq['concurrency'] = 20
sidekiq['routing_rules'] = [
# Route import and export jobs to the importer queue
['feature_category=importers', 'importers'],
# Route all other jobs to the default queue by using wildcard matching
['*', 'default']
]
sidekiq['queue_groups'] = [
# Run a dedicated process for the importer queue
'importers',
# Run a separate process for the default and mailer queues
'default,mailers'
]
```
In this setup:
- A dedicated Sidekiq process handles import and export jobs through the importer queue.
- Another Sidekiq process handles all other jobs (the default and mailer queues).
- Both Sidekiq processes are configured to run with 20 concurrent threads by default.
For memory-constrained environments, you might want to reduce this number.
If your instance has enough resources to support more concurrent jobs,
you can configure additional Sidekiq processes to speed up migrations.
For example:
```conf
sidekiq['queue_groups'] = [
# Run three processes for importer jobs
'importers',
'importers',
'importers',
# Run a separate process for the default and mailer queues
'default,mailers'
]
```
With this setup, multiple Sidekiq processes handle import and export jobs concurrently,
which speeds up migration as long as the instance has sufficient resources.
For the maximum number of Sidekiq processes, keep the following in mind:
- The number of processes should not exceed the number of available CPU cores.
- Each process can use up to 2 GB of memory, so ensure the instance
has enough memory for any additional processes.
- Each process adds one database connection per thread
as defined in `sidekiq['concurrency']`.
For more information, see [running multiple Sidekiq processes](../../../administration/sidekiq/extra_sidekiq_processes.md)
and [processing specific job classes](../../../administration/sidekiq/processing_specific_job_classes.md).
## Troubleshooting
### Imported repository is missing branches
If an imported repository does not contain all branches of the source repository:
1. Set the [environment variable](../../../administration/logs/_index.md#override-default-log-level) `IMPORT_DEBUG=true`.
1. Retry the import with a [different group, subgroup, or project name](https://about.gitlab.com/releases/2023/02/22/gitlab-15-9-released/#re-import-projects-from-external-providers).
1. If some branches are still missing, inspect [`importer.log`](../../../administration/logs/_index.md#importerlog)
(for example, with [`jq`](../../../administration/logs/log_parsing.md#parsing-gitlab-railsimporterlog)).
### Exception: `Error Importing repository - No such file or directory @ rb_sysopen - (filename)`
The error occurs if you attempt to import a `tar.gz` file download of a repository's source code.
Imports require a [GitLab export](../settings/import_export.md#export-a-project-and-its-data) file, not just a repository download file.
### Diagnosing prolonged or failed imports
If you're experiencing prolonged delays or failures with file-based imports, especially those using S3, the following may help identify the root cause of the problem:
- [Check import steps](#check-import-status)
- [Review logs](#review-logs)
- [Identify common issues](#identify-common-issues)
#### Check import status
Check the import status:
1. Use the GitLab API to check the [import status](../../../api/project_import_export.md#import-status) of the affected project.
1. Review the response for any error messages or status information, especially the `status` and `import_error` values.
1. Make note of the `correlation_id` in the response, as it's crucial for further troubleshooting.
#### Review logs
Search logs for relevant information:
For GitLab Self-Managed instances:
1. Check the [Sidekiq logs](../../../administration/logs/_index.md#sidekiqlog) and [`exceptions_json` logs](../../../administration/logs/_index.md#exceptions_jsonlog).
1. Search for entries related to `RepositoryImportWorker` and the correlation ID from [Check import status](#check-import-status).
1. Look for fields such as `job_status`, `interrupted_count`, and `exception`.
For GitLab.com (GitLab team members only):
1. Use [Kibana](https://log.gprd.gitlab.net/) to search the Sidekiq logs with queries like:
Target: `pubsub-sidekiq-inf-gprd*`
```plaintext
json.class: "RepositoryImportWorker" AND json.correlation_id.keyword: "<CORRELATION_ID>"
```
or
```plaintext
json.class: "RepositoryImportWorker" AND json.meta.project: "<project.full_path>"
```
1. Look for the same fields as mentioned for GitLab Self-Managed instances.
#### Identify common issues
Check the information gathered in [Review logs](#review-logs) against the following common issues:
- **Interrupted jobs**: If you see a high `interrupted_count` or `job_status` indicating failure, the import job may have been interrupted multiple times and placed in a dead queue.
- **S3 connectivity**: For imports using S3, check for any S3-related error messages in the logs.
- **Large repository**: If the repository is very large, the import might time out. Consider using [Direct transfer](../../group/import/_index.md) in this case.
|
https://docs.gitlab.com/user/project/fogbugz
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/fogbugz.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
fogbugz.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import your project from FogBugz to GitLab
|
Import projects from FogBugz to GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
{{< /history >}}
Using the importer, you can import your FogBugz project to GitLab.com
or to GitLab Self-Managed.
The importer imports all of your cases and comments with the original
case numbers and timestamps. You can also map FogBugz users to GitLab
users.
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [FogBugz import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The FogBugz import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
## Import project from FogBugz
To import your project from FogBugz:
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **FogBugz**.
1. Enter your FogBugz URL, email address, and password.
1. Create a mapping from FogBugz users to GitLab users. For each FogBugz user:
- To map a FogBugz account to a full name, without mapping it to a GitLab account, leave the **GitLab User**
text box empty. This mapping adds the user's full name to the description of all issues and comments, but
assigns the issues and comments to the project creator.
- To map a FogBugz account to a GitLab account, in **GitLab User**, select the GitLab user
you want to associate issues and comments with.
1. When all users are mapped, select **Continue to the next step**.
1. For each project you want to import, select **Import**.
1. After the import finishes, select the link to go to the project
dashboard. Follow the directions to push your existing repository.
1. To import a project:
- For the first time: Select **Import**.
- Again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import your project from FogBugz to GitLab
description: Import projects from FogBugz to GitLab.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
{{< /history >}}
Using the importer, you can import your FogBugz project to GitLab.com
or to GitLab Self-Managed.
The importer imports all of your cases and comments with the original
case numbers and timestamps. You can also map FogBugz users to GitLab
users.
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [FogBugz import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The FogBugz import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
## Import project from FogBugz
To import your project from FogBugz:
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **FogBugz**.
1. Enter your FogBugz URL, email address, and password.
1. Create a mapping from FogBugz users to GitLab users. For each FogBugz user:
- To map a FogBugz account to a full name, without mapping it to a GitLab account, leave the **GitLab User**
text box empty. This mapping adds the user's full name to the description of all issues and comments, but
assigns the issues and comments to the project creator.
- To map a FogBugz account to a GitLab account, in **GitLab User**, select the GitLab user
you want to associate issues and comments with.
1. When all users are mapped, select **Continue to the next step**.
1. For each project you want to import, select **Import**.
1. After the import finishes, select the link to go to the project
dashboard. Follow the directions to push your existing repository.
1. To import a project:
- For the first time: Select **Import**.
- Again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
|
https://docs.gitlab.com/user/project/clearcase
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/clearcase.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
clearcase.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Migrating from ClearCase
|
Migrate from IBM ClearCase to Git.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[ClearCase](https://www.ibm.com/products/devops-code-clearcase) is a set of
tools developed by IBM which also include a centralized version control system
similar to Git.
A good read of ClearCase's basic concepts is can be found in this
[StackOverflow post](https://stackoverflow.com/a/645771/974710).
The following table illustrates the main differences between ClearCase and Git:
| Aspect | ClearCase | Git |
| ------ | --------- | --- |
| Repository model | Client-server | Distributed |
| Revision IDs | Branch + number | Global alphanumeric ID |
| Scope of Change | File | Directory tree snapshot |
| Concurrency model | Merge | Merge |
| Storage Method | Deltas | Full content |
| Client | CLI, Eclipse, CC Client | CLI, Eclipse, Git client/GUIs |
| Server | UNIX, Windows legacy systems | UNIX, macOS |
| License | Proprietary | GPL |
## Why migrate
ClearCase can be difficult to manage both from a user and an administrator perspective.
Migrating to Git/GitLab there is:
- **No licensing costs**, Git is GPL while ClearCase is proprietary.
- **Shorter learning curve**, Git has a big community and a vast number of
tutorials to get you started.
- **Integration with modern tools**, migrating to Git and GitLab you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
## How to migrate
While there doesn't exist a tool to fully migrate from ClearCase to Git, here
are some useful links to get you started:
- [Bridge for Git and ClearCase](https://github.com/charleso/git-cc)
- [ClearCase to Git](https://therub.org/2013/07/19/clearcase-to-git/)
- [Dual syncing ClearCase to Git](https://therub.org/2013/10/22/dual-syncing-clearcase-and-git/)
- [Moving to Git from ClearCase](https://sateeshkumarb.wordpress.com/2011/01/15/moving-to-git-from-clearcase/)
- [ClearCase to Git webinar](https://www.brighttalk.com/webcast/11817/162473)
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Migrating from ClearCase
description: Migrate from IBM ClearCase to Git.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[ClearCase](https://www.ibm.com/products/devops-code-clearcase) is a set of
tools developed by IBM which also include a centralized version control system
similar to Git.
A good read of ClearCase's basic concepts is can be found in this
[StackOverflow post](https://stackoverflow.com/a/645771/974710).
The following table illustrates the main differences between ClearCase and Git:
| Aspect | ClearCase | Git |
| ------ | --------- | --- |
| Repository model | Client-server | Distributed |
| Revision IDs | Branch + number | Global alphanumeric ID |
| Scope of Change | File | Directory tree snapshot |
| Concurrency model | Merge | Merge |
| Storage Method | Deltas | Full content |
| Client | CLI, Eclipse, CC Client | CLI, Eclipse, Git client/GUIs |
| Server | UNIX, Windows legacy systems | UNIX, macOS |
| License | Proprietary | GPL |
## Why migrate
ClearCase can be difficult to manage both from a user and an administrator perspective.
Migrating to Git/GitLab there is:
- **No licensing costs**, Git is GPL while ClearCase is proprietary.
- **Shorter learning curve**, Git has a big community and a vast number of
tutorials to get you started.
- **Integration with modern tools**, migrating to Git and GitLab you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
## How to migrate
While there doesn't exist a tool to fully migrate from ClearCase to Git, here
are some useful links to get you started:
- [Bridge for Git and ClearCase](https://github.com/charleso/git-cc)
- [ClearCase to Git](https://therub.org/2013/07/19/clearcase-to-git/)
- [Dual syncing ClearCase to Git](https://therub.org/2013/10/22/dual-syncing-clearcase-and-git/)
- [Moving to Git from ClearCase](https://sateeshkumarb.wordpress.com/2011/01/15/moving-to-git-from-clearcase/)
- [ClearCase to Git webinar](https://www.brighttalk.com/webcast/11817/162473)
|
https://docs.gitlab.com/user/project/gitea
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/gitea.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
gitea.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import your project from Gitea to GitLab
|
Import projects from Gitea to GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381902) in GitLab 15.8, GitLab no longer automatically creates namespaces or groups that don't exist. GitLab also no longer falls back to using the user's personal namespace if the namespace or group name is taken.
- Ability to import projects with a `.` in their path [added](https://gitlab.com/gitlab-org/gitlab/-/issues/434175) in GitLab 16.11.
- An **Imported** badge on some imported items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461208) in GitLab 17.2.
{{< /history >}}
Import your projects from Gitea to GitLab.
The Gitea importer can import:
- Repository description
- Git repository data
- Issues
- Pull requests
- Milestones
- Labels
When importing:
- Repository public access is retained. If a repository is private in Gitea, it's created as private in GitLab as well.
- Imported issues, merge requests, and comments have an **Imported** badge in GitLab.
## Known issues
- Because Gitea is not an OAuth provider, the author or assignee cannot be mapped to users on
your GitLab instance. The project creator (usually the user who started the import process)
is then set as the author. For issues, you can still see the original Gitea author.
- The Gitea importer does not import diff notes from pull requests. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/450973) for more information.
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- Gitea version 1.0.0 or later.
- [Gitea import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Gitea import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
## Import your Gitea repositories
The Gitea importer page is visible when you create a new project. To begin a Gitea import:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Gitea** to start the import authorization process.
### Authorize access to your repositories using a personal access token
With this method, you perform a one-off authorization with Gitea to grant
GitLab access your repositories:
1. Go to `https://your-gitea-instance/user/settings/applications` (replace
`your-gitea-instance` with the host of your Gitea instance).
1. Select **Generate New Token**.
1. Enter a token description.
1. Select **Generate Token**.
1. Copy the token hash.
1. Go back to GitLab and provide the token to the Gitea importer.
1. Select **List your Gitea repositories** and wait while GitLab reads
your repositories' information. After it's done, GitLab displays the importer
page to select the repositories to import.
### Select which repositories to import
After you've authorized access to your Gitea repositories, you are
redirected to the Gitea importer page.
From there, you can view the import statuses of your Gitea repositories:
- Those that are being imported show a started status.
- Those already successfully imported are green with a done status.
- Those that aren't yet imported have **Import** on the right side of the table.
- Those that are already imported have **Re-import** on the right side of the table.
You also can:
- In the upper-left corner, select **Import all projects** to import all of your Gitea projects at once.
- Filter projects by name. If a filter is applied, **Import all projects**
imports only selected projects.
- Choose a different name for the project and a different namespace if you have the privileges to do so.
## User contribution and membership mapping
{{< history >}}
- [Changed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) to [user contribution and membership mapping](_index.md#user-contribution-and-membership-mapping) in GitLab 17.8.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176675) in GitLab 17.8.
{{< /history >}}
The Gitea importer uses an [improved method](_index.md#user-contribution-and-membership-mapping)
of mapping user contributions for GitLab.com and GitLab Self-Managed.
### Old method of user contribution mapping
You can use the old user contribution mapping method for imports to GitLab Self-Managed and GitLab Dedicated instances.
To use this method, `gitea_user_mapping` must be disabled.
For imports to GitLab.com, you must
use the [improved method](_index.md#user-contribution-and-membership-mapping) instead.
Using the old method, user contributions are assigned to the project creator (usually the user who started the import process) by default.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import your project from Gitea to GitLab
description: Import projects from Gitea to GitLab.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381902) in GitLab 15.8, GitLab no longer automatically creates namespaces or groups that don't exist. GitLab also no longer falls back to using the user's personal namespace if the namespace or group name is taken.
- Ability to import projects with a `.` in their path [added](https://gitlab.com/gitlab-org/gitlab/-/issues/434175) in GitLab 16.11.
- An **Imported** badge on some imported items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461208) in GitLab 17.2.
{{< /history >}}
Import your projects from Gitea to GitLab.
The Gitea importer can import:
- Repository description
- Git repository data
- Issues
- Pull requests
- Milestones
- Labels
When importing:
- Repository public access is retained. If a repository is private in Gitea, it's created as private in GitLab as well.
- Imported issues, merge requests, and comments have an **Imported** badge in GitLab.
## Known issues
- Because Gitea is not an OAuth provider, the author or assignee cannot be mapped to users on
your GitLab instance. The project creator (usually the user who started the import process)
is then set as the author. For issues, you can still see the original Gitea author.
- The Gitea importer does not import diff notes from pull requests. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/450973) for more information.
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- Gitea version 1.0.0 or later.
- [Gitea import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Gitea import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
## Import your Gitea repositories
The Gitea importer page is visible when you create a new project. To begin a Gitea import:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Gitea** to start the import authorization process.
### Authorize access to your repositories using a personal access token
With this method, you perform a one-off authorization with Gitea to grant
GitLab access your repositories:
1. Go to `https://your-gitea-instance/user/settings/applications` (replace
`your-gitea-instance` with the host of your Gitea instance).
1. Select **Generate New Token**.
1. Enter a token description.
1. Select **Generate Token**.
1. Copy the token hash.
1. Go back to GitLab and provide the token to the Gitea importer.
1. Select **List your Gitea repositories** and wait while GitLab reads
your repositories' information. After it's done, GitLab displays the importer
page to select the repositories to import.
### Select which repositories to import
After you've authorized access to your Gitea repositories, you are
redirected to the Gitea importer page.
From there, you can view the import statuses of your Gitea repositories:
- Those that are being imported show a started status.
- Those already successfully imported are green with a done status.
- Those that aren't yet imported have **Import** on the right side of the table.
- Those that are already imported have **Re-import** on the right side of the table.
You also can:
- In the upper-left corner, select **Import all projects** to import all of your Gitea projects at once.
- Filter projects by name. If a filter is applied, **Import all projects**
imports only selected projects.
- Choose a different name for the project and a different namespace if you have the privileges to do so.
## User contribution and membership mapping
{{< history >}}
- [Changed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) to [user contribution and membership mapping](_index.md#user-contribution-and-membership-mapping) in GitLab 17.8.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176675) in GitLab 17.8.
{{< /history >}}
The Gitea importer uses an [improved method](_index.md#user-contribution-and-membership-mapping)
of mapping user contributions for GitLab.com and GitLab Self-Managed.
### Old method of user contribution mapping
You can use the old user contribution mapping method for imports to GitLab Self-Managed and GitLab Dedicated instances.
To use this method, `gitea_user_mapping` must be disabled.
For imports to GitLab.com, you must
use the [improved method](_index.md#user-contribution-and-membership-mapping) instead.
Using the old method, user contributions are assigned to the project creator (usually the user who started the import process) by default.
|
https://docs.gitlab.com/user/project/cvs
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/cvs.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
cvs.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Migrating from CVS
|
Migrate from CVS to Git.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[CVS](https://savannah.nongnu.org/projects/cvs) is an old centralized version
control system similar to [SVN](https://subversion.apache.org/).
## CVS vs Git
The following list illustrates the main differences between CVS and Git:
- **Git is distributed**. On the other hand, CVS is centralized and uses a client-server
architecture. This translates to Git having a more flexible workflow because
your working area is a copy of the entire repository. This decreases the
overhead when switching branches or merging, for example, because you don't need to communicate with a remote server.
- **Atomic operations**. In Git all operations are
[atomic](https://en.wikipedia.org/wiki/Atomic_commit), either they succeed as
whole, or they fail without any changes. In CVS, commits (and other operations)
are not atomic. If an operation on the repository is interrupted in the middle,
the repository can be left in an inconsistent state.
- **Storage method**. Changes in CVS are per file (changeset), while in Git,
committed files are stored in their entirety (snapshot). This means it is
very easy in Git to revert or undo a whole change.
- **Revision IDs**. The fact that in CVS changes are per files, the revision ID
is depicted by version numbers, for example `1.4` reflects how many times a
given file has been changed. In Git, each version of a project as a whole
(each commit) has its unique name given by SHA-1.
- **Merge tracking**. Git uses a commit-before-merge approach rather than
merge-before-commit (or update-then-commit) like CVS. If while you were
preparing to create a new commit (new revision) somebody created a
new commit on the same branch and pushed to the central repository, CVS would
force you to first update your working directory and resolve conflicts before
allowing you to commit. This is not the case with Git. You first commit, save
your state in version control, then you merge the other developer's changes.
You can also ask the other developer to do the merge and resolve any conflicts
themselves.
- **Signed commits**. Git supports
[signing your commits](../repository/signed_commits/_index.md) for additional
security and verification that the commit indeed came from its original author.
GitLab shows whether a signed commit is correctly verified.
Some of the previous items were taken from this great
[Stack Overflow post](https://stackoverflow.com/a/824241/974710). For a more
complete list of differences, consult the
Wikipedia article on [comparing the different version control software](https://en.wikipedia.org/wiki/Comparison_of_version_control_software).
## Why migrate
CVS is old with no new release since 2008. Git provides more tools to work
with (`git bisect` for one) which makes for a more productive workflow.
Migrating to Git/GitLab benefits you:
- **Shorter learning curve**. Git has a big community and a vast number of
tutorials to get you started (see our [Git topic](../../../topics/git/_index.md)).
- **Integration with modern tools**. migrating to Git and GitLab you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
- **Support for many network protocols**. Git supports SSH, HTTP/HTTPS and rsync
among others, whereas CVS supports only SSH and its own insecure `pserver`
protocol with no user authentication.
## How to migrate
Here's a few links to get you started with the migration:
- [Migrate using the `cvs-fast-export` tool](https://gitlab.com/esr/cvs-fast-export)
- [Stack Overflow post on importing the CVS repository](https://stackoverflow.com/a/11490134/974710)
- [Man page of the `git-cvsimport` tool](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-cvsimport.html)
- [Migrate using `reposurgeon`](http://www.catb.org/~esr/reposurgeon/repository-editing.html#conversion)
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Migrating from CVS
description: Migrate from CVS to Git.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[CVS](https://savannah.nongnu.org/projects/cvs) is an old centralized version
control system similar to [SVN](https://subversion.apache.org/).
## CVS vs Git
The following list illustrates the main differences between CVS and Git:
- **Git is distributed**. On the other hand, CVS is centralized and uses a client-server
architecture. This translates to Git having a more flexible workflow because
your working area is a copy of the entire repository. This decreases the
overhead when switching branches or merging, for example, because you don't need to communicate with a remote server.
- **Atomic operations**. In Git all operations are
[atomic](https://en.wikipedia.org/wiki/Atomic_commit), either they succeed as
whole, or they fail without any changes. In CVS, commits (and other operations)
are not atomic. If an operation on the repository is interrupted in the middle,
the repository can be left in an inconsistent state.
- **Storage method**. Changes in CVS are per file (changeset), while in Git,
committed files are stored in their entirety (snapshot). This means it is
very easy in Git to revert or undo a whole change.
- **Revision IDs**. The fact that in CVS changes are per files, the revision ID
is depicted by version numbers, for example `1.4` reflects how many times a
given file has been changed. In Git, each version of a project as a whole
(each commit) has its unique name given by SHA-1.
- **Merge tracking**. Git uses a commit-before-merge approach rather than
merge-before-commit (or update-then-commit) like CVS. If while you were
preparing to create a new commit (new revision) somebody created a
new commit on the same branch and pushed to the central repository, CVS would
force you to first update your working directory and resolve conflicts before
allowing you to commit. This is not the case with Git. You first commit, save
your state in version control, then you merge the other developer's changes.
You can also ask the other developer to do the merge and resolve any conflicts
themselves.
- **Signed commits**. Git supports
[signing your commits](../repository/signed_commits/_index.md) for additional
security and verification that the commit indeed came from its original author.
GitLab shows whether a signed commit is correctly verified.
Some of the previous items were taken from this great
[Stack Overflow post](https://stackoverflow.com/a/824241/974710). For a more
complete list of differences, consult the
Wikipedia article on [comparing the different version control software](https://en.wikipedia.org/wiki/Comparison_of_version_control_software).
## Why migrate
CVS is old with no new release since 2008. Git provides more tools to work
with (`git bisect` for one) which makes for a more productive workflow.
Migrating to Git/GitLab benefits you:
- **Shorter learning curve**. Git has a big community and a vast number of
tutorials to get you started (see our [Git topic](../../../topics/git/_index.md)).
- **Integration with modern tools**. migrating to Git and GitLab you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
- **Support for many network protocols**. Git supports SSH, HTTP/HTTPS and rsync
among others, whereas CVS supports only SSH and its own insecure `pserver`
protocol with no user authentication.
## How to migrate
Here's a few links to get you started with the migration:
- [Migrate using the `cvs-fast-export` tool](https://gitlab.com/esr/cvs-fast-export)
- [Stack Overflow post on importing the CVS repository](https://stackoverflow.com/a/11490134/974710)
- [Man page of the `git-cvsimport` tool](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-cvsimport.html)
- [Migrate using `reposurgeon`](http://www.catb.org/~esr/reposurgeon/repository-editing.html#conversion)
|
https://docs.gitlab.com/user/project/bitbucket_server
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/bitbucket_server.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
bitbucket_server.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import your project from Bitbucket Server
|
Import projects from Bitbucket Server to GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
- Ability to import reviewers [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416611) in GitLab 16.3.
- Support for pull request approval imports [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135256) in GitLab 16.7.
- An **Imported** badge on some imported items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461211) in GitLab 17.2.
{{< /history >}}
Import your projects from Bitbucket Server to GitLab.
## Estimating import duration
Every import from Bitbucket Server is different, which affects the duration of imports you perform.
However, to help estimate the duration of your import, a project comprised of the following data is likely to take 8 hours to import:
- 13,000 pull requests
- 10,00 branches
- 7,000 tags
- 500 GiB repository
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Bitbucket Server import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Bitbucket Server import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
- Bitbucket Server authentication token with administrator access. Without administrator access, some data is
[not imported](https://gitlab.com/gitlab-org/gitlab/-/issues/446218).
## Import repositories
To import your Bitbucket repositories:
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **Bitbucket Server**.
1. Sign in to Bitbucket and grant GitLab access to your Bitbucket account.
1. Select the projects to import, or import all projects. You can filter projects by name and select
the namespace for which to import each project.
1. To import a project:
- For the first time: Select **Import**.
- Again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
## Items that are imported
- Repository description
- Git repository data
- Pull requests, including comments, user mentions, reviewers, and merge events
- LFS objects
When importing:
- Repository public access is retained. If a repository is private in Bitbucket, it's created as private in GitLab as
well.
- Imported merge requests and comments have an **Imported** badge in GitLab.
When closed or merged pull requests are imported, commit SHAs that do not exist in the repository are fetched from the Bitbucket server
to make sure pull requests have commits tied to them:
- Source commit SHAs are saved with references in the format `refs/merge-requests/<iid>/head`.
- Target commit SHAs are saved with references in the format `refs/keep-around/<SHA>`.
If the source commit does not exist in the repository, a commit containing the SHA in the commit message is used instead.
## Items that are not imported
The following items aren't imported:
- Attachments in Markdown
- Task lists
- Emoji reactions
- Pull request approvals
- Approval rules for pull requests
## Items that are imported but changed
The following items are changed when they are imported:
- GitLab doesn't allow comments on arbitrary lines of code. Any out-of-bounds Bitbucket comments are
inserted as comments in the merge request.
- Multiple threading levels are collapsed into one thread and
quotes are added as part of the original comment.
- Project filtering doesn't support fuzzy search. Only **starts with** or **full match** strings are
supported.
## User contribution and membership mapping
{{< history >}}
- User mapping by email address or username [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36885) in GitLab 13.4 [with a flag](../../../administration/feature_flags/_index.md) named `bitbucket_server_user_mapping_by_username`. Disabled by default.
- Mapping user mentions to GitLab users [added](https://gitlab.com/gitlab-org/gitlab/-/issues/433008) in GitLab 16.8.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/153041) to map users only by email address in GitLab 17.1.
- [Changed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) to [user contribution and membership mapping](_index.md#user-contribution-and-membership-mapping) in GitLab 17.8.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176675) in GitLab 17.8.
{{< /history >}}
The Bitbucket Server importer uses an [improved method](_index.md#user-contribution-and-membership-mapping)
of mapping user contributions for GitLab.com and GitLab Self-Managed.
### Old method of user contribution mapping
You can use the old user contribution mapping method for imports to GitLab Self-Managed and GitLab Dedicated instances.
To use this method, `bitbucket_server_user_mapping` must be disabled.
For imports to GitLab.com, you must
use the [improved method](_index.md#user-contribution-and-membership-mapping) instead.
Using the old method, the importer tries to match a Bitbucket Server user's email address with a confirmed email address in the GitLab user database. If no
such user is found:
- The project creator is used instead. The importer appends a note in the comment to mark the original creator.
- For pull request reviewers, no reviewer is assigned.
- For pull request approvers, no approval is added.
`@mentions` on pull request descriptions and notes are matched to user profiles on a Bitbucket Server by using the user's email address.
If a user with the same email address is not found on GitLab, the `@mention` is made static.
For a user to be matched, they must have a GitLab role that provides at least read access to the project.
If the project is public, GitLab only matches users who are invited to the project.
The importer creates any new namespaces (groups) if they don't exist. If the namespace is taken, the
repository imports under the namespace of the user who started the import process.
## Troubleshooting
### General
If the GUI-based import tool does not work, you can try to:
- Use the [GitLab Import API](../../../api/import.md#import-repository-from-bitbucket-server)
Bitbucket Server endpoint.
- Set up [repository mirroring](../repository/mirror/_index.md).
It provides verbose error output.
See the [troubleshooting section](bitbucket.md#troubleshooting)
for Bitbucket Cloud.
### LFS objects not imported
If the project import completes but LFS objects can't be downloaded or cloned, you may be using a
password or personal access token containing special characters. For more information, see
[this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/337769).
### Import fails due to invalid/unresolved host address, or the import URL is blocked
If a project import fails with an error message such as `Importing the project failed: Import url is blocked`, even though the initial connection to the Bitbucket
server succeeded, the Bitbucket server or a reverse proxy might not be configured correctly.
To troubleshoot this problem, use the [Projects API](../../../api/projects.md) to check for the newly-created project and locate the `import_url` value of the project.
This value indicates the URL provided by the Bitbucket server to use for the import. If this URL isn't publicly resolvable, you can get unresolvable address errors.
To fix this problem, ensure that the Bitbucket server is aware of any proxy servers because proxy servers can impact how Bitbucket constructs and uses URLs.
For more information, see [Proxy and secure Bitbucket](https://confluence.atlassian.com/bitbucketserver/proxy-and-secure-bitbucket-776640099.html).
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import your project from Bitbucket Server
description: Import projects from Bitbucket Server to GitLab.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
- Ability to import reviewers [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416611) in GitLab 16.3.
- Support for pull request approval imports [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135256) in GitLab 16.7.
- An **Imported** badge on some imported items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461211) in GitLab 17.2.
{{< /history >}}
Import your projects from Bitbucket Server to GitLab.
## Estimating import duration
Every import from Bitbucket Server is different, which affects the duration of imports you perform.
However, to help estimate the duration of your import, a project comprised of the following data is likely to take 8 hours to import:
- 13,000 pull requests
- 10,00 branches
- 7,000 tags
- 500 GiB repository
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Bitbucket Server import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Bitbucket Server import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
- Bitbucket Server authentication token with administrator access. Without administrator access, some data is
[not imported](https://gitlab.com/gitlab-org/gitlab/-/issues/446218).
## Import repositories
To import your Bitbucket repositories:
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **Bitbucket Server**.
1. Sign in to Bitbucket and grant GitLab access to your Bitbucket account.
1. Select the projects to import, or import all projects. You can filter projects by name and select
the namespace for which to import each project.
1. To import a project:
- For the first time: Select **Import**.
- Again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
## Items that are imported
- Repository description
- Git repository data
- Pull requests, including comments, user mentions, reviewers, and merge events
- LFS objects
When importing:
- Repository public access is retained. If a repository is private in Bitbucket, it's created as private in GitLab as
well.
- Imported merge requests and comments have an **Imported** badge in GitLab.
When closed or merged pull requests are imported, commit SHAs that do not exist in the repository are fetched from the Bitbucket server
to make sure pull requests have commits tied to them:
- Source commit SHAs are saved with references in the format `refs/merge-requests/<iid>/head`.
- Target commit SHAs are saved with references in the format `refs/keep-around/<SHA>`.
If the source commit does not exist in the repository, a commit containing the SHA in the commit message is used instead.
## Items that are not imported
The following items aren't imported:
- Attachments in Markdown
- Task lists
- Emoji reactions
- Pull request approvals
- Approval rules for pull requests
## Items that are imported but changed
The following items are changed when they are imported:
- GitLab doesn't allow comments on arbitrary lines of code. Any out-of-bounds Bitbucket comments are
inserted as comments in the merge request.
- Multiple threading levels are collapsed into one thread and
quotes are added as part of the original comment.
- Project filtering doesn't support fuzzy search. Only **starts with** or **full match** strings are
supported.
## User contribution and membership mapping
{{< history >}}
- User mapping by email address or username [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36885) in GitLab 13.4 [with a flag](../../../administration/feature_flags/_index.md) named `bitbucket_server_user_mapping_by_username`. Disabled by default.
- Mapping user mentions to GitLab users [added](https://gitlab.com/gitlab-org/gitlab/-/issues/433008) in GitLab 16.8.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/153041) to map users only by email address in GitLab 17.1.
- [Changed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) to [user contribution and membership mapping](_index.md#user-contribution-and-membership-mapping) in GitLab 17.8.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176675) in GitLab 17.8.
{{< /history >}}
The Bitbucket Server importer uses an [improved method](_index.md#user-contribution-and-membership-mapping)
of mapping user contributions for GitLab.com and GitLab Self-Managed.
### Old method of user contribution mapping
You can use the old user contribution mapping method for imports to GitLab Self-Managed and GitLab Dedicated instances.
To use this method, `bitbucket_server_user_mapping` must be disabled.
For imports to GitLab.com, you must
use the [improved method](_index.md#user-contribution-and-membership-mapping) instead.
Using the old method, the importer tries to match a Bitbucket Server user's email address with a confirmed email address in the GitLab user database. If no
such user is found:
- The project creator is used instead. The importer appends a note in the comment to mark the original creator.
- For pull request reviewers, no reviewer is assigned.
- For pull request approvers, no approval is added.
`@mentions` on pull request descriptions and notes are matched to user profiles on a Bitbucket Server by using the user's email address.
If a user with the same email address is not found on GitLab, the `@mention` is made static.
For a user to be matched, they must have a GitLab role that provides at least read access to the project.
If the project is public, GitLab only matches users who are invited to the project.
The importer creates any new namespaces (groups) if they don't exist. If the namespace is taken, the
repository imports under the namespace of the user who started the import process.
## Troubleshooting
### General
If the GUI-based import tool does not work, you can try to:
- Use the [GitLab Import API](../../../api/import.md#import-repository-from-bitbucket-server)
Bitbucket Server endpoint.
- Set up [repository mirroring](../repository/mirror/_index.md).
It provides verbose error output.
See the [troubleshooting section](bitbucket.md#troubleshooting)
for Bitbucket Cloud.
### LFS objects not imported
If the project import completes but LFS objects can't be downloaded or cloned, you may be using a
password or personal access token containing special characters. For more information, see
[this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/337769).
### Import fails due to invalid/unresolved host address, or the import URL is blocked
If a project import fails with an error message such as `Importing the project failed: Import url is blocked`, even though the initial connection to the Bitbucket
server succeeded, the Bitbucket server or a reverse proxy might not be configured correctly.
To troubleshoot this problem, use the [Projects API](../../../api/projects.md) to check for the newly-created project and locate the `import_url` value of the project.
This value indicates the URL provided by the Bitbucket server to use for the import. If this URL isn't publicly resolvable, you can get unresolvable address errors.
To fix this problem, ensure that the Bitbucket server is aware of any proxy servers because proxy servers can impact how Bitbucket constructs and uses URLs.
For more information, see [Proxy and secure Bitbucket](https://confluence.atlassian.com/bitbucketserver/proxy-and-secure-bitbucket-776640099.html).
|
https://docs.gitlab.com/user/project/bitbucket
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/bitbucket.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
bitbucket.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import your project from Bitbucket Cloud
|
Import projects from Bitbucket Cloud to GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Parallel imports from Bitbucket Cloud [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412614) in GitLab 16.6 [with a flag](../../../administration/feature_flags/_index.md) named `bitbucket_parallel_importer`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/423530) in GitLab 16.6.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/423530) in GitLab 16.7. Feature flag `bitbucket_parallel_importer` removed.
- An **Imported** badge on some imported items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461210) in GitLab 17.2.
{{< /history >}}
Import your projects from Bitbucket Cloud to GitLab.
The Bitbucket importer can import:
- Repository description
- Git repository data
- Issues, including comments
- Pull requests, including comments
- Milestones
- Wiki
- Labels
- Milestones
- LFS objects
The Bitbucket importer cannot import:
- Pull request approvals
- Approval rules
When importing:
- References to pull requests and issues are preserved.
- Repository public access is retained. If a repository is private in Bitbucket, it's created as
private in GitLab as well.
- Imported issues, merge requests, and comments have an **Imported** badge in GitLab.
{{< alert type="note" >}}
The Bitbucket Cloud importer works only with [Bitbucket.org](https://bitbucket.org/), not with Bitbucket
Server (aka Stash). If you are trying to import projects from Bitbucket Server, use
[the Bitbucket Server importer](bitbucket_server.md).
{{< /alert >}}
When issues, pull requests, and comments are imported, the Bitbucket importer uses the Bitbucket nickname of
the author/assignee and tries to find the same Bitbucket identity in GitLab. If they don't match or
the user is not found in the GitLab database, the project creator (most of the times the current
user that started the import process) is set as the author, but a reference on the issue about the
original Bitbucket author is kept.
For pull requests:
- If the source SHA does not exist in the repository, the importer attempts to set the source commit to the merge commit SHA.
- The merge request assignee is set to the author. Reviewers are set with usernames matching Bitbucket identities in GitLab.
- Merge requests in GitLab can be either can be either `opened`, `closed` or `merged`.
For issues:
- A label is added corresponding to the type of issue on Bitbucket. Either `bug`, `enhancement`, `proposal` or `task`.
- If the issue on Bitbucket was one of `resolved`, `invalid`, `duplicate`, `wontfix`, or `closed`, the issue is closed on GitLab.
The importer creates any new namespaces (groups) if they don't exist or in
the case the namespace is taken, the repository is imported under the user's
namespace that started the import process.
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Bitbucket Cloud integration](../../../integration/bitbucket.md) must be enabled. If that integration is not enabled, ask your GitLab administrator
to enable it. The Bitbucket Cloud integration is enabled by default on GitLab.com.
- [Bitbucket Cloud import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources) must be enabled. If not enabled, ask your
GitLab administrator to enable it. The Bitbucket Cloud import source is enabled by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
- Pull requests in Bitbucket must have the same source and destination project and not be from a fork of a project.
Otherwise, the pull requests are imported as empty merge requests.
### Requirements for user-mapped contributions
For user contributions to be mapped, each user must complete the following before the project import:
1. Verify that the username in the [Bitbucket account settings](https://bitbucket.org/account/settings/)
matches the public name in the [Atlassian account settings](https://id.atlassian.com/manage-profile/profile-and-visibility).
If they don't match, modify the public name in the Atlassian account settings to match the
username in the Bitbucket account settings.
1. Connect your Bitbucket account in [GitLab profile service sign-in](https://gitlab.com/-/profile/account).
## Import your Bitbucket repositories
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
{{< /history >}}
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **Bitbucket Cloud**.
1. Sign in to Bitbucket, then select **Grant access** to give GitLab access to your Bitbucket account.
1. Select the projects you want to import, or import all projects.
You can filter projects by name and select the namespace
each project is imported for.
1. To import a project:
- For the first time: Select **Import**.
- Again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
### Generate a Bitbucket Cloud app password
If you want to use the [GitLab REST API](../../../api/import.md#import-repository-from-bitbucket-cloud) to import a
Bitbucket Cloud repository, you must create a Bitbucket Cloud app password.
To generate a Bitbucket Cloud app password:
1. Go to <https://bitbucket.org/account/settings/>.
1. In the **Access Management** section, select **App passwords**.
1. Select **Create app password**.
1. Enter password name.
1. Select at least the following permissions:
```plaintext
Account: Email, Read
Projects: Read
Repositories: Read
Pull Requests: Read
Issues: Read
Wiki: Read and Write
```
1. Select **Create**.
## Troubleshooting
### If you have more than one Bitbucket account
Be sure to sign in to the correct account.
If you've accidentally started the import process with the wrong account, follow these steps:
1. Revoke GitLab access to your Bitbucket account, essentially reversing the process in the following procedure: [Import your Bitbucket repositories](#import-your-bitbucket-repositories).
1. Sign out of the Bitbucket account. Follow the procedure linked from the previous step.
### User mapping fails despite matching names
[For user mapping to work](#requirements-for-user-mapped-contributions),
the username in the Bitbucket account settings must match the public name in the Atlassian account
settings. If these names match but user mapping still fails, the user may have modified their
Bitbucket username after connecting their Bitbucket account in the
[GitLab profile service sign-in](https://gitlab.com/-/profile/account).
To fix this, the user must verify that their Bitbucket external UID in the GitLab database matches their
current Bitbucket public name, and reconnect if there's a mismatch:
1. [Use the API to get the currently authenticated user](../../../api/users.md#as-a-regular-user-2).
1. In the API response, the `identities` attribute contains the Bitbucket account that exists in
the GitLab database. If the `extern_uid` doesn't match the current Bitbucket public name, the
user should reconnect their Bitbucket account in the [GitLab profile service sign-in](https://gitlab.com/-/profile/account).
1. Following reconnection, the user should use the API again to verify that their `extern_uid` in
the GitLab database now matches their current Bitbucket public name.
The importer must then [delete the imported project](../working_with_projects.md#delete-a-project)
and import again.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import your project from Bitbucket Cloud
description: Import projects from Bitbucket Cloud to GitLab.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Parallel imports from Bitbucket Cloud [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412614) in GitLab 16.6 [with a flag](../../../administration/feature_flags/_index.md) named `bitbucket_parallel_importer`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/423530) in GitLab 16.6.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/423530) in GitLab 16.7. Feature flag `bitbucket_parallel_importer` removed.
- An **Imported** badge on some imported items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461210) in GitLab 17.2.
{{< /history >}}
Import your projects from Bitbucket Cloud to GitLab.
The Bitbucket importer can import:
- Repository description
- Git repository data
- Issues, including comments
- Pull requests, including comments
- Milestones
- Wiki
- Labels
- Milestones
- LFS objects
The Bitbucket importer cannot import:
- Pull request approvals
- Approval rules
When importing:
- References to pull requests and issues are preserved.
- Repository public access is retained. If a repository is private in Bitbucket, it's created as
private in GitLab as well.
- Imported issues, merge requests, and comments have an **Imported** badge in GitLab.
{{< alert type="note" >}}
The Bitbucket Cloud importer works only with [Bitbucket.org](https://bitbucket.org/), not with Bitbucket
Server (aka Stash). If you are trying to import projects from Bitbucket Server, use
[the Bitbucket Server importer](bitbucket_server.md).
{{< /alert >}}
When issues, pull requests, and comments are imported, the Bitbucket importer uses the Bitbucket nickname of
the author/assignee and tries to find the same Bitbucket identity in GitLab. If they don't match or
the user is not found in the GitLab database, the project creator (most of the times the current
user that started the import process) is set as the author, but a reference on the issue about the
original Bitbucket author is kept.
For pull requests:
- If the source SHA does not exist in the repository, the importer attempts to set the source commit to the merge commit SHA.
- The merge request assignee is set to the author. Reviewers are set with usernames matching Bitbucket identities in GitLab.
- Merge requests in GitLab can be either can be either `opened`, `closed` or `merged`.
For issues:
- A label is added corresponding to the type of issue on Bitbucket. Either `bug`, `enhancement`, `proposal` or `task`.
- If the issue on Bitbucket was one of `resolved`, `invalid`, `duplicate`, `wontfix`, or `closed`, the issue is closed on GitLab.
The importer creates any new namespaces (groups) if they don't exist or in
the case the namespace is taken, the repository is imported under the user's
namespace that started the import process.
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Bitbucket Cloud integration](../../../integration/bitbucket.md) must be enabled. If that integration is not enabled, ask your GitLab administrator
to enable it. The Bitbucket Cloud integration is enabled by default on GitLab.com.
- [Bitbucket Cloud import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources) must be enabled. If not enabled, ask your
GitLab administrator to enable it. The Bitbucket Cloud import source is enabled by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
- Pull requests in Bitbucket must have the same source and destination project and not be from a fork of a project.
Otherwise, the pull requests are imported as empty merge requests.
### Requirements for user-mapped contributions
For user contributions to be mapped, each user must complete the following before the project import:
1. Verify that the username in the [Bitbucket account settings](https://bitbucket.org/account/settings/)
matches the public name in the [Atlassian account settings](https://id.atlassian.com/manage-profile/profile-and-visibility).
If they don't match, modify the public name in the Atlassian account settings to match the
username in the Bitbucket account settings.
1. Connect your Bitbucket account in [GitLab profile service sign-in](https://gitlab.com/-/profile/account).
## Import your Bitbucket repositories
{{< history >}}
- Ability to re-import projects [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23905) in GitLab 15.9.
{{< /history >}}
1. Sign in to GitLab.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **Bitbucket Cloud**.
1. Sign in to Bitbucket, then select **Grant access** to give GitLab access to your Bitbucket account.
1. Select the projects you want to import, or import all projects.
You can filter projects by name and select the namespace
each project is imported for.
1. To import a project:
- For the first time: Select **Import**.
- Again: Select **Re-import**. Specify a new name and select **Re-import** again. Re-importing creates a new copy of the source project.
### Generate a Bitbucket Cloud app password
If you want to use the [GitLab REST API](../../../api/import.md#import-repository-from-bitbucket-cloud) to import a
Bitbucket Cloud repository, you must create a Bitbucket Cloud app password.
To generate a Bitbucket Cloud app password:
1. Go to <https://bitbucket.org/account/settings/>.
1. In the **Access Management** section, select **App passwords**.
1. Select **Create app password**.
1. Enter password name.
1. Select at least the following permissions:
```plaintext
Account: Email, Read
Projects: Read
Repositories: Read
Pull Requests: Read
Issues: Read
Wiki: Read and Write
```
1. Select **Create**.
## Troubleshooting
### If you have more than one Bitbucket account
Be sure to sign in to the correct account.
If you've accidentally started the import process with the wrong account, follow these steps:
1. Revoke GitLab access to your Bitbucket account, essentially reversing the process in the following procedure: [Import your Bitbucket repositories](#import-your-bitbucket-repositories).
1. Sign out of the Bitbucket account. Follow the procedure linked from the previous step.
### User mapping fails despite matching names
[For user mapping to work](#requirements-for-user-mapped-contributions),
the username in the Bitbucket account settings must match the public name in the Atlassian account
settings. If these names match but user mapping still fails, the user may have modified their
Bitbucket username after connecting their Bitbucket account in the
[GitLab profile service sign-in](https://gitlab.com/-/profile/account).
To fix this, the user must verify that their Bitbucket external UID in the GitLab database matches their
current Bitbucket public name, and reconnect if there's a mismatch:
1. [Use the API to get the currently authenticated user](../../../api/users.md#as-a-regular-user-2).
1. In the API response, the `identities` attribute contains the Bitbucket account that exists in
the GitLab database. If the `extern_uid` doesn't match the current Bitbucket public name, the
user should reconnect their Bitbucket account in the [GitLab profile service sign-in](https://gitlab.com/-/profile/account).
1. Following reconnection, the user should use the API again to verify that their `extern_uid` in
the GitLab database now matches their current Bitbucket public name.
The importer must then [delete the imported project](../working_with_projects.md#delete-a-project)
and import again.
|
https://docs.gitlab.com/user/project/troubleshooting_github_import
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/troubleshooting_github_import.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
troubleshooting_github_import.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting importing a project from GitHub to GitLab
|
Troubleshooting GitHub import issues including failed processes, missing prefixes, and large project errors.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When importing a project from GitHub to GitLab, you might encounter the following issues.
## Manually continue a previously failed import process
In some cases, the GitHub import process can fail to import the repository. This causes GitLab to abort the project import process and requires the
repository to be imported manually. Administrators can manually import the repository for a failed import process:
1. Open a Rails console.
1. Run the following series of commands in the console:
```ruby
project_id = <PROJECT_ID>
github_access_token = <GITHUB_ACCESS_TOKEN>
github_repository_path = '<GROUP>/<REPOSITORY>'
github_repository_url = "https://#{github_access_token}@github.com/#{github_repository_path}.git"
# Find project by ID
project = Project.find(project_id)
# Set import URL and credentials
project.import_url = github_repository_url
project.import_type = 'github'
project.import_source = github_repository_path
project.save!
# Create an import state if the project was created manually and not from a failed import
project.create_import_state if project.import_state.blank?
# Set state to start
project.import_state.force_start
# Optional: If your import had certain optional stages selected or a timeout strategy
# set, you can reset them here. Below is an example.
# The params follow the format documented in the API:
# https://docs.gitlab.com/ee/api/import.html#import-repository-from-github
Gitlab::GithubImport::Settings
.new(project)
.write(
timeout_strategy: "optimistic",
optional_stages: {
single_endpoint_issue_events_import: true,
single_endpoint_notes_import: true,
attachments_import: true,
collaborators_import: true
}
)
# Trigger import from second step
Gitlab::GithubImport::Stage::ImportRepositoryWorker.perform_async(project.id)
```
## Import fails due to missing prefix
In GitLab 16.5 and later, you might get an error that states `Import failed due to a GitHub error: (HTTP 406)`.
This issue occurs because, in GitLab 16.5, the path prefix `api/v3` was removed from the GitHub importer. This happened because the importer stopped using the `Gitlab::LegacyGithubImport::Client`. This client automatically added the `api/v3` prefix on imports from a GitHub Enterprise URL.
To work around this error, [add the `api/v3` prefix](https://gitlab.com/gitlab-org/gitlab/-/issues/438358#note_1978902725) when importing from a GitHub Enterprise URL.
## Errors when importing large projects
The GitHub importer might encounter some errors when importing large projects.
### Missing comments
The GitHub API has a limit that prevents more than approximately 30,000 notes or diff notes from being imported.
When this limit is reached, the GitHub API instead returns the following error:
```plaintext
In order to keep the API fast for everyone, pagination is limited for this resource. Check the rel=last link relation in the Link response header to see how far back you can traverse.
```
When importing GitHub projects with a large number of comments, select the **Use alternative comments import method**
[additional item to import](github.md#select-additional-items-to-import) checkbox. This setting makes the import process take longer because it increases the number of network requests
required to perform the import.
## GitLab instance cannot connect to GitHub
GitLab Self-Managed instances that run GitLab 15.10 or earlier, and are behind proxies, cannot resolve DNS for `github.com` or `api.github.com`.
The GitLab instance fails to connect to GitHub during the import and you must add `github.com` and `api.github.com`
entries in the [allowlist for local requests](../../../security/webhooks.md#allow-outbound-requests-to-certain-ip-addresses-and-domains).
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Troubleshooting importing a project from GitHub to GitLab
description: Troubleshooting GitHub import issues including failed processes, missing
prefixes, and large project errors.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When importing a project from GitHub to GitLab, you might encounter the following issues.
## Manually continue a previously failed import process
In some cases, the GitHub import process can fail to import the repository. This causes GitLab to abort the project import process and requires the
repository to be imported manually. Administrators can manually import the repository for a failed import process:
1. Open a Rails console.
1. Run the following series of commands in the console:
```ruby
project_id = <PROJECT_ID>
github_access_token = <GITHUB_ACCESS_TOKEN>
github_repository_path = '<GROUP>/<REPOSITORY>'
github_repository_url = "https://#{github_access_token}@github.com/#{github_repository_path}.git"
# Find project by ID
project = Project.find(project_id)
# Set import URL and credentials
project.import_url = github_repository_url
project.import_type = 'github'
project.import_source = github_repository_path
project.save!
# Create an import state if the project was created manually and not from a failed import
project.create_import_state if project.import_state.blank?
# Set state to start
project.import_state.force_start
# Optional: If your import had certain optional stages selected or a timeout strategy
# set, you can reset them here. Below is an example.
# The params follow the format documented in the API:
# https://docs.gitlab.com/ee/api/import.html#import-repository-from-github
Gitlab::GithubImport::Settings
.new(project)
.write(
timeout_strategy: "optimistic",
optional_stages: {
single_endpoint_issue_events_import: true,
single_endpoint_notes_import: true,
attachments_import: true,
collaborators_import: true
}
)
# Trigger import from second step
Gitlab::GithubImport::Stage::ImportRepositoryWorker.perform_async(project.id)
```
## Import fails due to missing prefix
In GitLab 16.5 and later, you might get an error that states `Import failed due to a GitHub error: (HTTP 406)`.
This issue occurs because, in GitLab 16.5, the path prefix `api/v3` was removed from the GitHub importer. This happened because the importer stopped using the `Gitlab::LegacyGithubImport::Client`. This client automatically added the `api/v3` prefix on imports from a GitHub Enterprise URL.
To work around this error, [add the `api/v3` prefix](https://gitlab.com/gitlab-org/gitlab/-/issues/438358#note_1978902725) when importing from a GitHub Enterprise URL.
## Errors when importing large projects
The GitHub importer might encounter some errors when importing large projects.
### Missing comments
The GitHub API has a limit that prevents more than approximately 30,000 notes or diff notes from being imported.
When this limit is reached, the GitHub API instead returns the following error:
```plaintext
In order to keep the API fast for everyone, pagination is limited for this resource. Check the rel=last link relation in the Link response header to see how far back you can traverse.
```
When importing GitHub projects with a large number of comments, select the **Use alternative comments import method**
[additional item to import](github.md#select-additional-items-to-import) checkbox. This setting makes the import process take longer because it increases the number of network requests
required to perform the import.
## GitLab instance cannot connect to GitHub
GitLab Self-Managed instances that run GitLab 15.10 or earlier, and are behind proxies, cannot resolve DNS for `github.com` or `api.github.com`.
The GitLab instance fails to connect to GitHub during the import and you must add `github.com` and `api.github.com`
entries in the [allowlist for local requests](../../../security/webhooks.md#allow-outbound-requests-to-certain-ip-addresses-and-domains).
|
https://docs.gitlab.com/user/project/jira
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/jira.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
jira.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import your Jira project issues to GitLab
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Using GitLab Jira importer, you can import your Jira issues to GitLab.com or to
GitLab Self-Managed.
Jira issues import is an MVC, project-level feature, meaning that issues from multiple
Jira projects can be imported into a GitLab project. MVC version imports issue title and description
and some other issue metadata as a section in the issue description.
## Known limitations
GitLab imports the following information directly:
- The issue's title, description, and labels.
- You can also map Jira users to GitLab project members when preparing for the import.
Other Jira issue metadata that is not formally mapped to GitLab issue fields is
imported into the GitLab issue's description as plain text.
Text in Jira issues is not parsed to GitLab Flavored Markdown which can result in broken text formatting.
For more information, see [issue 379104](https://gitlab.com/gitlab-org/gitlab/-/issues/379104).
There is an [epic](https://gitlab.com/groups/gitlab-org/-/epics/2738) tracking the addition of issue assignees, comments, and much more in the future
iterations of the GitLab Jira importer.
## Prerequisites
- To be able to import issues from a Jira project you must have read access on Jira
issues and at least the Maintainer role for the GitLab project that you wish to import into.
- This feature uses the existing GitLab [Jira issue integration](../../../integration/jira/_index.md).
Make sure you have the integration set up before trying to import Jira issues.
## Import Jira issues to GitLab
{{< alert type="note" >}}
Importing Jira issues is done as an asynchronous background job, which
may result in delays based on import queues load, system load, or other factors.
Importing large projects may take several minutes depending on the size of the import.
{{< /alert >}}
To import Jira issues to a GitLab project:
1. On the {{< icon name="issues" >}} **Issues** page, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Import from Jira**.

The **Import from Jira** option is only visible if you have the [correct permissions](#prerequisites).
The following form appears.
If you've previously set up the [Jira issues integration](../../../integration/jira/_index.md), you can now see
the Jira projects that you have access to in the dropdown list.

1. Select the **Import from** dropdown list and select the Jira project that you wish to import issues from.
In the **Jira-GitLab user mapping template** section, the table shows to which GitLab users your Jira
users are mapped.
When the form appears, the dropdown list defaults to the user conducting the import.
1. To change any of the mappings, select the dropdown list in the **GitLab username** column and
select the user you want to map to each Jira user.
The dropdown list may not show all the users, so use the search bar to find a specific
user in this GitLab project.
1. Select **Continue**. You're presented with a confirmation that import has started.
While the import is running in the background, you can navigate
to the **Issues** page to see the new issues appearing in the list.
1. To check the status of your import, go to the Jira import page again.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import your Jira project issues to GitLab
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Using GitLab Jira importer, you can import your Jira issues to GitLab.com or to
GitLab Self-Managed.
Jira issues import is an MVC, project-level feature, meaning that issues from multiple
Jira projects can be imported into a GitLab project. MVC version imports issue title and description
and some other issue metadata as a section in the issue description.
## Known limitations
GitLab imports the following information directly:
- The issue's title, description, and labels.
- You can also map Jira users to GitLab project members when preparing for the import.
Other Jira issue metadata that is not formally mapped to GitLab issue fields is
imported into the GitLab issue's description as plain text.
Text in Jira issues is not parsed to GitLab Flavored Markdown which can result in broken text formatting.
For more information, see [issue 379104](https://gitlab.com/gitlab-org/gitlab/-/issues/379104).
There is an [epic](https://gitlab.com/groups/gitlab-org/-/epics/2738) tracking the addition of issue assignees, comments, and much more in the future
iterations of the GitLab Jira importer.
## Prerequisites
- To be able to import issues from a Jira project you must have read access on Jira
issues and at least the Maintainer role for the GitLab project that you wish to import into.
- This feature uses the existing GitLab [Jira issue integration](../../../integration/jira/_index.md).
Make sure you have the integration set up before trying to import Jira issues.
## Import Jira issues to GitLab
{{< alert type="note" >}}
Importing Jira issues is done as an asynchronous background job, which
may result in delays based on import queues load, system load, or other factors.
Importing large projects may take several minutes depending on the size of the import.
{{< /alert >}}
To import Jira issues to a GitLab project:
1. On the {{< icon name="issues" >}} **Issues** page, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Import from Jira**.

The **Import from Jira** option is only visible if you have the [correct permissions](#prerequisites).
The following form appears.
If you've previously set up the [Jira issues integration](../../../integration/jira/_index.md), you can now see
the Jira projects that you have access to in the dropdown list.

1. Select the **Import from** dropdown list and select the Jira project that you wish to import issues from.
In the **Jira-GitLab user mapping template** section, the table shows to which GitLab users your Jira
users are mapped.
When the form appears, the dropdown list defaults to the user conducting the import.
1. To change any of the mappings, select the dropdown list in the **GitLab username** column and
select the user you want to map to each Jira user.
The dropdown list may not show all the users, so use the search bar to find a specific
user in this GitLab project.
1. Select **Continue**. You're presented with a confirmation that import has started.
While the import is running in the background, you can navigate
to the **Issues** page to see the new issues appearing in the list.
1. To check the status of your import, go to the Jira import page again.
|
https://docs.gitlab.com/user/project/perforce
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/perforce.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
perforce.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Migrating from Perforce Helix
|
Migrate from Perforce Helix to Git.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[Perforce Helix](https://www.perforce.com/) provides a set of tools which also
include a centralized, proprietary version control system similar to Git.
## Perforce vs Git
The following list illustrates the main differences between Perforce Helix and
Git:
- In general, the biggest difference is that Perforce branching is heavyweight
compared to Git lightweight branching. When you create a branch in Perforce,
it creates an integration record in their proprietary database for every file
in the branch, regardless how many were actually changed. With Git, however,
a single SHA acts as a pointer to the state of the whole repository after the
changes, which can be helpful when adopting feature branching workflows.
- Context switching between branches is less complex in Git. If your manager
says, 'You need to stop work on that new feature and fix this security
vulnerability,' Git can help you do this.
- Having a complete copy of the project and its history on your local computer
means every transaction is very fast, and Git provides that. You can branch
or merge, and experiment in isolation, and then clean up before sharing your
changes with others.
- Git makes code review less complex, because you can share your changes without
merging them to the default branch. This is compared to Perforce, which had to
implement a Shelving feature on the server so others could review changes
before merging.
## Why migrate
Perforce Helix can be difficult to manage both from a user and an administrator
perspective. Migrating to Git/GitLab there is:
- **No licensing costs**: Git is GPL while Perforce Helix is proprietary.
- **Shorter learning curve**: Git has a big community and a vast number of
tutorials to get you started.
- **Integration with modern tools**: By migrating to Git and GitLab, you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
## How to migrate
Git includes a built-in mechanism (`git p4`) to pull code from Perforce and to
submit back from Git to Perforce.
Here's a few links to get you started:
- [`git-p4` manual page](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-p4.html)
- [`git-p4` example usage](https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/Git-p4_Usage.html)
- [Git book migration guide](https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git#_perforce_import)
`git p4` and `git filter-branch` are not very good at
creating small and efficient Git packfiles. So it might be a good
idea to spend time and CPU to properly repack your repository before
sending it for the first time to your GitLab server. See
[this StackOverflow question](https://stackoverflow.com/questions/28720151/git-gc-aggressive-vs-git-repack/).
## Related topics
- [Mirror with Perforce Helix with Git Fusion](../repository/mirror/bidirectional.md#mirror-with-perforce-helix-with-git-fusion)
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Migrating from Perforce Helix
description: Migrate from Perforce Helix to Git.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
[Perforce Helix](https://www.perforce.com/) provides a set of tools which also
include a centralized, proprietary version control system similar to Git.
## Perforce vs Git
The following list illustrates the main differences between Perforce Helix and
Git:
- In general, the biggest difference is that Perforce branching is heavyweight
compared to Git lightweight branching. When you create a branch in Perforce,
it creates an integration record in their proprietary database for every file
in the branch, regardless how many were actually changed. With Git, however,
a single SHA acts as a pointer to the state of the whole repository after the
changes, which can be helpful when adopting feature branching workflows.
- Context switching between branches is less complex in Git. If your manager
says, 'You need to stop work on that new feature and fix this security
vulnerability,' Git can help you do this.
- Having a complete copy of the project and its history on your local computer
means every transaction is very fast, and Git provides that. You can branch
or merge, and experiment in isolation, and then clean up before sharing your
changes with others.
- Git makes code review less complex, because you can share your changes without
merging them to the default branch. This is compared to Perforce, which had to
implement a Shelving feature on the server so others could review changes
before merging.
## Why migrate
Perforce Helix can be difficult to manage both from a user and an administrator
perspective. Migrating to Git/GitLab there is:
- **No licensing costs**: Git is GPL while Perforce Helix is proprietary.
- **Shorter learning curve**: Git has a big community and a vast number of
tutorials to get you started.
- **Integration with modern tools**: By migrating to Git and GitLab, you can have
an open source end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
## How to migrate
Git includes a built-in mechanism (`git p4`) to pull code from Perforce and to
submit back from Git to Perforce.
Here's a few links to get you started:
- [`git-p4` manual page](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-p4.html)
- [`git-p4` example usage](https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/Git-p4_Usage.html)
- [Git book migration guide](https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git#_perforce_import)
`git p4` and `git filter-branch` are not very good at
creating small and efficient Git packfiles. So it might be a good
idea to spend time and CPU to properly repack your repository before
sending it for the first time to your GitLab server. See
[this StackOverflow question](https://stackoverflow.com/questions/28720151/git-gc-aggressive-vs-git-repack/).
## Related topics
- [Mirror with Perforce Helix with Git Fusion](../repository/mirror/bidirectional.md#mirror-with-perforce-helix-with-git-fusion)
|
https://docs.gitlab.com/user/project/github
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/github.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
github.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import your project from GitHub to GitLab
|
Import projects from GitHub to GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- **Imported** badge [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461208) in GitLab 17.2.
{{< /history >}}
You can import your GitHub projects from either GitHub.com or GitHub Enterprise. Importing projects does not
migrate or import any types of groups or organizations from GitHub to GitLab.
Imported issues, merge requests, comments, and events have an **Imported** badge in GitLab.
The namespace is a user or group in GitLab, such as `gitlab.com/sidney-jones` or
`gitlab.com/customer-success`.
Using the GitLab UI, the GitHub importer always imports from the
`github.com` domain. If you are importing from a self-hosted GitHub Enterprise Server domain, use the
[GitLab Import API](#use-the-api) GitHub endpoint with a GitLab access token with the `api` scope.
You can change the target namespace and target repository name before you import.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview of the import process, see [How to migrate from GitHub to GitLab including Actions](https://www.youtube.com/watch?v=0Id5oMl1Kqs).
## Estimating import duration
Every import from GitHub is different, which affects the duration of imports you perform. However, in our testing we
imported `https://github.com/kubernetes/kubernetes` in 76 hours. When we tested, that project comprised:
- 80,000 pull requests.
- 45,000 issues.
- Approximately 1.5 million comments.
## Prerequisites
To import projects from GitHub, you must enable the
[GitHub import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources).
If that import source is not enabled, ask your GitLab administrator to enable it. The GitHub import source is enabled
by default on GitLab.com.
### Permissions and roles
To use the GitHub importer, you must have:
- Access to the source GitHub project
- At least the Maintainer role for the destination GitLab group (introduced in GitLab 16.0)
Also, the organization the GitHub repository belongs to must not impose restrictions of a
[third-party application access policy](https://docs.github.com/en/organizations/managing-oauth-access-to-your-organizations-data/about-oauth-app-access-restrictions)
on the GitLab instance you import to.
### Accounts for user contribution mapping
{{< history >}}
- [Preparation requirement removed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) in GitLab 17.8.
{{< /history >}}
Before using [the old method of user contribution mapping](#old-method-of-user-contribution-mapping) for imports to GitLab Self-Managed and GitLab
Dedicated, you must meet certain requirements. Imports to GitLab.com use an [improved method](_index.md#user-contribution-and-membership-mapping)
that doesn't require preparation.
These requirements are:
- Each GitHub author and assignee in the repository must have a
[public-facing email address](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address).
- The GitHub user's email address must match their GitLab email address.
- If a user's email address in GitHub is set as their secondary email address in GitLab, they must confirm it.
GitHub Enterprise does not require a public email address, so you might have to add it to existing accounts.
## Known issues
- GitHub pull request comments (known as diff notes in GitLab) created before 2017 are imported in separate threads.
This occurs because of a limitation of the GitHub API that doesn't include `in_reply_to_id` for comments before 2017.
- Because of a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/424400), Markdown attachments from
repositories on GitHub Enterprise Server instances aren't imported.
- Because of a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/418800), when importing projects that used
[GitHub auto-merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request), the imported project in GitLab can have merge commits labeled `unverified` if the commit was signed with the GitHub internal GPG key.
- GitLab [can't import](https://gitlab.com/gitlab-org/gitlab/-/issues/424046) GitHub Markdown image attachments that
were uploaded to private repositories before 2023-05-09. If you encounter this problem, would like to help us resolve the problem, and are willing to provide a sample repository
for us, add a comment to [issue 424046](https://gitlab.com/gitlab-org/gitlab/-/issues/424046) and we'll contact you.
- For [GitLab-specific references](../../markdown.md#gitlab-specific-references), GitLab uses the `#` character for issues and a `!` character for merge requests.
However, GitHub uses only the `#` character for both issues and pull requests. When importing:
- Comment notes, GitLab only creates links to issues because GitLab can't determine whether a references points to an
issue or a merge request.
- Issues or merge request descriptions, GitLab doesn't create links for any references because their imported
counterparts might not have been created on the destination yet.
## Import your GitHub repository into GitLab
You can import your GitHub repository by either:
- [Using GitHub OAuth](#use-github-oauth)
- [Using a GitHub personal access token](#use-a-github-personal-access-token)
- [Using the API](#use-the-api)
If importing from `github.com` you can use any method to import. Self-hosted GitHub Enterprise Server customers must use the API.
### Use GitHub OAuth
If you are importing to GitLab.com or to a GitLab Self-Managed that has GitHub OAuth [configured](../../../integration/github.md), you can use GitHub OAuth to import your repository.
This method has an advantage over using a [personal access token (PAT)](#use-a-github-personal-access-token)
because the backend exchanges the access token with the appropriate permissions.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project** and then **GitHub**.
1. Select **Authorize with GitHub**.
1. Proceed to [selecting which repositories to import](#select-which-repositories-to-import).
To use a different method to perform an import after previously performing
these steps, sign out of your GitLab account and sign in again.
### Use a GitHub personal access token
To import your GitHub repository using a GitHub personal access token:
1. Generate a GitHub personal access token. Only **classic** personal access tokens are supported.
1. Go to <https://github.com/settings/tokens/new>.
1. In the **Note** field, enter a token description.
1. Select the `repo` scope.
1. Optional. To [import collaborators](#select-additional-items-to-import), or if your project has [Git LFS files](../../../topics/git/lfs/_index.md), select the `read:org` scope.
1. Select **Generate token**.
1. On the GitLab left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project** and then **GitHub**.
1. Select **Authorize with GitHub**.
1. In the **Personal access token** field, paste the GitHub personal access token.
1. Select **Authenticate**.
1. Proceed to [selecting which repositories to import](#select-which-repositories-to-import).
To use a different token to perform an import after previously performing
these steps, sign out of your GitLab account and sign in again, or revoke the
older token in GitHub.
### Use the API
The [GitLab REST API](../../../api/import.md#import-repository-from-github) can be used to import a GitHub repository. It has some advantages over using the GitLab UI:
- Can be used to import GitHub repositories that you do not own if they are public.
- It can be used to import from a GitHub Enterprise Server that is self-hosted.
- Can be used to set the `timeout_strategy` option that is not available to the UI.
The REST API is limited to authenticating with GitLab personal access tokens.
To import your GitHub repository using the GitLab REST API:
1. Generate a GitHub personal access token. Only **classic** personal access tokens are supported.
1. Go to <https://github.com/settings/tokens/new>.
1. In the **Note** field, enter a token description.
1. Select the `repo` scope.
1. Optional. To [import collaborators](#select-additional-items-to-import), or if your project has [Git LFS files](../../../topics/git/lfs/_index.md), select the `read:org` scope.
1. Select **Generate token**.
1. Use the [GitLab REST API](../../../api/import.md#import-repository-from-github) to import your GitHub repository.
### Filter repositories list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385113) in GitLab 16.0.
{{< /history >}}
After you authorize access to your GitHub repositories, GitLab redirects you to the importer page and
your GitHub repositories are listed.
Use one of the following tabs to filter the list of repositories:
- **Owner** (default): Filter the list to the repositories that you are the owner of.
- **Collaborated**: Filter the list to the repositories that you have contributed to.
- **Organization**: Filter the list to the repositories that belong to an organization you are a member of.
When the **Organization** tab is selected, you can further narrow down your search by selecting an available GitHub organization from a dropdown list.
### Select additional items to import
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139410) in GitLab 16.8 [with a flag](../../../administration/feature_flags/_index.md) named `github_import_extended_events`. Disabled by default.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/435089) in GitLab 16.9.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146695) in GitLab 16.11. Feature flag `github_import_extended_events` removed.
{{< /history >}}
To make imports as fast as possible, the following items aren't imported from GitHub by default:
- More than approximately 30,000 comments because of a [limitation of the GitHub API](troubleshooting_github_import.md#missing-comments).
- Markdown attachments from repository comments, release posts, issue descriptions, and pull request descriptions. These can include
images, text, or binary attachments. If not imported, links in Markdown to attachments break after you remove the attachments from GitHub.
You can choose to import these items, but this could significantly increase import time. To import these items, select the appropriate fields in the UI:
- **Use alternative comments import method**. If importing GitHub projects with more than approximately 30,000 comments across all issues and pull requests, you should enable this method because of a
[limitation of the GitHub API](troubleshooting_github_import.md#missing-comments).
- **Import Markdown attachments**.
- **Import collaborators** (selected by default). Leaving it selected might result in new users using a seat in the group or namespace,
and being granted permissions [as high as project owner](#collaborators-members). Only direct collaborators are imported.
Outside collaborators are never imported.
### Select which repositories to import
By default, the proposed repository namespaces match the names as they exist in GitHub, but based
on your permissions, you can choose to edit these names before you proceed to import any of them.
To select which repositories to import, next to any number of repositories select **Import** or
select **Import all repositories**.
Additionally, you can filter projects by name. If a filter is applied, **Import all repositories**
only imports matched repositories.
The **Status** column shows the import status of each repository. You can choose to keep the page
open and watch updates in real time or you can return to it later.
To cancel imports that are pending or in progress, next to the imported project, select **Cancel**.
If the import has already started, the imported files are kept.
To open a repository in GitLab URL after it has been imported, select its GitLab path.
Completed imports can be re-imported by selecting **Re-import** and specifying new name. This creates a new copy of the source project.

### Check status of imports
{{< history >}}
- Details of partially completed imports with a list of entities that failed to import [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/386748) in GitLab 16.1.
{{< /history >}}
After imports are completed, they can be in one of three states:
- **Complete**: GitLab imported all repository entities.
- **Partially completed**: GitLab failed to import some repository entities.
- **Failed**: GitLab aborted the import after a critical error occurred.
Expand **Details** to see a list of [repository entities](#imported-data) that failed to import.
## Username mentions
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/477553) in GitLab 17.5.
{{< /history >}}
GitLab adds backticks to username mentions in issues, merge requests, and notes.
These backticks prevent linking to an incorrect user with the same username on the GitLab instance.
## User contribution and membership mapping
{{< history >}}
- [Changed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) to [**user contribution and membership mapping**](_index.md#user-contribution-and-membership-mapping) in GitLab 17.8.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176675) in GitLab 17.8.
{{< /history >}}
The GitHub importer uses an [improved method](_index.md#user-contribution-and-membership-mapping)
of mapping user contributions for GitLab.com, GitLab Self-Managed, and GitLab Dedicated.
### Old method of user contribution mapping
You can use the old user contribution mapping method for imports to GitLab Self-Managed and GitLab Dedicated instances.
To use this method, `github_user_mapping` must be disabled.
For imports to GitLab.com, you must
use the [improved method](_index.md#user-contribution-and-membership-mapping) instead.
Using the old method, when [user accounts are provisioned correctly](#accounts-for-user-contribution-mapping), users are mapped during the import.
If the requirements are not met, the importer can't map the particular user's contributions. In that case:
- The project creator is set as the author and assignee of issues and merge requests. The project creator is usually the
user that initiated the import process. For some contributions that have a description or note such as pull requests,
issue, notes, the importer amends the text with details of who originally created the contribution.
- Reviewers and approvals added on pull requests in GitHub cannot be imported. In this case, the importer creates comments
describing that non-existent users were added as reviewers and approvers. However, the actual reviewer status and
approval are not applied to the merge request in GitLab.
## Mirror a repository and share pipeline status
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
Depending on your GitLab tier, [repository mirroring](../repository/mirror/_index.md) can be set up to keep
your imported repository in sync with its GitHub copy.
Additionally, you can configure GitLab to send pipeline status updates back to GitHub with the
[GitHub Project Integration](../integrations/github.md).
If you import your project using [CI/CD for external repository](../../../ci/ci_cd_for_external_repos/_index.md), then both
features are automatically configured.
{{< alert type="note" >}}
Mirroring does not sync any new or updated pull requests from your GitHub project.
{{< /alert >}}
## Improve the speed of imports on GitLab Self-Managed instances
Administrator access on the GitLab server is required for these steps.
### Increase the number of Sidekiq workers
For large projects it may take a while to import all data. To reduce the time necessary, you can increase the number of
Sidekiq workers that process the following queues:
- `github_importer`
- `github_importer_advance_stage`
For an optimal experience, it's recommended having at least 4 Sidekiq processes (each running a number of threads equal
to the number of CPU cores) that only process these queues. It's also recommended that these processes run on separate
servers. For 4 servers with 8 cores this means you can import up to 32 objects (for example, issues) in parallel.
Reducing the time spent in cloning a repository can be done by increasing network throughput, CPU capacity, and disk
performance (by using high performance SSDs, for example) of the disks that store the Git repositories (for your GitLab instance).
Increasing the number of Sidekiq workers does not reduce the time spent cloning repositories.
### Enable GitHub OAuth using a GitHub Enterprise Cloud OAuth App
If you belong to a [GitHub Enterprise Cloud organization](https://docs.github.com/en/enterprise-cloud@latest/get-started/onboarding) you can configure GitLab Self-Managed to obtain a higher [GitHub API rate limit](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-authenticated-users).
GitHub API requests are usually subject to a rate limit of 5,000 requests per hour. Using the steps below, you obtain a higher 15,000 requests per hour rate limit, resulting in a faster overall import time.
Prerequisites:
- You have access to a
[GitHub Enterprise Cloud organization](https://docs.github.com/en/enterprise-cloud@latest/get-started/onboarding/getting-started-with-github-enterprise-cloud).
- GitLab is configured to enable [GitHub OAuth](../../../integration/github.md#enable-github-oauth-in-gitlab).
To enable a higher rate limit:
- [Create an OAuth app in GitHub](../../../integration/github.md#create-an-oauth-app-in-github). Ensure that the OAuth app is owned by the Enterprise Cloud Organization, not your personal GitHub account.
- Perform the project import using [GitHub OAuth](#use-github-oauth).
- Optional. By default, sign-in is enabled for all configured OAuth providers.
If you want to enable GitHub OAuth for imports but you want to
prevent the ability for users to sign in to your GitLab instance with GitHub,
you can
[disable sign-in with GitHub](../../../integration/omniauth.md#enable-or-disable-sign-in-with-an-omniauth-provider-without-disabling-import-sources).
## Imported data
The following items of a project are imported:
- All fork branches of the project related to open pull requests
{{< alert type="note" >}}
Fork branches are imported with a naming scheme similar to `GH-SHA-username/pull-request-number/fork-name/branch`.
{{< /alert >}}
- All project branches
- Attachments for:
- Comments
- Issue descriptions
- Pull request descriptions
- Release notes
- Branch protection rules
- [Collaborators (members)](#collaborators-members)
- [Git LFS objects](../../../topics/git/lfs/_index.md)
- Git repository data
- Issue and pull request comments
- Issue and pull request events (can be imported as an [additional item](#select-additional-items-to-import))
- Issues
- Labels
- Milestones
- Pull request assigned reviewers
- Pull request **merged by** information
- Pull request reviews
- Pull request review comments
- Pull request review replies to discussions
- Pull request review suggestions
- Pull requests
- Release notes content
- Repository descriptions
- Wiki pages
References to pull requests and issues are preserved. Each imported repository maintains visibility level unless that
[visibility level is restricted](../../public_access.md#restrict-use-of-public-or-internal-projects), in which case it
defaults to the default project visibility.
### Branch protection rules and project settings
Imported GitHub branch protection rules are mapped to one of the following:
- GitLab branch protection rules
- Project-wide GitLab settings
| GitHub rule | GitLab rule |
|:----------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Require conversation resolution before merging** for the project's default branch | **All threads must be resolved** [project setting](../merge_requests/_index.md#prevent-merge-unless-all-threads-are-resolved) |
| **Require a pull request before merging** | **No one** option in the **Allowed to push and merge** [branch protection settings](../repository/branches/protected.md#protect-a-branch) |
| **Require signed commits** for the project's default branch | **Reject unsigned commits** GitLab [push rule](../repository/push_rules.md#require-signed-commits) |
| **Allow force pushes - Everyone** | **Allowed to force push** [branch protection setting](../repository/branches/protected.md#allow-force-push) |
| **Require a pull request before merging - Require review from Code Owners** | **Require approval from code owners** [branch protection setting](../repository/branches/protected.md#require-code-owner-approval) |
| **Require a pull request before merging - Allow specified actors to bypass required pull requests** | List of users in the **Allowed to push and merge** [branch protection settings](../repository/branches/protected.md#protect-a-branch). Without a **Premium** subscription, the list of users that are allowed to push and merge is limited to roles. |
The **Require status checks to pass before merging** GitHub rule is not imported.
You can still create [external status checks](../merge_requests/status_checks.md) manually.
For more information, see [issue 370948](https://gitlab.com/gitlab-org/gitlab/-/issues/370948).
### Collaborators (members)
{{< history >}}
- Importing collaborators as an additional item [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398154) in GitLab 16.0.
{{< /history >}}
These GitHub collaborator roles are mapped to these GitLab [member roles](../../permissions.md#roles):
| GitHub role | Mapped GitLab role |
|:------------|:-------------------|
| Read | Guest |
| Triage | Reporter |
| Write | Developer |
| Maintain | Maintainer |
| Admin | Owner |
GitHub Enterprise Cloud has
[custom repository roles](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/about-custom-repository-roles).
These roles aren't supported and cause partially completed imports.
To import GitHub collaborators, you must have at least the Write role on the GitHub project. Otherwise collaborators import is skipped.
## Import from GitHub Enterprise on an internal network
If your GitHub Enterprise instance is on a internal network that is inaccessible to the internet, you can use a reverse proxy
to allow GitLab.com to access the instance.
The proxy needs to:
- Forward requests to the GitHub Enterprise instance.
- Convert to the public proxy hostname all occurrences of the internal hostname in:
- The API response body.
- The API response `Link` header.
GitHub API uses the `Link` header for pagination.
After configuring the proxy, test it by making API requests. Below there are some examples of commands to test the API:
```shell
curl --header "Authorization: Bearer <YOUR-TOKEN>" "https://{PROXY_HOSTNAME}/user"
### URLs in the response body should use the proxy hostname
{
"login": "example_username",
"id": 1,
"url": "https://{PROXY_HOSTNAME}/users/example_username",
"html_url": "https://{PROXY_HOSTNAME}/example_username",
"followers_url": "https://{PROXY_HOSTNAME}/api/v3/users/example_username/followers",
...
"created_at": "2014-02-11T17:03:25Z",
"updated_at": "2022-10-18T14:36:27Z"
}
```
```shell
curl --head --header "Authorization: Bearer <YOUR-TOKEN>" "https://{PROXY_DOMAIN}/api/v3/repos/{repository_path}/pulls?states=all&sort=created&direction=asc"
### Link header should use the proxy hostname
HTTP/1.1 200 OK
Date: Tue, 18 Oct 2022 21:42:55 GMT
Server: GitHub.com
Content-Type: application/json; charset=utf-8
Cache-Control: private, max-age=60, s-maxage=60
...
X-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes:
github-authentication-token-expiration: 2022-11-22 18:13:46 UTC
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4997
X-RateLimit-Reset: 1666132381
X-RateLimit-Used: 3
X-RateLimit-Resource: core
Link: <https://{PROXY_DOMAIN}/api/v3/repositories/1/pulls?page=2>; rel="next", <https://{PROXY_DOMAIN}/api/v3/repositories/1/pulls?page=11>; rel="last"
```
Also test that cloning the repository using the proxy does not fail:
```shell
git clone -c http.extraHeader="Authorization: basic <base64 encode YOUR-TOKEN>" --mirror https://{PROXY_DOMAIN}/{REPOSITORY_PATH}.git
```
### Sample reverse proxy configuration
The following configuration is an example on how to configure Apache HTTP Server as a reverse proxy
{{< alert type="warning" >}}
For simplicity, the snippet does not have configuration to encrypt the connection between the client and the proxy. However, for security reasons you should include that
configuration. See [sample Apache TLS/SSL configuration](https://ssl-config.mozilla.org/#server=apache&version=2.4.41&config=intermediate&openssl=1.1.1k&guideline=5.6).
{{< /alert >}}
```plaintext
# Required modules
LoadModule filter_module lib/httpd/modules/mod_filter.so
LoadModule reflector_module lib/httpd/modules/mod_reflector.so
LoadModule substitute_module lib/httpd/modules/mod_substitute.so
LoadModule deflate_module lib/httpd/modules/mod_deflate.so
LoadModule headers_module lib/httpd/modules/mod_headers.so
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_connect_module lib/httpd/modules/mod_proxy_connect.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
<VirtualHost GITHUB_ENTERPRISE_HOSTNAME:80>
ServerName GITHUB_ENTERPRISE_HOSTNAME
# Enables reverse-proxy configuration with SSL support
SSLProxyEngine On
ProxyPass "/" "https://GITHUB_ENTERPRISE_HOSTNAME/"
ProxyPassReverse "/" "https://GITHUB_ENTERPRISE_HOSTNAME/"
# Replaces occurrences of the local GitHub Enterprise URL with the Proxy URL
# GitHub Enterprise compresses the responses, the filters INFLATE and DEFLATE needs to be used to
# decompress and compress the response back
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE application/json
Substitute "s|https://GITHUB_ENTERPRISE_HOSTNAME|https://PROXY_HOSTNAME|ni"
SubstituteMaxLineLength 50M
# GitHub API uses the response header "Link" for the API pagination
# For example:
# <https://example.com/api/v3/repositories/1/issues?page=2>; rel="next", <https://example.com/api/v3/repositories/1/issues?page=3>; rel="last"
# The directive below replaces all occurrences of the GitHub Enterprise URL with the Proxy URL if the
# response header Link is present
Header edit* Link "https://GITHUB_ENTERPRISE_HOSTNAME" "https://PROXY_HOSTNAME"
</VirtualHost>
```
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import your project from GitHub to GitLab
description: Import projects from GitHub to GitLab.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- **Imported** badge [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461208) in GitLab 17.2.
{{< /history >}}
You can import your GitHub projects from either GitHub.com or GitHub Enterprise. Importing projects does not
migrate or import any types of groups or organizations from GitHub to GitLab.
Imported issues, merge requests, comments, and events have an **Imported** badge in GitLab.
The namespace is a user or group in GitLab, such as `gitlab.com/sidney-jones` or
`gitlab.com/customer-success`.
Using the GitLab UI, the GitHub importer always imports from the
`github.com` domain. If you are importing from a self-hosted GitHub Enterprise Server domain, use the
[GitLab Import API](#use-the-api) GitHub endpoint with a GitLab access token with the `api` scope.
You can change the target namespace and target repository name before you import.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview of the import process, see [How to migrate from GitHub to GitLab including Actions](https://www.youtube.com/watch?v=0Id5oMl1Kqs).
## Estimating import duration
Every import from GitHub is different, which affects the duration of imports you perform. However, in our testing we
imported `https://github.com/kubernetes/kubernetes` in 76 hours. When we tested, that project comprised:
- 80,000 pull requests.
- 45,000 issues.
- Approximately 1.5 million comments.
## Prerequisites
To import projects from GitHub, you must enable the
[GitHub import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources).
If that import source is not enabled, ask your GitLab administrator to enable it. The GitHub import source is enabled
by default on GitLab.com.
### Permissions and roles
To use the GitHub importer, you must have:
- Access to the source GitHub project
- At least the Maintainer role for the destination GitLab group (introduced in GitLab 16.0)
Also, the organization the GitHub repository belongs to must not impose restrictions of a
[third-party application access policy](https://docs.github.com/en/organizations/managing-oauth-access-to-your-organizations-data/about-oauth-app-access-restrictions)
on the GitLab instance you import to.
### Accounts for user contribution mapping
{{< history >}}
- [Preparation requirement removed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) in GitLab 17.8.
{{< /history >}}
Before using [the old method of user contribution mapping](#old-method-of-user-contribution-mapping) for imports to GitLab Self-Managed and GitLab
Dedicated, you must meet certain requirements. Imports to GitLab.com use an [improved method](_index.md#user-contribution-and-membership-mapping)
that doesn't require preparation.
These requirements are:
- Each GitHub author and assignee in the repository must have a
[public-facing email address](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address).
- The GitHub user's email address must match their GitLab email address.
- If a user's email address in GitHub is set as their secondary email address in GitLab, they must confirm it.
GitHub Enterprise does not require a public email address, so you might have to add it to existing accounts.
## Known issues
- GitHub pull request comments (known as diff notes in GitLab) created before 2017 are imported in separate threads.
This occurs because of a limitation of the GitHub API that doesn't include `in_reply_to_id` for comments before 2017.
- Because of a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/424400), Markdown attachments from
repositories on GitHub Enterprise Server instances aren't imported.
- Because of a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/418800), when importing projects that used
[GitHub auto-merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request), the imported project in GitLab can have merge commits labeled `unverified` if the commit was signed with the GitHub internal GPG key.
- GitLab [can't import](https://gitlab.com/gitlab-org/gitlab/-/issues/424046) GitHub Markdown image attachments that
were uploaded to private repositories before 2023-05-09. If you encounter this problem, would like to help us resolve the problem, and are willing to provide a sample repository
for us, add a comment to [issue 424046](https://gitlab.com/gitlab-org/gitlab/-/issues/424046) and we'll contact you.
- For [GitLab-specific references](../../markdown.md#gitlab-specific-references), GitLab uses the `#` character for issues and a `!` character for merge requests.
However, GitHub uses only the `#` character for both issues and pull requests. When importing:
- Comment notes, GitLab only creates links to issues because GitLab can't determine whether a references points to an
issue or a merge request.
- Issues or merge request descriptions, GitLab doesn't create links for any references because their imported
counterparts might not have been created on the destination yet.
## Import your GitHub repository into GitLab
You can import your GitHub repository by either:
- [Using GitHub OAuth](#use-github-oauth)
- [Using a GitHub personal access token](#use-a-github-personal-access-token)
- [Using the API](#use-the-api)
If importing from `github.com` you can use any method to import. Self-hosted GitHub Enterprise Server customers must use the API.
### Use GitHub OAuth
If you are importing to GitLab.com or to a GitLab Self-Managed that has GitHub OAuth [configured](../../../integration/github.md), you can use GitHub OAuth to import your repository.
This method has an advantage over using a [personal access token (PAT)](#use-a-github-personal-access-token)
because the backend exchanges the access token with the appropriate permissions.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project** and then **GitHub**.
1. Select **Authorize with GitHub**.
1. Proceed to [selecting which repositories to import](#select-which-repositories-to-import).
To use a different method to perform an import after previously performing
these steps, sign out of your GitLab account and sign in again.
### Use a GitHub personal access token
To import your GitHub repository using a GitHub personal access token:
1. Generate a GitHub personal access token. Only **classic** personal access tokens are supported.
1. Go to <https://github.com/settings/tokens/new>.
1. In the **Note** field, enter a token description.
1. Select the `repo` scope.
1. Optional. To [import collaborators](#select-additional-items-to-import), or if your project has [Git LFS files](../../../topics/git/lfs/_index.md), select the `read:org` scope.
1. Select **Generate token**.
1. On the GitLab left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project** and then **GitHub**.
1. Select **Authorize with GitHub**.
1. In the **Personal access token** field, paste the GitHub personal access token.
1. Select **Authenticate**.
1. Proceed to [selecting which repositories to import](#select-which-repositories-to-import).
To use a different token to perform an import after previously performing
these steps, sign out of your GitLab account and sign in again, or revoke the
older token in GitHub.
### Use the API
The [GitLab REST API](../../../api/import.md#import-repository-from-github) can be used to import a GitHub repository. It has some advantages over using the GitLab UI:
- Can be used to import GitHub repositories that you do not own if they are public.
- It can be used to import from a GitHub Enterprise Server that is self-hosted.
- Can be used to set the `timeout_strategy` option that is not available to the UI.
The REST API is limited to authenticating with GitLab personal access tokens.
To import your GitHub repository using the GitLab REST API:
1. Generate a GitHub personal access token. Only **classic** personal access tokens are supported.
1. Go to <https://github.com/settings/tokens/new>.
1. In the **Note** field, enter a token description.
1. Select the `repo` scope.
1. Optional. To [import collaborators](#select-additional-items-to-import), or if your project has [Git LFS files](../../../topics/git/lfs/_index.md), select the `read:org` scope.
1. Select **Generate token**.
1. Use the [GitLab REST API](../../../api/import.md#import-repository-from-github) to import your GitHub repository.
### Filter repositories list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385113) in GitLab 16.0.
{{< /history >}}
After you authorize access to your GitHub repositories, GitLab redirects you to the importer page and
your GitHub repositories are listed.
Use one of the following tabs to filter the list of repositories:
- **Owner** (default): Filter the list to the repositories that you are the owner of.
- **Collaborated**: Filter the list to the repositories that you have contributed to.
- **Organization**: Filter the list to the repositories that belong to an organization you are a member of.
When the **Organization** tab is selected, you can further narrow down your search by selecting an available GitHub organization from a dropdown list.
### Select additional items to import
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139410) in GitLab 16.8 [with a flag](../../../administration/feature_flags/_index.md) named `github_import_extended_events`. Disabled by default.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/435089) in GitLab 16.9.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146695) in GitLab 16.11. Feature flag `github_import_extended_events` removed.
{{< /history >}}
To make imports as fast as possible, the following items aren't imported from GitHub by default:
- More than approximately 30,000 comments because of a [limitation of the GitHub API](troubleshooting_github_import.md#missing-comments).
- Markdown attachments from repository comments, release posts, issue descriptions, and pull request descriptions. These can include
images, text, or binary attachments. If not imported, links in Markdown to attachments break after you remove the attachments from GitHub.
You can choose to import these items, but this could significantly increase import time. To import these items, select the appropriate fields in the UI:
- **Use alternative comments import method**. If importing GitHub projects with more than approximately 30,000 comments across all issues and pull requests, you should enable this method because of a
[limitation of the GitHub API](troubleshooting_github_import.md#missing-comments).
- **Import Markdown attachments**.
- **Import collaborators** (selected by default). Leaving it selected might result in new users using a seat in the group or namespace,
and being granted permissions [as high as project owner](#collaborators-members). Only direct collaborators are imported.
Outside collaborators are never imported.
### Select which repositories to import
By default, the proposed repository namespaces match the names as they exist in GitHub, but based
on your permissions, you can choose to edit these names before you proceed to import any of them.
To select which repositories to import, next to any number of repositories select **Import** or
select **Import all repositories**.
Additionally, you can filter projects by name. If a filter is applied, **Import all repositories**
only imports matched repositories.
The **Status** column shows the import status of each repository. You can choose to keep the page
open and watch updates in real time or you can return to it later.
To cancel imports that are pending or in progress, next to the imported project, select **Cancel**.
If the import has already started, the imported files are kept.
To open a repository in GitLab URL after it has been imported, select its GitLab path.
Completed imports can be re-imported by selecting **Re-import** and specifying new name. This creates a new copy of the source project.

### Check status of imports
{{< history >}}
- Details of partially completed imports with a list of entities that failed to import [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/386748) in GitLab 16.1.
{{< /history >}}
After imports are completed, they can be in one of three states:
- **Complete**: GitLab imported all repository entities.
- **Partially completed**: GitLab failed to import some repository entities.
- **Failed**: GitLab aborted the import after a critical error occurred.
Expand **Details** to see a list of [repository entities](#imported-data) that failed to import.
## Username mentions
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/477553) in GitLab 17.5.
{{< /history >}}
GitLab adds backticks to username mentions in issues, merge requests, and notes.
These backticks prevent linking to an incorrect user with the same username on the GitLab instance.
## User contribution and membership mapping
{{< history >}}
- [Changed on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/14667) to [**user contribution and membership mapping**](_index.md#user-contribution-and-membership-mapping) in GitLab 17.8.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176675) in GitLab 17.8.
{{< /history >}}
The GitHub importer uses an [improved method](_index.md#user-contribution-and-membership-mapping)
of mapping user contributions for GitLab.com, GitLab Self-Managed, and GitLab Dedicated.
### Old method of user contribution mapping
You can use the old user contribution mapping method for imports to GitLab Self-Managed and GitLab Dedicated instances.
To use this method, `github_user_mapping` must be disabled.
For imports to GitLab.com, you must
use the [improved method](_index.md#user-contribution-and-membership-mapping) instead.
Using the old method, when [user accounts are provisioned correctly](#accounts-for-user-contribution-mapping), users are mapped during the import.
If the requirements are not met, the importer can't map the particular user's contributions. In that case:
- The project creator is set as the author and assignee of issues and merge requests. The project creator is usually the
user that initiated the import process. For some contributions that have a description or note such as pull requests,
issue, notes, the importer amends the text with details of who originally created the contribution.
- Reviewers and approvals added on pull requests in GitHub cannot be imported. In this case, the importer creates comments
describing that non-existent users were added as reviewers and approvers. However, the actual reviewer status and
approval are not applied to the merge request in GitLab.
## Mirror a repository and share pipeline status
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
Depending on your GitLab tier, [repository mirroring](../repository/mirror/_index.md) can be set up to keep
your imported repository in sync with its GitHub copy.
Additionally, you can configure GitLab to send pipeline status updates back to GitHub with the
[GitHub Project Integration](../integrations/github.md).
If you import your project using [CI/CD for external repository](../../../ci/ci_cd_for_external_repos/_index.md), then both
features are automatically configured.
{{< alert type="note" >}}
Mirroring does not sync any new or updated pull requests from your GitHub project.
{{< /alert >}}
## Improve the speed of imports on GitLab Self-Managed instances
Administrator access on the GitLab server is required for these steps.
### Increase the number of Sidekiq workers
For large projects it may take a while to import all data. To reduce the time necessary, you can increase the number of
Sidekiq workers that process the following queues:
- `github_importer`
- `github_importer_advance_stage`
For an optimal experience, it's recommended having at least 4 Sidekiq processes (each running a number of threads equal
to the number of CPU cores) that only process these queues. It's also recommended that these processes run on separate
servers. For 4 servers with 8 cores this means you can import up to 32 objects (for example, issues) in parallel.
Reducing the time spent in cloning a repository can be done by increasing network throughput, CPU capacity, and disk
performance (by using high performance SSDs, for example) of the disks that store the Git repositories (for your GitLab instance).
Increasing the number of Sidekiq workers does not reduce the time spent cloning repositories.
### Enable GitHub OAuth using a GitHub Enterprise Cloud OAuth App
If you belong to a [GitHub Enterprise Cloud organization](https://docs.github.com/en/enterprise-cloud@latest/get-started/onboarding) you can configure GitLab Self-Managed to obtain a higher [GitHub API rate limit](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-authenticated-users).
GitHub API requests are usually subject to a rate limit of 5,000 requests per hour. Using the steps below, you obtain a higher 15,000 requests per hour rate limit, resulting in a faster overall import time.
Prerequisites:
- You have access to a
[GitHub Enterprise Cloud organization](https://docs.github.com/en/enterprise-cloud@latest/get-started/onboarding/getting-started-with-github-enterprise-cloud).
- GitLab is configured to enable [GitHub OAuth](../../../integration/github.md#enable-github-oauth-in-gitlab).
To enable a higher rate limit:
- [Create an OAuth app in GitHub](../../../integration/github.md#create-an-oauth-app-in-github). Ensure that the OAuth app is owned by the Enterprise Cloud Organization, not your personal GitHub account.
- Perform the project import using [GitHub OAuth](#use-github-oauth).
- Optional. By default, sign-in is enabled for all configured OAuth providers.
If you want to enable GitHub OAuth for imports but you want to
prevent the ability for users to sign in to your GitLab instance with GitHub,
you can
[disable sign-in with GitHub](../../../integration/omniauth.md#enable-or-disable-sign-in-with-an-omniauth-provider-without-disabling-import-sources).
## Imported data
The following items of a project are imported:
- All fork branches of the project related to open pull requests
{{< alert type="note" >}}
Fork branches are imported with a naming scheme similar to `GH-SHA-username/pull-request-number/fork-name/branch`.
{{< /alert >}}
- All project branches
- Attachments for:
- Comments
- Issue descriptions
- Pull request descriptions
- Release notes
- Branch protection rules
- [Collaborators (members)](#collaborators-members)
- [Git LFS objects](../../../topics/git/lfs/_index.md)
- Git repository data
- Issue and pull request comments
- Issue and pull request events (can be imported as an [additional item](#select-additional-items-to-import))
- Issues
- Labels
- Milestones
- Pull request assigned reviewers
- Pull request **merged by** information
- Pull request reviews
- Pull request review comments
- Pull request review replies to discussions
- Pull request review suggestions
- Pull requests
- Release notes content
- Repository descriptions
- Wiki pages
References to pull requests and issues are preserved. Each imported repository maintains visibility level unless that
[visibility level is restricted](../../public_access.md#restrict-use-of-public-or-internal-projects), in which case it
defaults to the default project visibility.
### Branch protection rules and project settings
Imported GitHub branch protection rules are mapped to one of the following:
- GitLab branch protection rules
- Project-wide GitLab settings
| GitHub rule | GitLab rule |
|:----------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Require conversation resolution before merging** for the project's default branch | **All threads must be resolved** [project setting](../merge_requests/_index.md#prevent-merge-unless-all-threads-are-resolved) |
| **Require a pull request before merging** | **No one** option in the **Allowed to push and merge** [branch protection settings](../repository/branches/protected.md#protect-a-branch) |
| **Require signed commits** for the project's default branch | **Reject unsigned commits** GitLab [push rule](../repository/push_rules.md#require-signed-commits) |
| **Allow force pushes - Everyone** | **Allowed to force push** [branch protection setting](../repository/branches/protected.md#allow-force-push) |
| **Require a pull request before merging - Require review from Code Owners** | **Require approval from code owners** [branch protection setting](../repository/branches/protected.md#require-code-owner-approval) |
| **Require a pull request before merging - Allow specified actors to bypass required pull requests** | List of users in the **Allowed to push and merge** [branch protection settings](../repository/branches/protected.md#protect-a-branch). Without a **Premium** subscription, the list of users that are allowed to push and merge is limited to roles. |
The **Require status checks to pass before merging** GitHub rule is not imported.
You can still create [external status checks](../merge_requests/status_checks.md) manually.
For more information, see [issue 370948](https://gitlab.com/gitlab-org/gitlab/-/issues/370948).
### Collaborators (members)
{{< history >}}
- Importing collaborators as an additional item [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398154) in GitLab 16.0.
{{< /history >}}
These GitHub collaborator roles are mapped to these GitLab [member roles](../../permissions.md#roles):
| GitHub role | Mapped GitLab role |
|:------------|:-------------------|
| Read | Guest |
| Triage | Reporter |
| Write | Developer |
| Maintain | Maintainer |
| Admin | Owner |
GitHub Enterprise Cloud has
[custom repository roles](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/about-custom-repository-roles).
These roles aren't supported and cause partially completed imports.
To import GitHub collaborators, you must have at least the Write role on the GitHub project. Otherwise collaborators import is skipped.
## Import from GitHub Enterprise on an internal network
If your GitHub Enterprise instance is on a internal network that is inaccessible to the internet, you can use a reverse proxy
to allow GitLab.com to access the instance.
The proxy needs to:
- Forward requests to the GitHub Enterprise instance.
- Convert to the public proxy hostname all occurrences of the internal hostname in:
- The API response body.
- The API response `Link` header.
GitHub API uses the `Link` header for pagination.
After configuring the proxy, test it by making API requests. Below there are some examples of commands to test the API:
```shell
curl --header "Authorization: Bearer <YOUR-TOKEN>" "https://{PROXY_HOSTNAME}/user"
### URLs in the response body should use the proxy hostname
{
"login": "example_username",
"id": 1,
"url": "https://{PROXY_HOSTNAME}/users/example_username",
"html_url": "https://{PROXY_HOSTNAME}/example_username",
"followers_url": "https://{PROXY_HOSTNAME}/api/v3/users/example_username/followers",
...
"created_at": "2014-02-11T17:03:25Z",
"updated_at": "2022-10-18T14:36:27Z"
}
```
```shell
curl --head --header "Authorization: Bearer <YOUR-TOKEN>" "https://{PROXY_DOMAIN}/api/v3/repos/{repository_path}/pulls?states=all&sort=created&direction=asc"
### Link header should use the proxy hostname
HTTP/1.1 200 OK
Date: Tue, 18 Oct 2022 21:42:55 GMT
Server: GitHub.com
Content-Type: application/json; charset=utf-8
Cache-Control: private, max-age=60, s-maxage=60
...
X-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes:
github-authentication-token-expiration: 2022-11-22 18:13:46 UTC
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4997
X-RateLimit-Reset: 1666132381
X-RateLimit-Used: 3
X-RateLimit-Resource: core
Link: <https://{PROXY_DOMAIN}/api/v3/repositories/1/pulls?page=2>; rel="next", <https://{PROXY_DOMAIN}/api/v3/repositories/1/pulls?page=11>; rel="last"
```
Also test that cloning the repository using the proxy does not fail:
```shell
git clone -c http.extraHeader="Authorization: basic <base64 encode YOUR-TOKEN>" --mirror https://{PROXY_DOMAIN}/{REPOSITORY_PATH}.git
```
### Sample reverse proxy configuration
The following configuration is an example on how to configure Apache HTTP Server as a reverse proxy
{{< alert type="warning" >}}
For simplicity, the snippet does not have configuration to encrypt the connection between the client and the proxy. However, for security reasons you should include that
configuration. See [sample Apache TLS/SSL configuration](https://ssl-config.mozilla.org/#server=apache&version=2.4.41&config=intermediate&openssl=1.1.1k&guideline=5.6).
{{< /alert >}}
```plaintext
# Required modules
LoadModule filter_module lib/httpd/modules/mod_filter.so
LoadModule reflector_module lib/httpd/modules/mod_reflector.so
LoadModule substitute_module lib/httpd/modules/mod_substitute.so
LoadModule deflate_module lib/httpd/modules/mod_deflate.so
LoadModule headers_module lib/httpd/modules/mod_headers.so
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_connect_module lib/httpd/modules/mod_proxy_connect.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
<VirtualHost GITHUB_ENTERPRISE_HOSTNAME:80>
ServerName GITHUB_ENTERPRISE_HOSTNAME
# Enables reverse-proxy configuration with SSL support
SSLProxyEngine On
ProxyPass "/" "https://GITHUB_ENTERPRISE_HOSTNAME/"
ProxyPassReverse "/" "https://GITHUB_ENTERPRISE_HOSTNAME/"
# Replaces occurrences of the local GitHub Enterprise URL with the Proxy URL
# GitHub Enterprise compresses the responses, the filters INFLATE and DEFLATE needs to be used to
# decompress and compress the response back
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE application/json
Substitute "s|https://GITHUB_ENTERPRISE_HOSTNAME|https://PROXY_HOSTNAME|ni"
SubstituteMaxLineLength 50M
# GitHub API uses the response header "Link" for the API pagination
# For example:
# <https://example.com/api/v3/repositories/1/issues?page=2>; rel="next", <https://example.com/api/v3/repositories/1/issues?page=3>; rel="last"
# The directive below replaces all occurrences of the GitHub Enterprise URL with the Proxy URL if the
# response header Link is present
Header edit* Link "https://GITHUB_ENTERPRISE_HOSTNAME" "https://PROXY_HOSTNAME"
</VirtualHost>
```
|
https://docs.gitlab.com/user/project/jira_migration_options
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/jira_migration_options.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
jira_migration_options.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments.
|
Jira migration options
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You have several options to migrate your Jira projects to GitLab. Before you decide on a migration strategy,
first decide if you even need to move your Jira issues to GitLab. In many cases, the Jira issue data is no longer
relevant or actionable. By starting fresh in GitLab, you can focus on setting up your processes and workflows to
maximize the advantages of using GitLab.
If you opt to migrate your Jira issues, you can choose from several migration options:
- Use GitLab Jira importer.
- Import a CSV file.
- Let GitLab Professional Services handle the migration for you.
- Use a third-party service to build a one-way or two-way data synchronization process.
- Use a third-party script.
- Write your own script.
## Use GitLab Jira importer
GitLab has a built-in tool to import your Jira issue data. To use the GitLab Jira importer:
1. [Configure the GitLab Jira issues integration in your target project](../../../integration/jira/configure.md#configure-the-integration)
1. [Import your Jira project issues to GitLab](jira.md)
Alternatively, you can watch a complete demo of the process: <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Import Jira project issues to GitLab](https://www.youtube.com/watch?v=OTJdJWmODFA)
<!-- Video published on 2023-07-27 -->
## Import a CSV file
To import the Jira issue data from a CSV file into your GitLab project:
1. Export your Jira data:
1. Log in to your Jira instance and go to the project you want to migrate.
1. Export the project data as a CSV file.
1. Edit your CSV file to match the [column names required for the GitLab CSV importer](../issues/csv_import.md).
- Only `title`, `description`, `due_date`, and `milestone` are imported.
- You can [add quick actions to the description field](../quick_actions.md) to set other issue metadata automatically during the import process.
1. Create a new GitLab group and project:
1. Sign in to your GitLab account and [create a group](../../group/_index.md#create-a-group) to host your migrated projects.
1. In the new group, [create a new project](../_index.md#create-a-blank-project) to hold the migrated Jira issues.
1. Import the Jira data into GitLab:
1. In your new GitLab project, on the left sidebar, select **Plan > Issues**.
1. Select **Actions** ({{< icon name="ellipsis_v" >}}) **> Import from Jira**.
1. Follow the on-screen instructions to complete the import process.
1. Verify the migration:
1. Review the imported issues to ensure the project migrated to GitLab successfully.
1. Test the features of your migrated Jira project in GitLab.
1. Adjust your workflows and settings:
1. Customize your GitLab [project settings](../settings/_index.md), such as [description templates](../description_templates.md), [labels](../labels.md), and [milestones](../milestones/_index.md), to match your team's needs.
1. Familiarize your team with the GitLab interface and any new workflows or processes introduced by the migration.
1. Decommission your Jira instance:
1. When you're satisfied with the migration, you can decommission your Jira instance and fully transition to GitLab.
## Let GitLab Professional Services handle the migration for you
For a high-level overview of the Jira migration service, see the [Jira Migration Service](https://drive.google.com/file/d/1p0rv02OnjfSiNoeDT2u4MhviozS--Yan/view) data sheet.
To get a personalized quote, visit the [GitLab Professional Services](https://about.gitlab.com/services/) page and select **Request Service**.
## Establish a one-way or two-way data synchronization using a third-party service
To establish a one-way or two-way data synchronization between Jira and GitLab, you can use the following third-party services:
- **Unito.io**: [GitLab + Jira integration documentation](https://guide.unito.io/gitlab-jira-integration), [GitLab + Jira Two-Way Sync Marketplace Add-On](https://marketplace.atlassian.com/apps/1218054/gitlab-jira-two-way-sync?tab=overview&hosting=cloud)
- **Getint**: [GitLab Jira sync Marketplace Add-on](https://marketplace.atlassian.com/apps/1223999/gitlab-jira-sync-integration-by-getint?tab=overview&hosting=cloud)
## Use a third-party script
You can use one of the available open-source migration scripts to help you migrate your Jira issues to GitLab.
Many of our customers have had success using [`jira2gitlab`](https://github.com/swingbit/jira2gitlab).
View a complete demo of the process: <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Migrating from Jira to GitLab with Jira2GitLab](https://www.youtube.com/watch?v=aJfnTZrS4t4)
<!-- Video published on 2024-01-09 -->
## Use a first-party script
[GitLab Professional Services](https://about.gitlab.com/services/) has built their fork of the previously-mentioned `jira2gitlab` script, `Jira2Lab`:
- Blog post: [Seamlessly migrate from Jira to GitLab with Jira2Lab at scale](https://about.gitlab.com/blog/2024/10/10/seamlessly-migrate-from-jira-to-gitlab-with-jira2lab-at-scale/)
- [Repository](https://gitlab.com/gitlab-org/professional-services-automation/tools/migration/jira2lab)
As stated in the `Jira2Lab` README:
> We encourage users to compare both tools to best meet their migration needs.
## Write your own script
For full control over the migration process, you can write your own custom script that migrates
your Jira issues to GitLab in a way that suits your needs exactly. GitLab provides APIs to help
automate your migration:
- [REST API](../../../api/rest/_index.md)
- [GraphQL API](../../../api/graphql/_index.md)
To get started, familiarize yourself with the following GitLab API endpoints:
- [Issues](../../../api/issues.md)
- [Projects](../../../api/projects.md)
- [Labels](../../../api/labels.md)
- [Milestones](../../../api/milestones.md)
When writing your script, you need to map the Jira issue fields to their corresponding GitLab equivalents. Here are some tips:
- **Custom fields with a fixed number of options**: Create a [scoped label](../labels.md#scoped-labels) set with the field name as the scoped label key and the field values as the scoped label set values (for example, `input name::value1`, `input name::value2`).
- **Custom fields with text strings or integer values**: Inject the custom field name and value into a section in the issue's description.
- **Status**: Create a [scoped label](../labels.md#scoped-labels) with the status set as the scoped label key and the status values as the scoped label set values (for example, `status::in progress`).
- **Priority**: Create a [scoped label](../labels.md#scoped-labels) with the priority set as the scoped label key and the priority values as the scoped label set values (for example, `priority::1`).
- **Story Point**: Map this value to the GitLab issue's **weight** value.
- **Sprint**: Map this value to the GitLab issue's **iteration** value. This value is meaningful
only for issues that have not been completed or are scheduled for a future sprint. Before importing
the data, create the required [iterations](../../group/iterations/_index.md#iteration-cadences) in the
parent group of your project.
You might also need to handle parsing the Atlassian Document Format and mapping it to GitLab Flavored Markdown.
You can approach this in many different ways. For inspiration,
[review an example commit](https://gitlab.com/gitlab-org/gitlab/-/commit/4292a286d3f4ab26466f8e89125a4dbd194a9f3e).
This commit added a method to parse the Atlassian Document Format to GitLab Flavored Markdown for the GitLab Jira importer.
If you run GitLab locally, you can also convert Atlassian Document Format to GitLab Flavored Markdown
manually in the Rails console. To do so, execute:
```ruby
text = <document in Atlassian Document Format>
project = <project that wiki is in> or nil
Banzai.render(text, pipeline: :adf_commonmark, project: project)
```
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments.
title: Jira migration options
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You have several options to migrate your Jira projects to GitLab. Before you decide on a migration strategy,
first decide if you even need to move your Jira issues to GitLab. In many cases, the Jira issue data is no longer
relevant or actionable. By starting fresh in GitLab, you can focus on setting up your processes and workflows to
maximize the advantages of using GitLab.
If you opt to migrate your Jira issues, you can choose from several migration options:
- Use GitLab Jira importer.
- Import a CSV file.
- Let GitLab Professional Services handle the migration for you.
- Use a third-party service to build a one-way or two-way data synchronization process.
- Use a third-party script.
- Write your own script.
## Use GitLab Jira importer
GitLab has a built-in tool to import your Jira issue data. To use the GitLab Jira importer:
1. [Configure the GitLab Jira issues integration in your target project](../../../integration/jira/configure.md#configure-the-integration)
1. [Import your Jira project issues to GitLab](jira.md)
Alternatively, you can watch a complete demo of the process: <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Import Jira project issues to GitLab](https://www.youtube.com/watch?v=OTJdJWmODFA)
<!-- Video published on 2023-07-27 -->
## Import a CSV file
To import the Jira issue data from a CSV file into your GitLab project:
1. Export your Jira data:
1. Log in to your Jira instance and go to the project you want to migrate.
1. Export the project data as a CSV file.
1. Edit your CSV file to match the [column names required for the GitLab CSV importer](../issues/csv_import.md).
- Only `title`, `description`, `due_date`, and `milestone` are imported.
- You can [add quick actions to the description field](../quick_actions.md) to set other issue metadata automatically during the import process.
1. Create a new GitLab group and project:
1. Sign in to your GitLab account and [create a group](../../group/_index.md#create-a-group) to host your migrated projects.
1. In the new group, [create a new project](../_index.md#create-a-blank-project) to hold the migrated Jira issues.
1. Import the Jira data into GitLab:
1. In your new GitLab project, on the left sidebar, select **Plan > Issues**.
1. Select **Actions** ({{< icon name="ellipsis_v" >}}) **> Import from Jira**.
1. Follow the on-screen instructions to complete the import process.
1. Verify the migration:
1. Review the imported issues to ensure the project migrated to GitLab successfully.
1. Test the features of your migrated Jira project in GitLab.
1. Adjust your workflows and settings:
1. Customize your GitLab [project settings](../settings/_index.md), such as [description templates](../description_templates.md), [labels](../labels.md), and [milestones](../milestones/_index.md), to match your team's needs.
1. Familiarize your team with the GitLab interface and any new workflows or processes introduced by the migration.
1. Decommission your Jira instance:
1. When you're satisfied with the migration, you can decommission your Jira instance and fully transition to GitLab.
## Let GitLab Professional Services handle the migration for you
For a high-level overview of the Jira migration service, see the [Jira Migration Service](https://drive.google.com/file/d/1p0rv02OnjfSiNoeDT2u4MhviozS--Yan/view) data sheet.
To get a personalized quote, visit the [GitLab Professional Services](https://about.gitlab.com/services/) page and select **Request Service**.
## Establish a one-way or two-way data synchronization using a third-party service
To establish a one-way or two-way data synchronization between Jira and GitLab, you can use the following third-party services:
- **Unito.io**: [GitLab + Jira integration documentation](https://guide.unito.io/gitlab-jira-integration), [GitLab + Jira Two-Way Sync Marketplace Add-On](https://marketplace.atlassian.com/apps/1218054/gitlab-jira-two-way-sync?tab=overview&hosting=cloud)
- **Getint**: [GitLab Jira sync Marketplace Add-on](https://marketplace.atlassian.com/apps/1223999/gitlab-jira-sync-integration-by-getint?tab=overview&hosting=cloud)
## Use a third-party script
You can use one of the available open-source migration scripts to help you migrate your Jira issues to GitLab.
Many of our customers have had success using [`jira2gitlab`](https://github.com/swingbit/jira2gitlab).
View a complete demo of the process: <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Migrating from Jira to GitLab with Jira2GitLab](https://www.youtube.com/watch?v=aJfnTZrS4t4)
<!-- Video published on 2024-01-09 -->
## Use a first-party script
[GitLab Professional Services](https://about.gitlab.com/services/) has built their fork of the previously-mentioned `jira2gitlab` script, `Jira2Lab`:
- Blog post: [Seamlessly migrate from Jira to GitLab with Jira2Lab at scale](https://about.gitlab.com/blog/2024/10/10/seamlessly-migrate-from-jira-to-gitlab-with-jira2lab-at-scale/)
- [Repository](https://gitlab.com/gitlab-org/professional-services-automation/tools/migration/jira2lab)
As stated in the `Jira2Lab` README:
> We encourage users to compare both tools to best meet their migration needs.
## Write your own script
For full control over the migration process, you can write your own custom script that migrates
your Jira issues to GitLab in a way that suits your needs exactly. GitLab provides APIs to help
automate your migration:
- [REST API](../../../api/rest/_index.md)
- [GraphQL API](../../../api/graphql/_index.md)
To get started, familiarize yourself with the following GitLab API endpoints:
- [Issues](../../../api/issues.md)
- [Projects](../../../api/projects.md)
- [Labels](../../../api/labels.md)
- [Milestones](../../../api/milestones.md)
When writing your script, you need to map the Jira issue fields to their corresponding GitLab equivalents. Here are some tips:
- **Custom fields with a fixed number of options**: Create a [scoped label](../labels.md#scoped-labels) set with the field name as the scoped label key and the field values as the scoped label set values (for example, `input name::value1`, `input name::value2`).
- **Custom fields with text strings or integer values**: Inject the custom field name and value into a section in the issue's description.
- **Status**: Create a [scoped label](../labels.md#scoped-labels) with the status set as the scoped label key and the status values as the scoped label set values (for example, `status::in progress`).
- **Priority**: Create a [scoped label](../labels.md#scoped-labels) with the priority set as the scoped label key and the priority values as the scoped label set values (for example, `priority::1`).
- **Story Point**: Map this value to the GitLab issue's **weight** value.
- **Sprint**: Map this value to the GitLab issue's **iteration** value. This value is meaningful
only for issues that have not been completed or are scheduled for a future sprint. Before importing
the data, create the required [iterations](../../group/iterations/_index.md#iteration-cadences) in the
parent group of your project.
You might also need to handle parsing the Atlassian Document Format and mapping it to GitLab Flavored Markdown.
You can approach this in many different ways. For inspiration,
[review an example commit](https://gitlab.com/gitlab-org/gitlab/-/commit/4292a286d3f4ab26466f8e89125a4dbd194a9f3e).
This commit added a method to parse the Atlassian Document Format to GitLab Flavored Markdown for the GitLab Jira importer.
If you run GitLab locally, you can also convert Atlassian Document Format to GitLab Flavored Markdown
manually in the Rails console. To do so, execute:
```ruby
text = <document in Atlassian Document Format>
project = <project that wiki is in> or nil
Banzai.render(text, pipeline: :adf_commonmark, project: project)
```
|
https://docs.gitlab.com/user/project/tfvc
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/tfvc.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
tfvc.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Migrate from TFVC to Git
|
Migrate from Team Foundation Version Control (TFVC) to Git.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Team Foundation Server (TFS), renamed [Azure DevOps Server](https://azure.microsoft.com/en-us/products/devops/server/)
in 2019, is a set of tools developed by Microsoft which also includes
[Team Foundation Version Control](https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/what-is-tfvc?view=azure-devops)
(TFVC), a centralized version control system similar to Git.
In this document, we focus on the TFVC to Git migration.
## TFVC vs Git
The main differences between TFVC and Git are:
- **Git is distributed**: While TFVC is centralized using a client-server architecture,
Git is distributed. This translates to Git having a more flexible workflow because
you work with a copy of the entire repository. This allows you to quickly
switch branches or merge, for example, without needing to communicate with a remote server.
- **Storage**: Changes in a centralized version control system are per file (changeset),
while in Git a committed file is stored in its entirety (snapshot). That means that it is
very easy to revert or undo a whole change in Git.
For more information, see:
- The Microsoft [comparison of Git and TFVC](https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/comparison-git-tfvc?view=azure-devops).
- The Wikipedia [comparison of version control software](https://en.wikipedia.org/wiki/Comparison_of_version_control_software).
## Why migrate
Advantages of migrating to Git/GitLab:
- **No licensing costs**: Git is open source, while TFVC is proprietary.
- **Shorter learning curve**: Git has a big community and a vast number of
tutorials to get you started (see our [Git topic](../../../topics/git/_index.md)).
- **Integration with modern tools**: After migrating to Git and GitLab, you have
an open source, end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
## How to migrate
Migration options from TFVC to Git depend on your operating system.
- If you're migrating on Microsoft Windows, use the [`git-tfs`](https://github.com/git-tfs/git-tfs)
tool. See [Migrate TFS to Git](https://github.com/git-tfs/git-tfs/blob/master/doc/usecases/migrate_tfs_to_git.md)
for details.
- If you're on a Unix-based system, follow the procedures described with this
[TFVC to Git migration tool](https://github.com/turbo/gtfotfs).
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Migrate from TFVC to Git
description: Migrate from Team Foundation Version Control (TFVC) to Git.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Team Foundation Server (TFS), renamed [Azure DevOps Server](https://azure.microsoft.com/en-us/products/devops/server/)
in 2019, is a set of tools developed by Microsoft which also includes
[Team Foundation Version Control](https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/what-is-tfvc?view=azure-devops)
(TFVC), a centralized version control system similar to Git.
In this document, we focus on the TFVC to Git migration.
## TFVC vs Git
The main differences between TFVC and Git are:
- **Git is distributed**: While TFVC is centralized using a client-server architecture,
Git is distributed. This translates to Git having a more flexible workflow because
you work with a copy of the entire repository. This allows you to quickly
switch branches or merge, for example, without needing to communicate with a remote server.
- **Storage**: Changes in a centralized version control system are per file (changeset),
while in Git a committed file is stored in its entirety (snapshot). That means that it is
very easy to revert or undo a whole change in Git.
For more information, see:
- The Microsoft [comparison of Git and TFVC](https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/comparison-git-tfvc?view=azure-devops).
- The Wikipedia [comparison of version control software](https://en.wikipedia.org/wiki/Comparison_of_version_control_software).
## Why migrate
Advantages of migrating to Git/GitLab:
- **No licensing costs**: Git is open source, while TFVC is proprietary.
- **Shorter learning curve**: Git has a big community and a vast number of
tutorials to get you started (see our [Git topic](../../../topics/git/_index.md)).
- **Integration with modern tools**: After migrating to Git and GitLab, you have
an open source, end-to-end software development platform with built-in version
control, issue tracking, code review, CI/CD, and more.
## How to migrate
Migration options from TFVC to Git depend on your operating system.
- If you're migrating on Microsoft Windows, use the [`git-tfs`](https://github.com/git-tfs/git-tfs)
tool. See [Migrate TFS to Git](https://github.com/git-tfs/git-tfs/blob/master/doc/usecases/migrate_tfs_to_git.md)
for details.
- If you're on a Unix-based system, follow the procedures described with this
[TFVC to Git migration tool](https://github.com/turbo/gtfotfs).
|
https://docs.gitlab.com/user/project/repo_by_url
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/repo_by_url.md
|
2025-08-13
|
doc/user/project/import
|
[
"doc",
"user",
"project",
"import"
] |
repo_by_url.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Import project from repository by URL
|
Import repositories to GitLab by URL.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can import your existing repositories by providing the Git URL. You can't import GitLab issues and merge requests
this way. Other methods provide more complete import methods.
If the repository is too large, the import might time out.
You can import your Git repository by:
- [Using the UI](#import-a-project-by-using-the-ui)
- [Using the API](#import-a-project-by-using-the-api)
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Repository by URL import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Repository by URL import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
- If importing a private repository, an access token for authenticated access to the source repository might be required
instead of a password.
## Import a project by using the UI
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **Repository by URL**.
1. Enter a **Git repository URL**.
1. Complete the remaining fields. A username and password (or access token) is required for imports from private
repositories.
1. Select **Create project**.
Your newly created project is displayed.
### Import a timed-out project
Imports of large repositories might time out after three hours.
To import a timed-out project:
1. Clone the repository.
```shell
git clone --mirror https://example.com/group/project.git
```
The `--mirror` option ensures all branches, tags, and refs are copied.
1. Add the new remote repository.
```shell
cd repository.git
git remote add new-origin https://gitlab.com/group/project.git
```
1. Push everything to the new remote repository.
```shell
git push --mirror new-origin
```
## Import a project by using the API
You can use the [Projects API](../../../api/projects.md#create-a-project) to import a Git repository:
```shell
curl --location "https://gitlab.example.com/api/v4/projects/" \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-token>' \
--data-raw '{
"description": "New project description",
"path": "new_project_path",
"import_url": "https://username:password@example.com/group/project.git"
}'
```
Some providers do not allow a password and instead require an access token.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Import project from repository by URL
description: Import repositories to GitLab by URL.
breadcrumbs:
- doc
- user
- project
- import
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can import your existing repositories by providing the Git URL. You can't import GitLab issues and merge requests
this way. Other methods provide more complete import methods.
If the repository is too large, the import might time out.
You can import your Git repository by:
- [Using the UI](#import-a-project-by-using-the-ui)
- [Using the API](#import-a-project-by-using-the-api)
## Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- [Repository by URL import source](../../../administration/settings/import_and_export_settings.md#configure-allowed-import-sources)
must be enabled. If not enabled, ask your GitLab administrator to enable it. The Repository by URL import source is enabled
by default on GitLab.com.
- At least the Maintainer role on the destination group to import to.
- If importing a private repository, an access token for authenticated access to the source repository might be required
instead of a password.
## Import a project by using the UI
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. Select **Repository by URL**.
1. Enter a **Git repository URL**.
1. Complete the remaining fields. A username and password (or access token) is required for imports from private
repositories.
1. Select **Create project**.
Your newly created project is displayed.
### Import a timed-out project
Imports of large repositories might time out after three hours.
To import a timed-out project:
1. Clone the repository.
```shell
git clone --mirror https://example.com/group/project.git
```
The `--mirror` option ensures all branches, tags, and refs are copied.
1. Add the new remote repository.
```shell
cd repository.git
git remote add new-origin https://gitlab.com/group/project.git
```
1. Push everything to the new remote repository.
```shell
git push --mirror new-origin
```
## Import a project by using the API
You can use the [Projects API](../../../api/projects.md#create-a-project) to import a Git repository:
```shell
curl --location "https://gitlab.example.com/api/v4/projects/" \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-token>' \
--data-raw '{
"description": "New project description",
"path": "new_project_path",
"import_url": "https://username:password@example.com/group/project.git"
}'
```
Some providers do not allow a password and instead require an access token.
|
https://docs.gitlab.com/user/project/multiple_assignees_for_issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/multiple_assignees_for_issues.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
multiple_assignees_for_issues.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Multiple assignees for issues
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In large teams with shared ownership, it can be difficult
to track who is working on an issue, who's already done, or who hasn't started yet.
You can add multiple [assignees](managing_issues.md#assignees) to an issue, making it easier to
track, and making clearer who is accountable for it.
Multiple assignees for issues makes collaboration smoother,
and allows shared responsibilities to be clearly displayed.
All assignees are shown across your team's workflows and receive notifications (as they
would as single assignees), simplifying communication and ownership.
After an assignee completes their work, they remove themselves as an assignee, making
it clear that their task is complete.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Multiple assignees for issues
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In large teams with shared ownership, it can be difficult
to track who is working on an issue, who's already done, or who hasn't started yet.
You can add multiple [assignees](managing_issues.md#assignees) to an issue, making it easier to
track, and making clearer who is accountable for it.
Multiple assignees for issues makes collaboration smoother,
and allows shared responsibilities to be clearly displayed.
All assignees are shown across your team's workflows and receive notifications (as they
would as single assignees), simplifying communication and ownership.
After an assignee completes their work, they remove themselves as an assignee, making
it clear that their task is complete.
|
https://docs.gitlab.com/user/project/due_dates
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/due_dates.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
due_dates.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Due dates
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to set due dates [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Use due dates in work items to track deadlines, and make sure features are
shipped on time.
Due dates are supported in:
- [Issues](_index.md)
- [Epics](../../group/epics/_index.md)
- [Tasks](../../tasks.md)
- [Objectives and key results](../../okrs.md)
- [Incidents](../../../operations/incident_management/incidents.md)
The day before an open item is due, an email is sent to all participants.
<!-- For issue due timing source, see 'issue_due_scheduler_worker' in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/initializers/1_settings.rb -->
The notification is sent at 00:50 in the server's time zone (for GitLab.com this is UTC)
for all open items with a due date of the next calendar day.
Due dates also appear in your [to-do items](../../todos.md).
## View issues with due dates
You can see issues with their due dates on the **Issues** page.
If an issue contains a due date,
it is shown below the issue title:

Issue dates in the past are shown with a red icon ({{< icon name="calendar-overdue" >}}).
To view and sort issues containing due dates in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. To sort by due date, select the current sort method, then select **Due date**.
1. Optional. To reverse the sort order, select **Sort direction** ({{< icon name="sort-lowest" >}}).
## Set a due date for an issue
All users with permission to view the issue can view its due date.
### When creating an issue
If you have at least the Planner role, when creating an issue, select **Due date** to show a calendar.
This date uses the server's time zone, not the current user's time zone.
To remove the date, select the date text, then delete the text.
### In an existing issue
Prerequisites:
- You must have at least the Planner role.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select the title of your issue to view it.
1. On the right sidebar, next to **Due date**, select **Edit** to display a calendar.
1. Select your desired date, then select again, outside the calendar, to save your changes.
### With a quick action
To set a due date from a [quick action](../quick_actions.md) in an issue's description or comment:
- `/due <date>`: Set the due date. Examples of valid `<date>` include `in 2 days`, `this Friday`, and `December 31st`.
- `/remove_due_date`: Remove an existing due date.
## Export issue due dates to a calendar
Issues with due dates can also be exported as an iCalendar feed. The URL of the
feed can be added to calendar applications.
- The **Project Issues** page
- The **Group Issues** page
1. Go to the page that contains the list of issues you want to subscribe to.
For example:
- [Issues assigned to you](managing_issues.md#view-all-issues-assigned-to-you)
- [Issues in a specific project](managing_issues.md#issue-list)
- Issues for all projects [in a group](../../group/_index.md)
1. On the right, from the **Actions** ({{< icon name="ellipsis_v" >}}) dropdown list, select **Subscribe to calendar** to display the `.ics` file.
1. Copy the full link to the page (including the full query string) and use it in your
preferred calendar application.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Due dates
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to set due dates [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Use due dates in work items to track deadlines, and make sure features are
shipped on time.
Due dates are supported in:
- [Issues](_index.md)
- [Epics](../../group/epics/_index.md)
- [Tasks](../../tasks.md)
- [Objectives and key results](../../okrs.md)
- [Incidents](../../../operations/incident_management/incidents.md)
The day before an open item is due, an email is sent to all participants.
<!-- For issue due timing source, see 'issue_due_scheduler_worker' in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/initializers/1_settings.rb -->
The notification is sent at 00:50 in the server's time zone (for GitLab.com this is UTC)
for all open items with a due date of the next calendar day.
Due dates also appear in your [to-do items](../../todos.md).
## View issues with due dates
You can see issues with their due dates on the **Issues** page.
If an issue contains a due date,
it is shown below the issue title:

Issue dates in the past are shown with a red icon ({{< icon name="calendar-overdue" >}}).
To view and sort issues containing due dates in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. To sort by due date, select the current sort method, then select **Due date**.
1. Optional. To reverse the sort order, select **Sort direction** ({{< icon name="sort-lowest" >}}).
## Set a due date for an issue
All users with permission to view the issue can view its due date.
### When creating an issue
If you have at least the Planner role, when creating an issue, select **Due date** to show a calendar.
This date uses the server's time zone, not the current user's time zone.
To remove the date, select the date text, then delete the text.
### In an existing issue
Prerequisites:
- You must have at least the Planner role.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select the title of your issue to view it.
1. On the right sidebar, next to **Due date**, select **Edit** to display a calendar.
1. Select your desired date, then select again, outside the calendar, to save your changes.
### With a quick action
To set a due date from a [quick action](../quick_actions.md) in an issue's description or comment:
- `/due <date>`: Set the due date. Examples of valid `<date>` include `in 2 days`, `this Friday`, and `December 31st`.
- `/remove_due_date`: Remove an existing due date.
## Export issue due dates to a calendar
Issues with due dates can also be exported as an iCalendar feed. The URL of the
feed can be added to calendar applications.
- The **Project Issues** page
- The **Group Issues** page
1. Go to the page that contains the list of issues you want to subscribe to.
For example:
- [Issues assigned to you](managing_issues.md#view-all-issues-assigned-to-you)
- [Issues in a specific project](managing_issues.md#issue-list)
- Issues for all projects [in a group](../../group/_index.md)
1. On the right, from the **Actions** ({{< icon name="ellipsis_v" >}}) dropdown list, select **Subscribe to calendar** to display the `.ics` file.
1. Copy the full link to the page (including the full query string) and use it in your
preferred calendar application.
|
https://docs.gitlab.com/user/project/issue_work_items
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/issue_work_items.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
issue_work_items.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Test a new look for issues
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9584) in GitLab 17.5 [with a flag](../../../administration/feature_flags/_index.md) named `work_items_view_preference`. Disabled by default. This feature is in [beta](../../../policy/development_stages_support.md#beta).
- Feature flag named `work_items_view_preference` enabled on GitLab.com in GitLab 17.9 for a subset of users.
- Feature flag named `work_items_view_preference` [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184496) on GitLab.com, GitLab Self-Managed, and GitLab Dedicated in 17.10.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/482931) in GitLab 17.11.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/482931) to feature flag named `work_item_view_for_issues` in GitLab 18.1. Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated. Feature flag `work_items_view_preference` removed.
{{< /history >}}
<!-- Incorporate this content into issues/index.md or managing_issues.md and redirect this page there -->
We have changed how issues look by migrating them to a unified framework for work items to better
meet the product needs of our Agile Planning offering.
These changes include a new drawer view of issues opened from the issue list, issue board, or child or linked items, a new creation workflow for issues and incidents, and a new view for issues.
For more information, see [epic 9584](https://gitlab.com/groups/gitlab-org/-/epics/9584) and the
blog post
[First look: The new Agile planning experience in GitLab](https://about.gitlab.com/blog/2024/06/18/first-look-the-new-agile-planning-experience-in-gitlab/) (June 2024).
## Feedback
Find a bug or have a request? Leave feedback in [issue 523713](https://gitlab.com/gitlab-org/gitlab/-/issues/523713).
## New features
The new issues experience includes these improvements:
- **Drawer view**: When you open an issue from the issue list, the issue opens in a
drawer without leaving the current page.
The drawer provides a complete view of the issue.
To view the full page instead, either:
1. Select **View in full page** at the top of the drawer.
1. Open the link in a new tab.
To always open issues in the full page view on the Epics page, in the top right corner, select **Display options** ({{< icon name="preferences" >}}) and turn off the **Open items in side panel** toggle.
- **Issue controls**: All issue controls, including confidentiality settings, are now in the top actions menu.
This menu stays visible as you scroll through the page.
- **Redesigned sidebar**: The sidebar is now embedded in the page, similar to merge requests and epics.
On smaller screens, the sidebar content appears below the description.
- **Parent hierarchy**: Above the title, you can view the entire hierarchy this item belongs to.
The sidebar also displays the parent work item (previously called "Epic").
- **Change type**: You can change between different types of items:
1. From the top actions menu, select **Change type**.
1. Select the new type: Issue, Task, Incident, or Epic.
When you change an issue to an epic, the epic is created in the parent group because epics can
only exist in groups.
- **Development**: Merge requests, branches, and feature flags related to this item are shown in a single list.
## Work item Markdown reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.1 [with a flag](../../../administration/feature_flags/_index.md) named `extensible_reference_filters`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197052) in GitLab 18.2. Feature flag `extensible_reference_filters` removed.
{{< /history >}}
You can reference work items in GitLab Flavored Markdown fields with `[work_item:123]`.
For more information, see [GitLab-specific references](../../markdown.md#gitlab-specific-references).
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Test a new look for issues
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/9584) in GitLab 17.5 [with a flag](../../../administration/feature_flags/_index.md) named `work_items_view_preference`. Disabled by default. This feature is in [beta](../../../policy/development_stages_support.md#beta).
- Feature flag named `work_items_view_preference` enabled on GitLab.com in GitLab 17.9 for a subset of users.
- Feature flag named `work_items_view_preference` [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184496) on GitLab.com, GitLab Self-Managed, and GitLab Dedicated in 17.10.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/482931) in GitLab 17.11.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/482931) to feature flag named `work_item_view_for_issues` in GitLab 18.1. Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated. Feature flag `work_items_view_preference` removed.
{{< /history >}}
<!-- Incorporate this content into issues/index.md or managing_issues.md and redirect this page there -->
We have changed how issues look by migrating them to a unified framework for work items to better
meet the product needs of our Agile Planning offering.
These changes include a new drawer view of issues opened from the issue list, issue board, or child or linked items, a new creation workflow for issues and incidents, and a new view for issues.
For more information, see [epic 9584](https://gitlab.com/groups/gitlab-org/-/epics/9584) and the
blog post
[First look: The new Agile planning experience in GitLab](https://about.gitlab.com/blog/2024/06/18/first-look-the-new-agile-planning-experience-in-gitlab/) (June 2024).
## Feedback
Find a bug or have a request? Leave feedback in [issue 523713](https://gitlab.com/gitlab-org/gitlab/-/issues/523713).
## New features
The new issues experience includes these improvements:
- **Drawer view**: When you open an issue from the issue list, the issue opens in a
drawer without leaving the current page.
The drawer provides a complete view of the issue.
To view the full page instead, either:
1. Select **View in full page** at the top of the drawer.
1. Open the link in a new tab.
To always open issues in the full page view on the Epics page, in the top right corner, select **Display options** ({{< icon name="preferences" >}}) and turn off the **Open items in side panel** toggle.
- **Issue controls**: All issue controls, including confidentiality settings, are now in the top actions menu.
This menu stays visible as you scroll through the page.
- **Redesigned sidebar**: The sidebar is now embedded in the page, similar to merge requests and epics.
On smaller screens, the sidebar content appears below the description.
- **Parent hierarchy**: Above the title, you can view the entire hierarchy this item belongs to.
The sidebar also displays the parent work item (previously called "Epic").
- **Change type**: You can change between different types of items:
1. From the top actions menu, select **Change type**.
1. Select the new type: Issue, Task, Incident, or Epic.
When you change an issue to an epic, the epic is created in the parent group because epics can
only exist in groups.
- **Development**: Merge requests, branches, and feature flags related to this item are shown in a single list.
## Work item Markdown reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.1 [with a flag](../../../administration/feature_flags/_index.md) named `extensible_reference_filters`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197052) in GitLab 18.2. Feature flag `extensible_reference_filters` removed.
{{< /history >}}
You can reference work items in GitLab Flavored Markdown fields with `[work_item:123]`.
For more information, see [GitLab-specific references](../../markdown.md#gitlab-specific-references).
|
https://docs.gitlab.com/user/project/csv_import
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/csv_import.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
csv_import.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Importing issues from CSV
|
Import issues to a project by uploading a CSV file.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Additionally [allowed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) for Planner role in GitLab 17.7.
{{< /history >}}
You can import issues to a project by uploading a CSV (comma-separated values) file with the following columns:
| Name | Required? | Description |
|:--------------|:-----------------------|:-------------------------------------------------|
| `title` | {{< icon name="check-circle" >}} Yes | Issue title. |
| `description` | {{< icon name="check-circle" >}} Yes | Issue description. |
| `due_date` | {{< icon name="dotted-circle" >}} No | Issue due date in `YYYY-MM-DD` format. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91317) in GitLab 15.2. |
| `milestone` | {{< icon name="dotted-circle" >}} No | Title of the issue milestone. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112204) in GitLab 16.7. |
Data in other columns is not imported.
You can use the `description` field to embed [quick actions](../quick_actions.md) to add other data to the issue.
For example, labels, assignees, and milestones.
Alternatively, you can [move an issue](managing_issues.md#move-an-issue). Moving issues preserves more data.
The user uploading the CSV file is set as the author of the imported issues.
You must have the Planner role or at least the Developer role for a project to import issues.
## Prepare for the import
- Consider importing a test file containing only a few issues. There is no way to undo a large import without using the GitLab API.
- Ensure your CSV file meets the [file format](#csv-file-format) requirements.
- If your CSV includes the milestone header, ensure all unique milestones titles in the file already exist in the project or its parent groups.
## Import the file
To import issues:
1. Go to your project's **Issues** page.
1. Open the import feature, depending if the project has issues:
- The project has existing issues: in the upper-right corner, next to **Bulk edit**, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Import CSV**.
- The project has no issues: in the middle of the page, select **Import CSV**.
1. Select the file you want to import, and then select **Import issues**.
The file is processed in the background, and a notification email is sent
to you if any errors are detected or after the import is complete.
## CSV file format
To import issues, GitLab requires CSV files have a specific format.
{{< alert type="note" >}}
For information about CSV parsing requirements that can affect how imported files display when viewed in GitLab, see [CSV parsing considerations](../repository/files/csv.md#csv-parsing-considerations).
{{< /alert >}}
| Element | Format |
|------------------------|--------|
| header row | CSV files must include the following headers: `title` and `description`. The case of the headers does not matter. |
| columns | Data from columns outside of `title`, `description`, `due_date`, and `milestone` are not imported. |
| separators | The column separator is detected from the header row. Supported separator characters are commas (`,`), semicolons (`;`), and tabs (`\t`). The row separator can be either `CRLF` or `LF`. |
| double-quote character | The double-quote (`"`) character is used to quote fields, enabling the use of the column separator in a field (see the third line in the sample CSV data below). To insert a double-quote (`"`) in a quoted field use two double-quote characters in succession (`""`). |
| data rows | After the header row, following rows must use the same column order. The issue title is required, but the description is optional. |
If you have special characters (for example, `,` or `\n`) or multiple lines in a field (for example,
when using [quick actions](../quick_actions.md)), surround the characters with double quotes (`"`).
Also when using [quick actions](../quick_actions.md):
- Each action must be on a separate line.
- For quick actions like `/label` and `/milestone`, the label or milestone must already exist in the project.
- The user you assign the issue to must be a member of the project.
Sample CSV data:
```plaintext
title,description,due_date,milestone
My Issue Title,My Issue Description,2022-06-28
Another Title,"A description, with a comma",
"One More Title","One More Description",
An Issue with Quick Actions,"Hey can we change the frontend?
/assign @sjones
/label ~frontend ~documentation",
An issue with milestone,"My milestone is created",,v1.0
```
### File size
The limit depends on how your GitLab instance is hosted:
- GitLab Self-Managed: Set by the configuration value of `Max Attachment Size` for the GitLab instance.
- GitLab SaaS: On GitLab.com, it's set to 10 MB.
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Importing issues from CSV
description: Import issues to a project by uploading a CSV file.
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Additionally [allowed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) for Planner role in GitLab 17.7.
{{< /history >}}
You can import issues to a project by uploading a CSV (comma-separated values) file with the following columns:
| Name | Required? | Description |
|:--------------|:-----------------------|:-------------------------------------------------|
| `title` | {{< icon name="check-circle" >}} Yes | Issue title. |
| `description` | {{< icon name="check-circle" >}} Yes | Issue description. |
| `due_date` | {{< icon name="dotted-circle" >}} No | Issue due date in `YYYY-MM-DD` format. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91317) in GitLab 15.2. |
| `milestone` | {{< icon name="dotted-circle" >}} No | Title of the issue milestone. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112204) in GitLab 16.7. |
Data in other columns is not imported.
You can use the `description` field to embed [quick actions](../quick_actions.md) to add other data to the issue.
For example, labels, assignees, and milestones.
Alternatively, you can [move an issue](managing_issues.md#move-an-issue). Moving issues preserves more data.
The user uploading the CSV file is set as the author of the imported issues.
You must have the Planner role or at least the Developer role for a project to import issues.
## Prepare for the import
- Consider importing a test file containing only a few issues. There is no way to undo a large import without using the GitLab API.
- Ensure your CSV file meets the [file format](#csv-file-format) requirements.
- If your CSV includes the milestone header, ensure all unique milestones titles in the file already exist in the project or its parent groups.
## Import the file
To import issues:
1. Go to your project's **Issues** page.
1. Open the import feature, depending if the project has issues:
- The project has existing issues: in the upper-right corner, next to **Bulk edit**, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Import CSV**.
- The project has no issues: in the middle of the page, select **Import CSV**.
1. Select the file you want to import, and then select **Import issues**.
The file is processed in the background, and a notification email is sent
to you if any errors are detected or after the import is complete.
## CSV file format
To import issues, GitLab requires CSV files have a specific format.
{{< alert type="note" >}}
For information about CSV parsing requirements that can affect how imported files display when viewed in GitLab, see [CSV parsing considerations](../repository/files/csv.md#csv-parsing-considerations).
{{< /alert >}}
| Element | Format |
|------------------------|--------|
| header row | CSV files must include the following headers: `title` and `description`. The case of the headers does not matter. |
| columns | Data from columns outside of `title`, `description`, `due_date`, and `milestone` are not imported. |
| separators | The column separator is detected from the header row. Supported separator characters are commas (`,`), semicolons (`;`), and tabs (`\t`). The row separator can be either `CRLF` or `LF`. |
| double-quote character | The double-quote (`"`) character is used to quote fields, enabling the use of the column separator in a field (see the third line in the sample CSV data below). To insert a double-quote (`"`) in a quoted field use two double-quote characters in succession (`""`). |
| data rows | After the header row, following rows must use the same column order. The issue title is required, but the description is optional. |
If you have special characters (for example, `,` or `\n`) or multiple lines in a field (for example,
when using [quick actions](../quick_actions.md)), surround the characters with double quotes (`"`).
Also when using [quick actions](../quick_actions.md):
- Each action must be on a separate line.
- For quick actions like `/label` and `/milestone`, the label or milestone must already exist in the project.
- The user you assign the issue to must be a member of the project.
Sample CSV data:
```plaintext
title,description,due_date,milestone
My Issue Title,My Issue Description,2022-06-28
Another Title,"A description, with a comma",
"One More Title","One More Description",
An Issue with Quick Actions,"Hey can we change the frontend?
/assign @sjones
/label ~frontend ~documentation",
An issue with milestone,"My milestone is created",,v1.0
```
### File size
The limit depends on how your GitLab instance is hosted:
- GitLab Self-Managed: Set by the configuration value of `Max Attachment Size` for the GitLab instance.
- GitLab SaaS: On GitLab.com, it's set to 10 MB.
|
https://docs.gitlab.com/user/project/related_issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/related_issues.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
related_issues.md
|
Plan
|
Product Planning
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Linked issues
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/10267) minimum required role from Reporter (if true) to Guest in GitLab 17.0.
{{< /history >}}
Linked issues are a bi-directional relationship between any two issues and appear in a block below
the issue description. You can link issues in different projects.
The relationship only shows up in the UI if the user can see both issues. When you try to close an
issue that has open blockers, a warning is displayed.
{{< alert type="note" >}}
To manage linked issues through our API, see [Issue links API](../../../api/issue_links.md).
{{< /alert >}}
## Add a linked issue
Prerequisites:
- You must have at least the Guest role for both projects.
To link one issue to another:
1. In the **Linked items** section of an issue,
select the add linked issue button ({{< icon name="plus" >}}).
1. Select the relationship between the two issues. Either:
- **relates to**
- **[blocks](#blocking-issues)**
- **[is blocked by](#blocking-issues)**
1. Input the issue number or paste in the full URL of the issue.

Issues of the same project can be specified just by the reference number.
Issues from a different project require additional information like the
group and the project name. For example:
- The same project: `#44`
- The same group: `project#44`
- Different group: `group/project#44`
Valid references are added to a temporary list that you can review.
1. When you have added all the linked issues, select **Add**.
When you have finished adding all linked issues, you can see
them categorized so their relationships can be better understood visually.

You can also add a linked issue from a commit message or the description in another issue or MR.
For more information, see [Crosslinking issues](crosslinking_issues.md).
## Remove a linked issue
In the **Linked items** section of an issue, select the remove button ({{< icon name="close" >}}) on the
right-side of each issue token to remove.
Due to the bi-directional relationship, the relationship no longer appears in either issue.

Access our [permissions](../../permissions.md) page for more information.
## Blocking issues
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you [add a linked issue](#add-a-linked-issue), you can show that it **blocks** or
**is blocked by** another issue.
Issues blocked by other issues have an icon ({{< icon name="entity-blocked" >}}) next to their title, shown in the
issue lists and [boards](../issue_board.md).
The icon disappears when the blocking issue is closed or their relationship is changed or
[removed](#remove-a-linked-issue).
If you try to close a blocked issue using the "Close issue" button, a confirmation message appears.
|
---
stage: Plan
group: Product Planning
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Linked issues
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/10267) minimum required role from Reporter (if true) to Guest in GitLab 17.0.
{{< /history >}}
Linked issues are a bi-directional relationship between any two issues and appear in a block below
the issue description. You can link issues in different projects.
The relationship only shows up in the UI if the user can see both issues. When you try to close an
issue that has open blockers, a warning is displayed.
{{< alert type="note" >}}
To manage linked issues through our API, see [Issue links API](../../../api/issue_links.md).
{{< /alert >}}
## Add a linked issue
Prerequisites:
- You must have at least the Guest role for both projects.
To link one issue to another:
1. In the **Linked items** section of an issue,
select the add linked issue button ({{< icon name="plus" >}}).
1. Select the relationship between the two issues. Either:
- **relates to**
- **[blocks](#blocking-issues)**
- **[is blocked by](#blocking-issues)**
1. Input the issue number or paste in the full URL of the issue.

Issues of the same project can be specified just by the reference number.
Issues from a different project require additional information like the
group and the project name. For example:
- The same project: `#44`
- The same group: `project#44`
- Different group: `group/project#44`
Valid references are added to a temporary list that you can review.
1. When you have added all the linked issues, select **Add**.
When you have finished adding all linked issues, you can see
them categorized so their relationships can be better understood visually.

You can also add a linked issue from a commit message or the description in another issue or MR.
For more information, see [Crosslinking issues](crosslinking_issues.md).
## Remove a linked issue
In the **Linked items** section of an issue, select the remove button ({{< icon name="close" >}}) on the
right-side of each issue token to remove.
Due to the bi-directional relationship, the relationship no longer appears in either issue.

Access our [permissions](../../permissions.md) page for more information.
## Blocking issues
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you [add a linked issue](#add-a-linked-issue), you can show that it **blocks** or
**is blocked by** another issue.
Issues blocked by other issues have an icon ({{< icon name="entity-blocked" >}}) next to their title, shown in the
issue lists and [boards](../issue_board.md).
The icon disappears when the blocking issue is closed or their relationship is changed or
[removed](#remove-a-linked-issue).
If you try to close a blocked issue using the "Close issue" button, a confirmation message appears.
|
https://docs.gitlab.com/user/project/managing_issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/managing_issues.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
managing_issues.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Manage issues
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab issues help you track work and collaborate with your team.
You can manage issues to:
- Edit details like title, description, assignees, and metadata.
- Move issues between projects while maintaining their context and history.
- Close completed issues and reopen them if needed.
- Use bulk editing to update multiple issues efficiently.
- Track issue health status to monitor progress and identify risks.
## Edit an issue
{{< history >}}
- Minimum role to edit an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit an issue's title and description.
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To edit an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select the title of your issue to view it.
1. To the right of the title, select **Edit** ({{< icon name="pencil" >}}).
1. Edit the available fields.
1. Select **Save changes**.
### Populate an issue with Issue Description Generation
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com
- Status: Experiment
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- Available on GitLab Duo with self-hosted models: Not supported
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10762) in GitLab 16.3 as an [experiment](../../../policy/development_stages_support.md#experiment).
- Changed to require GitLab Duo add-on in GitLab 17.6 and later.
- Changed to include Premium in GitLab 18.0.
{{< /history >}}
Generate a detailed description for an issue based on a short summary you provide.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=-BWBQat7p5M)
<!-- Video published on 2024-12-18 -->
Prerequisites:
- You must belong to at least one group with the [experiment and beta features setting](../../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
- You must have permission to create an issue.
- Only available for the plain text editor.
- Only available when creating a new issue.
For a proposal to add support for generating descriptions when editing existing issues, see
[issue 474141](https://gitlab.com/gitlab-org/gitlab/-/issues/474141).
To generate an issue description:
1. Create a new issue.
1. Above the **Description** field, select **GitLab Duo** ({{< icon name="tanuki-ai" >}}) **> Generate issue description**.
1. Write a short description and select **Submit**.
The issue description is replaced with AI-generated text.
Provide feedback on this experimental feature in [issue 409844](https://gitlab.com/gitlab-org/gitlab/-/issues/409844).
**Data usage**: When you use this feature, the text you enter is sent to
the large language model.
## Bulk edit issues from a project
{{< history >}}
- Minimum role to bulk edit issues from a project [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit multiple issues at a time when you're in a project.
Prerequisites:
- You must have at least the Planner role for the project.
To edit multiple issues at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Select **Bulk edit**. A sidebar on the right of your screen appears.
1. Select the checkboxes next to each issue you want to edit.
1. From the sidebar, edit the available fields.
1. Select **Update selected**.
When bulk editing issues in a project, you can edit the following attributes:
- [Status](../../work_items/status.md)
- State (open or closed)
- [Assignees](managing_issues.md#assignees)
- [Epic](../../group/epics/_index.md)
- [Milestone](../milestones/_index.md)
- [Labels](../labels.md)
- [Health status](#health-status)
- [Notification](../../profile/notifications.md) subscription
- [Iteration](../../group/iterations/_index.md)
- [Confidentiality](confidential_issues.md)
### Bulk edit issues from a group
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to bulk edit issues from a group [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit multiple issues across multiple projects when you're in a group.
Prerequisites:
- You must have at least the Planner role for a group.
To edit multiple issues at the same time:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Plan > Issues**.
1. Select **Bulk edit**. A sidebar on the right of your screen appears.
1. Select the checkboxes next to each issue you want to edit.
1. From the sidebar, edit the available fields.
1. Select **Update selected**.
When bulk editing issues in a group, you can edit the following attributes:
- [Status](../../work_items/status.md)
- [Epic](../../group/epics/_index.md)
- [Milestone](../milestones/_index.md)
- [Iteration](../../group/iterations/_index.md)
- [Labels](../labels.md)
- [Health status](#health-status)
## Move an issue
{{< history >}}
- Minimum role to move an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When you move an issue, it's closed and copied to the target project.
The original issue is not deleted. A [system note](../system_notes.md), which indicates
where it came from and went to, is added to both issues.
Be careful when moving an issue to a project with different access rules. Before moving the issue, make sure it does not contain sensitive data.
Prerequisites:
- You must have at least the Planner role for the project.
To move an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, select **Move issue**.
1. Search for a project to move the issue to.
1. Select **Move**.
You can also use the `/move` [quick action](../quick_actions.md) in a comment or description.
### Moving tasks when the parent issue is moved
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371252) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `move_issue_children`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/371252) in GitLab 16.11.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/371252) in GitLab 17.3. Feature flag `move_issue_children` removed.
{{< /history >}}
When you move an issue to another project, all its child tasks are also moved to the target project
and remain as child tasks of the moved issue.
Each task is moved the same way as the parent, that is, it's closed in the original project and
copied to the target project.
### Bulk move issues
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to bulk move issues [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
#### From the Issues page
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15991) in GitLab 15.6.
{{< /history >}}
You can move multiple issues at the same time when you're in a project.
You can't move tasks or test cases.
Prerequisites:
- You must have at least the Planner role for the project.
To move multiple issues at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Select **Bulk edit**. A sidebar on the right of your screen appears.
1. Select the checkboxes next to each issue you want to move.
1. From the right sidebar, select **Move selected**.
1. From the dropdown list, select the destination project.
1. Select **Move**.
#### From the Rails console
You can move all open issues from one project to another.
Prerequisites:
- You must have access to the Rails console of the GitLab instance.
To do it:
1. Optional (but recommended). [Create a backup](../../../administration/backup_restore/_index.md) before
attempting any changes in the console.
1. Open the [Rails console](../../../administration/operations/rails_console.md).
1. Run the following script. Make sure to change `project`, `admin_user`, and `target_project` to
your values.
```ruby
project = Project.find_by_full_path('full path of the project where issues are moved from')
issues = project.issues
admin_user = User.find_by_username('username of admin user') # make sure user has permissions to move the issues
target_project = Project.find_by_full_path('full path of target project where issues moved to')
issues.each do |issue|
if issue.state != "closed" && issue.moved_to.nil?
Issues::MoveService.new(container: project, current_user: admin_user).execute(issue, target_project)
else
puts "issue with id: #{issue.id} and title: #{issue.title} was not moved"
end
end; nil
```
1. To exit the Rails console, enter `quit`.
## Description lists and task lists
When you use ordered lists, unordered lists, or task lists in issue descriptions, you can:
- Reorder list items with drag and drop
- Delete list items
- [Convert task list items to GitLab Tasks](../../tasks.md#from-a-task-list-item)
### Delete a task list item
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377307) in GitLab 15.9.
{{< /history >}}
Prerequisites:
- You must have at least the Reporter role for the project, or be the author or assignee of the issue.
In an issue description with task list items:
1. Hover over a task list item and select the options menu ({{< icon name="ellipsis_v" >}}).
1. Select **Delete**.
The task list item is removed from the issue description.
Any nested task list items are moved up a nested level.
### Reorder list items in the issue description
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15260) in GitLab 15.0.
- Minimum role to reorder list items in the issue description [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When you view an issue that has a list in the description, you can also reorder the list items.
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be
assigned to the issue.
- The issue's description must have an [ordered, unordered](../../markdown.md#lists), or
[task](../../markdown.md#task-lists) list.
To reorder list items, when viewing an issue:
1. Hover over the list item row to make the grip icon ({{< icon name="grip" >}}) visible.
1. Select and hold the grip icon.
1. Drag the row to the new position in the list.
1. Release the grip icon.
## Close an issue
{{< history >}}
- Minimum role to close an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When you decide that an issue is resolved or no longer needed, you can close it.
The issue is marked as closed but is not deleted.
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To close an issue, you can either:
- In an [issue board](../issue_board.md), drag an issue card from its list into the **Closed** list.
- From any other page in the GitLab UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}) and then **Close issue**.
You can also use the `/close` [quick action](../quick_actions.md) in a comment or description.
### Reopen a closed issue
{{< history >}}
- Minimum role to reopen a closed issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To reopen a closed issue, in the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}) and then **Reopen issue**.
A reopened issue is no different from any other open issue.
You can also use the `/reopen` [quick action](../quick_actions.md) in a comment or description.
### Closing issues automatically
You can close issues automatically by using certain words, called a _closing pattern_,
in a commit message or merge request description. GitLab Self-Managed administrators
can [change the default closing pattern](../../../administration/issue_closing_pattern.md).
If a commit message or merge request description contains text matching the [closing pattern](#default-closing-pattern),
all issues referenced in the matched text are closed when either:
- The commit is pushed to a project's [**default** branch](../repository/branches/default.md).
- The commit or merge request is merged into the default branch.
For example, if you include `Closes #4, #6, Related to #5` in a merge request
description:
- Issues `#4` and `#6` are closed automatically when the MR is merged.
- Issue `#5` is marked as a [related issue](related_issues.md), but it's not closed automatically.
Alternatively, when you [create a merge request from an issue](../merge_requests/creating_merge_requests.md#from-an-issue),
it inherits the issue's milestone and labels.
For performance reasons, automatic issue closing is disabled for the very first
push from an existing repository.
#### User responsibility when merging
When you merge a merge request, it's your responsibility to check that it's appropriate for any targeted issues
to close. Users can include issue closing patterns in the merge request description, and also in the body
of a commit message. Closing messages in commit messages are easy to miss. In both cases, the merge request widget
shows information about the issue to close on merge:

When you merge a merge request, GitLab checks that you have permission to close the targeted issues.
In public repositories, this check is important, because external users can create both merge requests
and commits that contain closing patterns. When you are the user who merges, it's important
that you are aware of the effects the merge has on both the code and issues in your project.
When [auto-merge](../merge_requests/auto_merge.md) is enabled for a merge request, no further changes can be made to
the list of issues that will be automatically closed.
#### Default closing pattern
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/465391) work item (task, objective, or key result) references in GitLab 17.3.
{{< /history >}}
To automatically close an issue, use the following keywords followed by the issue reference.
Available keywords:
- `Close`, `Closes`, `Closed`, `Closing`, `close`, `closes`, `closed`, `closing`
- `Fix`, `Fixes`, `Fixed`, `Fixing`, `fix`, `fixes`, `fixed`, `fixing`
- `Resolve`, `Resolves`, `Resolved`, `Resolving`, `resolve`, `resolves`, `resolved`, `resolving`
- `Implement`, `Implements`, `Implemented`, `Implementing`, `implement`, `implements`, `implemented`, `implementing`
Available issue reference formats:
- A local issue (`#123`).
- A cross-project issue (`group/project#123`).
- The full URL of an issue (`https://gitlab.example.com/<project_full_path>/-/issues/123`).
- The full URL of a work item (for example, task, objective, or key result):
- In a project (`https://gitlab.example.com/<project_full_path>/-/work_items/123`).
- In a group (`https://gitlab.example.com/groups/<group_full_path>/-/work_items/123`).
For example:
```plaintext
Awesome commit message
Fix #20, Fixes #21 and Closes group/otherproject#22.
This commit is also related to #17 and fixes #18, #19
and https://gitlab.example.com/group/otherproject/-/issues/23.
```
The previous commit message closes `#18`, `#19`, `#20`, and `#21` in the project this commit is pushed to,
as well as `#22` and `#23` in `group/otherproject`. `#17` is not closed as it does
not match the pattern.
You can use the closing patterns in multi-line commit messages or one-liners
done from the command line with `git commit -m`.
The default issue closing pattern regex:
```shell
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?: *,? +and +| *,? *)?)|([A-Z][A-Z0-9_]+-\d+))+)
```
#### Disable automatic issue closing
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/240922) in GitLab 15.4: The referenced issue's project setting is checked instead of the project of the commit or merge request.
{{< /history >}}
You can disable the automatic issue closing feature on a per-project basis
in the [project's settings](#disable-automatic-issue-closing).
Prerequisites:
- You must have at least the Maintainer role for the project.
To disable automatic issue closing:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Branch defaults**.
1. Clear the **Auto-close referenced issues on default branch** checkbox.
1. Select **Save changes**.
Referenced issues are still displayed, but are not closed automatically.
Changing this setting applies only to new merge requests or commits. Already
closed issues remain as they are.
Disabling automatic issue closing only applies to issues in the project where the setting was disabled.
Merge requests and commits in this project can still close another project's issues.
#### Customize the issue closing pattern
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Prerequisites:
- You must have [administrator access](../../../administration/_index.md) to your GitLab instance.
Learn how to change the default [issue closing pattern](../../../administration/issue_closing_pattern.md)
of your installation.
## Prevent truncating descriptions with "Read more"
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
If an issue description is long, GitLab displays only part of it.
To see the whole description, you must select **Read more**.
This truncation makes it easier to find other elements on the page without scrolling through lengthy text.
Prerequisites:
- [The new look for issues](issue_work_items.md) must be enabled.
To change whether descriptions are truncated:
1. On an issue, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Toggle **Truncate descriptions** according to your preference.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
## Hide the right sidebar
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
Issue attributes are shown in a sidebar to the right of the description when space allows.
Prerequisites:
- [The new look for issues](issue_work_items.md) must be enabled.
To hide the sidebar and increase space for the description:
1. On an issue, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Hide sidebar**.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
To show the sidebar again:
- Repeat the previous steps and select **Show sidebar**.
## Change the issue type
{{< history >}}
- Minimum role to change the issue type [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must be the issue author or have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To change issue type:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. To the right of the title, select **Edit title and description** ({{< icon name="pencil" >}}).
1. Edit the issue and select an issue type from the **Issue type** dropdown list:
- Issue
- [Incident](../../../operations/incident_management/_index.md)
1. Select **Save changes**.
## Delete an issue
{{< history >}}
- Required role to delete an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Owner to Owner or Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have the Planner or Owner role for a project.
To delete an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Delete issue**.
Alternatively:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select the title of your issue to view it.
1. Select **Edit title and description** ({{< icon name="pencil" >}}).
1. Select **Delete issue**.
## Promote an issue to an epic
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to promote an issue to an epic [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can promote an issue to an [epic](../../group/epics/_index.md) in the immediate parent group.
Promoting a confidential issue to an epic creates a
[confidential epic](../../group/epics/manage_epics.md#make-an-epic-confidential), retaining
confidentiality.
When an issue is promoted to an epic:
- An epic is created in the same group as the project of the issue.
- Subscribers of the issue are notified that the epic was created.
The following issue metadata is copied to the epic:
- Title, description, activity, and comment threads.
- Upvotes and downvotes.
- Participants.
- Group labels that the issue had.
- Parent epic.
Prerequisites:
- The project to which the issue belongs must be in a group.
- You must have at least the Planner role the project's immediate parent group.
- You must either:
- Have at least the Planner role for the project.
- Be the author of the issue.
- Be assigned to the issue.
To promote an issue to an epic:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Promote to epic**.
Alternatively, you can use the `/promote` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
## Promote an issue to an incident
{{< history >}}
- Quick actions to set issue type as incident upon creation [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/376760) in GitLab 15.8.
{{< /history >}}
You can use the `/promote_to_incident` [quick action](../quick_actions.md) to promote the issue to an [incident](../../../operations/incident_management/incidents.md).
## Add an issue to an iteration
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To add an issue to an [iteration](../../group/iterations/_index.md):
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Iteration** section, select **Edit**.
1. From the dropdown list, select the iteration to add this issue to.
1. Select any area outside the dropdown list.
To add an issue to an iteration, you can also:
- Use the `/iteration` [quick action](../quick_actions.md#issues-merge-requests-and-epics)
- Drag an issue into an iteration list in a board
- Bulk edit issues from the issues list
## View all issues assigned to you
To view all issues assigned to you:
1. On the left sidebar, select **Search or go to**.
1. From the dropdown list, select **Issues assigned to me**.
Or:
- To use a [keyboard shortcut](../../shortcuts.md), press <kbd>Shift</kbd> + <kbd>i</kbd>.
- On the left sidebar, at the top, select **Assigned issues** ({{< icon name="issues" >}}).
## Issue list
The issue list shows all issues in your project or group.
You can use it to view, sort, and manage issues.
To view the issue list:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
From the issue list, you can:
- View issue details like title, assignees, labels, and milestone.
- [Sort issues](sorting_issue_lists.md) by various criteria.
- Filter issues to find specific ones.
- Edit issues individually or in bulk.
- Create new issues.
The following sections describe how to work with the issue list.
### Filter the list of issues
{{< history >}}
- Filtering by type was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/322755) in GitLab 13.10 [with a flag](../../../administration/feature_flags/_index.md) named `vue_issues_list`. Disabled by default.
- Filtering by type was [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/322755) in GitLab 14.10.
- Filtering by type is generally available in GitLab 15.1. [Feature flag `vue_issues_list`](https://gitlab.com/gitlab-org/gitlab/-/issues/359966) removed.
- Filtering by health status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218711) in GitLab 15.5.
{{< /history >}}
To filter the list of issues:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Above the list of issues, select **Search or filter results**.
1. In the dropdown list that appears, select the attribute you want to filter by.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
- `=`: Is
- `!=`: Is not one of
1. Enter the text to filter the attribute by.
You can filter some attributes by **None** or **Any**.
1. Repeat this process to filter by multiple attributes. Multiple attributes are joined by a logical
`AND`.
#### Filter by title or description
To filter the list issues for text in a title or description:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Above the list of issues, in the **Search or filter results** text box, enter the searched phrase.
1. In the dropdown list that appears, select **Search within**, and then either **Titles** or **Descriptions**.
1. Press <kbd>Enter</kbd> or select the search icon ({{< icon name="search" >}}).
Filtering issues uses [PostgreSQL full text search](https://www.postgresql.org/docs/16/textsearch-intro.html)
to match meaningful and significant words to answer a query.
For example, if you search for `I am securing information for M&A`,
GitLab can return results with `securing`, `secured`,
or `information` in the title or description.
However, GitLab doesn't match the sentence or the words `I`, `am` or `M&A` exactly,
as they aren't deemed lexically meaningful or significant.
It's a limitation of PostgreSQL full text search.
#### Filter with the OR operator
{{< history >}}
- OR filtering for author and assignee was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23532) in GitLab 15.6 [with a flag](../../../administration/feature_flags/_index.md) named `or_issuable_queries`. Disabled by default.
- OR filtering for label was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23532) in GitLab 15.8 [with a flag](../../../administration/feature_flags/_index.md) named `or_issuable_queries`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104292) in GitLab 15.9.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/296031) in GitLab 17.0. Feature flag `or_issuable_queries` removed.
{{< /history >}}
You can use the OR operator (**is one of: `||`**) when you [filter the list of issues](#filter-the-list-of-issues) by:
- Assignees
- Author
- Labels
`is one of` represents an inclusive OR. For example, if you filter by `Assignee is one of Sidney Jones` and
`Assignee is one of Zhang Wei`, GitLab shows issues where either `Sidney`, `Zhang`, or both of them are assignees.
#### Filter issues by ID
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the **Search** box, type `#` followed by the issue ID. For example, enter filter `#10` to return only issue 10.

### Open issues in a drawer
{{< details >}}
- Offering: GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/464063) in GitLab 17.4 [with a flag](../../../administration/feature_flags/_index.md) named `issues_list_drawer`. Disabled by default.
- In GitLab 17.11 and later, if [the new look for issues](issue_work_items.md) is enabled, this feature is also enabled.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
When this feature is enabled, when you select an issue from the list or issue board, it opens in a drawer.
You can then edit the issue or create comments.
To open the issue in full view:
- Open the issue in a new tab. From the list of issues, either:
- Right-click the issue and open it in a new browser tab.
- Hold <kbd>Cmd</kbd> or <kbd>Ctrl</kbd> and click the issue.
- From the drawer, in the top-left corner, select **Open in full view**.

## Copy issue reference
To refer to an issue elsewhere in GitLab, you can use its full URL or a short reference, which looks like
`namespace/project-name#123`, where `namespace` is either a group or a username.
To copy the issue reference to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, next to **Reference**, select **Copy Reference** ({{< icon name="copy-to-clipboard" >}}).
You can now paste the reference into another description or comment.
Read more about issue references in [GitLab-Flavored Markdown](../../markdown.md#gitlab-specific-references).
## Copy issue email address
You can create a comment in an issue by sending an email.
Sending an email to this address creates a comment that contains the email body.
For more information about creating comments by sending an email and the necessary configuration, see
[Reply to a comment by sending email](../../discussions/_index.md#reply-to-a-comment-by-sending-email).
To copy the issue's email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, next to **Issue email**, select **Copy Reference** ({{< icon name="copy-to-clipboard" >}}).
## Assignees
An issue can be assigned to one or [more users](multiple_assignees_for_issues.md).
The assignees can be changed as often as needed. The idea is that the assignees are
people responsible for the issue.
When an issue is assigned to someone, it appears in their **Assigned issues** page.
If a user is not a member of a project, an issue can only be assigned to them if they create it
themselves or another project member assigns them.
### Change assignee on an issue
{{< history >}}
- Minimum role to change assignee [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To change the assignee on an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Assignee** section, select **Edit**.
1. From the dropdown list, select the user to add as an assignee.
1. Select any area outside the dropdown list.
The assignee is changed without having to refresh the page.
## Similar issues
To prevent duplication of issues on the same topic, GitLab searches for similar issues
when you create a new issue.
As you type in the title text box of the **New issue** page, GitLab searches titles and descriptions
across all issues in the current project. Only issues you have access to are returned.
Up to five similar issues, sorted by most recently updated, are displayed below the title text box.
## Health status
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218618) in GitLab 15.4: health status is visible on issue cards in issue boards.
{{< /history >}}
To better track the risk in meeting your plans, you can assign a health status to each issue.
You can use health status to signal to others in your organization whether issues are progressing
as planned or need attention to stay on schedule.
Incorporate a review of issue health status into your daily stand-up, project status reports, or weekly meetings to address risks to timely delivery of your planned work.
### Change health status of an issue
{{< history >}}
- Minimum role to change health status [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To edit health status of an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Health status** section, select **Edit**.
1. From the dropdown list, select the status to add to this issue:
- On track (green)
- Needs attention (amber)
- At risk (red)
You can see the issue's health status in:
- The **Issues** page
- Epic tree
- Issue cards in issue boards
After an issue is closed, its health status can't be edited and the **Edit** button becomes disabled
until the issue is reopened.
You can also set and clear health statuses using the `/health_status` and `/clear_health_status`
[quick actions](../quick_actions.md#issues-merge-requests-and-epics).
## Status
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../../../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
<!-- Turn off the future tense test because of "won't do". -->
<!-- vale gitlab_base.FutureTense = NO -->
You can assign a status to issues to track their progress through your workflow.
Status provides more granular tracking than the basic open/closed states, so you can use specific
stages like **In progress**, **Done**, or **Won't do**.
For more information about status, including how to configure custom statuses, see [Status](../../work_items/status.md).
<!-- vale gitlab_base.FutureTense = YES -->
### Change status
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To change the status of an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Status** section, select **Edit**.
1. From the dropdown list, select the status.
The issue's status updates immediately.
You can view the issue's status in:
- The **Issues** page
- An epic's **Child items** section
- Cards on issue boards
You can also set the status by using the `/status` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
## Publish an issue
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If a status page application is associated with the project, you can use the `/publish`
[quick action](../quick_actions.md) to publish the issue.
For more information, see [GitLab Status Page](../../../operations/incident_management/status_page.md).
## Issue-related quick actions
You can also use [quick actions](../quick_actions.md#issues-merge-requests-and-epics) to manage issues.
Some actions don't have corresponding UI buttons yet.
You can do the following **only by using quick actions**:
- [Add or remove a Zoom meeting](associate_zoom_meeting.md) (`/zoom` and `/remove_zoom`).
- [Publish an issue](#publish-an-issue) (`/publish`).
- Clone an issue to the same or another project (`/clone`).
- Close an issue and mark as a duplicate of another issue (`/duplicate`).
- Copy labels and milestone from another merge request or issue in the project (`/copy_metadata`).
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Manage issues
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab issues help you track work and collaborate with your team.
You can manage issues to:
- Edit details like title, description, assignees, and metadata.
- Move issues between projects while maintaining their context and history.
- Close completed issues and reopen them if needed.
- Use bulk editing to update multiple issues efficiently.
- Track issue health status to monitor progress and identify risks.
## Edit an issue
{{< history >}}
- Minimum role to edit an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit an issue's title and description.
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To edit an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select the title of your issue to view it.
1. To the right of the title, select **Edit** ({{< icon name="pencil" >}}).
1. Edit the available fields.
1. Select **Save changes**.
### Populate an issue with Issue Description Generation
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com
- Status: Experiment
- LLM: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- Available on GitLab Duo with self-hosted models: Not supported
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10762) in GitLab 16.3 as an [experiment](../../../policy/development_stages_support.md#experiment).
- Changed to require GitLab Duo add-on in GitLab 17.6 and later.
- Changed to include Premium in GitLab 18.0.
{{< /history >}}
Generate a detailed description for an issue based on a short summary you provide.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=-BWBQat7p5M)
<!-- Video published on 2024-12-18 -->
Prerequisites:
- You must belong to at least one group with the [experiment and beta features setting](../../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
- You must have permission to create an issue.
- Only available for the plain text editor.
- Only available when creating a new issue.
For a proposal to add support for generating descriptions when editing existing issues, see
[issue 474141](https://gitlab.com/gitlab-org/gitlab/-/issues/474141).
To generate an issue description:
1. Create a new issue.
1. Above the **Description** field, select **GitLab Duo** ({{< icon name="tanuki-ai" >}}) **> Generate issue description**.
1. Write a short description and select **Submit**.
The issue description is replaced with AI-generated text.
Provide feedback on this experimental feature in [issue 409844](https://gitlab.com/gitlab-org/gitlab/-/issues/409844).
**Data usage**: When you use this feature, the text you enter is sent to
the large language model.
## Bulk edit issues from a project
{{< history >}}
- Minimum role to bulk edit issues from a project [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit multiple issues at a time when you're in a project.
Prerequisites:
- You must have at least the Planner role for the project.
To edit multiple issues at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Select **Bulk edit**. A sidebar on the right of your screen appears.
1. Select the checkboxes next to each issue you want to edit.
1. From the sidebar, edit the available fields.
1. Select **Update selected**.
When bulk editing issues in a project, you can edit the following attributes:
- [Status](../../work_items/status.md)
- State (open or closed)
- [Assignees](managing_issues.md#assignees)
- [Epic](../../group/epics/_index.md)
- [Milestone](../milestones/_index.md)
- [Labels](../labels.md)
- [Health status](#health-status)
- [Notification](../../profile/notifications.md) subscription
- [Iteration](../../group/iterations/_index.md)
- [Confidentiality](confidential_issues.md)
### Bulk edit issues from a group
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to bulk edit issues from a group [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit multiple issues across multiple projects when you're in a group.
Prerequisites:
- You must have at least the Planner role for a group.
To edit multiple issues at the same time:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Plan > Issues**.
1. Select **Bulk edit**. A sidebar on the right of your screen appears.
1. Select the checkboxes next to each issue you want to edit.
1. From the sidebar, edit the available fields.
1. Select **Update selected**.
When bulk editing issues in a group, you can edit the following attributes:
- [Status](../../work_items/status.md)
- [Epic](../../group/epics/_index.md)
- [Milestone](../milestones/_index.md)
- [Iteration](../../group/iterations/_index.md)
- [Labels](../labels.md)
- [Health status](#health-status)
## Move an issue
{{< history >}}
- Minimum role to move an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When you move an issue, it's closed and copied to the target project.
The original issue is not deleted. A [system note](../system_notes.md), which indicates
where it came from and went to, is added to both issues.
Be careful when moving an issue to a project with different access rules. Before moving the issue, make sure it does not contain sensitive data.
Prerequisites:
- You must have at least the Planner role for the project.
To move an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, select **Move issue**.
1. Search for a project to move the issue to.
1. Select **Move**.
You can also use the `/move` [quick action](../quick_actions.md) in a comment or description.
### Moving tasks when the parent issue is moved
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371252) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `move_issue_children`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/371252) in GitLab 16.11.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/371252) in GitLab 17.3. Feature flag `move_issue_children` removed.
{{< /history >}}
When you move an issue to another project, all its child tasks are also moved to the target project
and remain as child tasks of the moved issue.
Each task is moved the same way as the parent, that is, it's closed in the original project and
copied to the target project.
### Bulk move issues
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to bulk move issues [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
#### From the Issues page
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15991) in GitLab 15.6.
{{< /history >}}
You can move multiple issues at the same time when you're in a project.
You can't move tasks or test cases.
Prerequisites:
- You must have at least the Planner role for the project.
To move multiple issues at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Select **Bulk edit**. A sidebar on the right of your screen appears.
1. Select the checkboxes next to each issue you want to move.
1. From the right sidebar, select **Move selected**.
1. From the dropdown list, select the destination project.
1. Select **Move**.
#### From the Rails console
You can move all open issues from one project to another.
Prerequisites:
- You must have access to the Rails console of the GitLab instance.
To do it:
1. Optional (but recommended). [Create a backup](../../../administration/backup_restore/_index.md) before
attempting any changes in the console.
1. Open the [Rails console](../../../administration/operations/rails_console.md).
1. Run the following script. Make sure to change `project`, `admin_user`, and `target_project` to
your values.
```ruby
project = Project.find_by_full_path('full path of the project where issues are moved from')
issues = project.issues
admin_user = User.find_by_username('username of admin user') # make sure user has permissions to move the issues
target_project = Project.find_by_full_path('full path of target project where issues moved to')
issues.each do |issue|
if issue.state != "closed" && issue.moved_to.nil?
Issues::MoveService.new(container: project, current_user: admin_user).execute(issue, target_project)
else
puts "issue with id: #{issue.id} and title: #{issue.title} was not moved"
end
end; nil
```
1. To exit the Rails console, enter `quit`.
## Description lists and task lists
When you use ordered lists, unordered lists, or task lists in issue descriptions, you can:
- Reorder list items with drag and drop
- Delete list items
- [Convert task list items to GitLab Tasks](../../tasks.md#from-a-task-list-item)
### Delete a task list item
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377307) in GitLab 15.9.
{{< /history >}}
Prerequisites:
- You must have at least the Reporter role for the project, or be the author or assignee of the issue.
In an issue description with task list items:
1. Hover over a task list item and select the options menu ({{< icon name="ellipsis_v" >}}).
1. Select **Delete**.
The task list item is removed from the issue description.
Any nested task list items are moved up a nested level.
### Reorder list items in the issue description
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15260) in GitLab 15.0.
- Minimum role to reorder list items in the issue description [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When you view an issue that has a list in the description, you can also reorder the list items.
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be
assigned to the issue.
- The issue's description must have an [ordered, unordered](../../markdown.md#lists), or
[task](../../markdown.md#task-lists) list.
To reorder list items, when viewing an issue:
1. Hover over the list item row to make the grip icon ({{< icon name="grip" >}}) visible.
1. Select and hold the grip icon.
1. Drag the row to the new position in the list.
1. Release the grip icon.
## Close an issue
{{< history >}}
- Minimum role to close an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When you decide that an issue is resolved or no longer needed, you can close it.
The issue is marked as closed but is not deleted.
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To close an issue, you can either:
- In an [issue board](../issue_board.md), drag an issue card from its list into the **Closed** list.
- From any other page in the GitLab UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}) and then **Close issue**.
You can also use the `/close` [quick action](../quick_actions.md) in a comment or description.
### Reopen a closed issue
{{< history >}}
- Minimum role to reopen a closed issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To reopen a closed issue, in the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}) and then **Reopen issue**.
A reopened issue is no different from any other open issue.
You can also use the `/reopen` [quick action](../quick_actions.md) in a comment or description.
### Closing issues automatically
You can close issues automatically by using certain words, called a _closing pattern_,
in a commit message or merge request description. GitLab Self-Managed administrators
can [change the default closing pattern](../../../administration/issue_closing_pattern.md).
If a commit message or merge request description contains text matching the [closing pattern](#default-closing-pattern),
all issues referenced in the matched text are closed when either:
- The commit is pushed to a project's [**default** branch](../repository/branches/default.md).
- The commit or merge request is merged into the default branch.
For example, if you include `Closes #4, #6, Related to #5` in a merge request
description:
- Issues `#4` and `#6` are closed automatically when the MR is merged.
- Issue `#5` is marked as a [related issue](related_issues.md), but it's not closed automatically.
Alternatively, when you [create a merge request from an issue](../merge_requests/creating_merge_requests.md#from-an-issue),
it inherits the issue's milestone and labels.
For performance reasons, automatic issue closing is disabled for the very first
push from an existing repository.
#### User responsibility when merging
When you merge a merge request, it's your responsibility to check that it's appropriate for any targeted issues
to close. Users can include issue closing patterns in the merge request description, and also in the body
of a commit message. Closing messages in commit messages are easy to miss. In both cases, the merge request widget
shows information about the issue to close on merge:

When you merge a merge request, GitLab checks that you have permission to close the targeted issues.
In public repositories, this check is important, because external users can create both merge requests
and commits that contain closing patterns. When you are the user who merges, it's important
that you are aware of the effects the merge has on both the code and issues in your project.
When [auto-merge](../merge_requests/auto_merge.md) is enabled for a merge request, no further changes can be made to
the list of issues that will be automatically closed.
#### Default closing pattern
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/465391) work item (task, objective, or key result) references in GitLab 17.3.
{{< /history >}}
To automatically close an issue, use the following keywords followed by the issue reference.
Available keywords:
- `Close`, `Closes`, `Closed`, `Closing`, `close`, `closes`, `closed`, `closing`
- `Fix`, `Fixes`, `Fixed`, `Fixing`, `fix`, `fixes`, `fixed`, `fixing`
- `Resolve`, `Resolves`, `Resolved`, `Resolving`, `resolve`, `resolves`, `resolved`, `resolving`
- `Implement`, `Implements`, `Implemented`, `Implementing`, `implement`, `implements`, `implemented`, `implementing`
Available issue reference formats:
- A local issue (`#123`).
- A cross-project issue (`group/project#123`).
- The full URL of an issue (`https://gitlab.example.com/<project_full_path>/-/issues/123`).
- The full URL of a work item (for example, task, objective, or key result):
- In a project (`https://gitlab.example.com/<project_full_path>/-/work_items/123`).
- In a group (`https://gitlab.example.com/groups/<group_full_path>/-/work_items/123`).
For example:
```plaintext
Awesome commit message
Fix #20, Fixes #21 and Closes group/otherproject#22.
This commit is also related to #17 and fixes #18, #19
and https://gitlab.example.com/group/otherproject/-/issues/23.
```
The previous commit message closes `#18`, `#19`, `#20`, and `#21` in the project this commit is pushed to,
as well as `#22` and `#23` in `group/otherproject`. `#17` is not closed as it does
not match the pattern.
You can use the closing patterns in multi-line commit messages or one-liners
done from the command line with `git commit -m`.
The default issue closing pattern regex:
```shell
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?: *,? +and +| *,? *)?)|([A-Z][A-Z0-9_]+-\d+))+)
```
#### Disable automatic issue closing
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/240922) in GitLab 15.4: The referenced issue's project setting is checked instead of the project of the commit or merge request.
{{< /history >}}
You can disable the automatic issue closing feature on a per-project basis
in the [project's settings](#disable-automatic-issue-closing).
Prerequisites:
- You must have at least the Maintainer role for the project.
To disable automatic issue closing:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Branch defaults**.
1. Clear the **Auto-close referenced issues on default branch** checkbox.
1. Select **Save changes**.
Referenced issues are still displayed, but are not closed automatically.
Changing this setting applies only to new merge requests or commits. Already
closed issues remain as they are.
Disabling automatic issue closing only applies to issues in the project where the setting was disabled.
Merge requests and commits in this project can still close another project's issues.
#### Customize the issue closing pattern
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Prerequisites:
- You must have [administrator access](../../../administration/_index.md) to your GitLab instance.
Learn how to change the default [issue closing pattern](../../../administration/issue_closing_pattern.md)
of your installation.
## Prevent truncating descriptions with "Read more"
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
If an issue description is long, GitLab displays only part of it.
To see the whole description, you must select **Read more**.
This truncation makes it easier to find other elements on the page without scrolling through lengthy text.
Prerequisites:
- [The new look for issues](issue_work_items.md) must be enabled.
To change whether descriptions are truncated:
1. On an issue, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Toggle **Truncate descriptions** according to your preference.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
## Hide the right sidebar
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
Issue attributes are shown in a sidebar to the right of the description when space allows.
Prerequisites:
- [The new look for issues](issue_work_items.md) must be enabled.
To hide the sidebar and increase space for the description:
1. On an issue, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Hide sidebar**.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
To show the sidebar again:
- Repeat the previous steps and select **Show sidebar**.
## Change the issue type
{{< history >}}
- Minimum role to change the issue type [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must be the issue author or have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To change issue type:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. To the right of the title, select **Edit title and description** ({{< icon name="pencil" >}}).
1. Edit the issue and select an issue type from the **Issue type** dropdown list:
- Issue
- [Incident](../../../operations/incident_management/_index.md)
1. Select **Save changes**.
## Delete an issue
{{< history >}}
- Required role to delete an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Owner to Owner or Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have the Planner or Owner role for a project.
To delete an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Delete issue**.
Alternatively:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select the title of your issue to view it.
1. Select **Edit title and description** ({{< icon name="pencil" >}}).
1. Select **Delete issue**.
## Promote an issue to an epic
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to promote an issue to an epic [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can promote an issue to an [epic](../../group/epics/_index.md) in the immediate parent group.
Promoting a confidential issue to an epic creates a
[confidential epic](../../group/epics/manage_epics.md#make-an-epic-confidential), retaining
confidentiality.
When an issue is promoted to an epic:
- An epic is created in the same group as the project of the issue.
- Subscribers of the issue are notified that the epic was created.
The following issue metadata is copied to the epic:
- Title, description, activity, and comment threads.
- Upvotes and downvotes.
- Participants.
- Group labels that the issue had.
- Parent epic.
Prerequisites:
- The project to which the issue belongs must be in a group.
- You must have at least the Planner role the project's immediate parent group.
- You must either:
- Have at least the Planner role for the project.
- Be the author of the issue.
- Be assigned to the issue.
To promote an issue to an epic:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Promote to epic**.
Alternatively, you can use the `/promote` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
## Promote an issue to an incident
{{< history >}}
- Quick actions to set issue type as incident upon creation [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/376760) in GitLab 15.8.
{{< /history >}}
You can use the `/promote_to_incident` [quick action](../quick_actions.md) to promote the issue to an [incident](../../../operations/incident_management/incidents.md).
## Add an issue to an iteration
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To add an issue to an [iteration](../../group/iterations/_index.md):
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Iteration** section, select **Edit**.
1. From the dropdown list, select the iteration to add this issue to.
1. Select any area outside the dropdown list.
To add an issue to an iteration, you can also:
- Use the `/iteration` [quick action](../quick_actions.md#issues-merge-requests-and-epics)
- Drag an issue into an iteration list in a board
- Bulk edit issues from the issues list
## View all issues assigned to you
To view all issues assigned to you:
1. On the left sidebar, select **Search or go to**.
1. From the dropdown list, select **Issues assigned to me**.
Or:
- To use a [keyboard shortcut](../../shortcuts.md), press <kbd>Shift</kbd> + <kbd>i</kbd>.
- On the left sidebar, at the top, select **Assigned issues** ({{< icon name="issues" >}}).
## Issue list
The issue list shows all issues in your project or group.
You can use it to view, sort, and manage issues.
To view the issue list:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
From the issue list, you can:
- View issue details like title, assignees, labels, and milestone.
- [Sort issues](sorting_issue_lists.md) by various criteria.
- Filter issues to find specific ones.
- Edit issues individually or in bulk.
- Create new issues.
The following sections describe how to work with the issue list.
### Filter the list of issues
{{< history >}}
- Filtering by type was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/322755) in GitLab 13.10 [with a flag](../../../administration/feature_flags/_index.md) named `vue_issues_list`. Disabled by default.
- Filtering by type was [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/322755) in GitLab 14.10.
- Filtering by type is generally available in GitLab 15.1. [Feature flag `vue_issues_list`](https://gitlab.com/gitlab-org/gitlab/-/issues/359966) removed.
- Filtering by health status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218711) in GitLab 15.5.
{{< /history >}}
To filter the list of issues:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Above the list of issues, select **Search or filter results**.
1. In the dropdown list that appears, select the attribute you want to filter by.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
- `=`: Is
- `!=`: Is not one of
1. Enter the text to filter the attribute by.
You can filter some attributes by **None** or **Any**.
1. Repeat this process to filter by multiple attributes. Multiple attributes are joined by a logical
`AND`.
#### Filter by title or description
To filter the list issues for text in a title or description:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Above the list of issues, in the **Search or filter results** text box, enter the searched phrase.
1. In the dropdown list that appears, select **Search within**, and then either **Titles** or **Descriptions**.
1. Press <kbd>Enter</kbd> or select the search icon ({{< icon name="search" >}}).
Filtering issues uses [PostgreSQL full text search](https://www.postgresql.org/docs/16/textsearch-intro.html)
to match meaningful and significant words to answer a query.
For example, if you search for `I am securing information for M&A`,
GitLab can return results with `securing`, `secured`,
or `information` in the title or description.
However, GitLab doesn't match the sentence or the words `I`, `am` or `M&A` exactly,
as they aren't deemed lexically meaningful or significant.
It's a limitation of PostgreSQL full text search.
#### Filter with the OR operator
{{< history >}}
- OR filtering for author and assignee was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23532) in GitLab 15.6 [with a flag](../../../administration/feature_flags/_index.md) named `or_issuable_queries`. Disabled by default.
- OR filtering for label was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23532) in GitLab 15.8 [with a flag](../../../administration/feature_flags/_index.md) named `or_issuable_queries`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104292) in GitLab 15.9.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/296031) in GitLab 17.0. Feature flag `or_issuable_queries` removed.
{{< /history >}}
You can use the OR operator (**is one of: `||`**) when you [filter the list of issues](#filter-the-list-of-issues) by:
- Assignees
- Author
- Labels
`is one of` represents an inclusive OR. For example, if you filter by `Assignee is one of Sidney Jones` and
`Assignee is one of Zhang Wei`, GitLab shows issues where either `Sidney`, `Zhang`, or both of them are assignees.
#### Filter issues by ID
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the **Search** box, type `#` followed by the issue ID. For example, enter filter `#10` to return only issue 10.

### Open issues in a drawer
{{< details >}}
- Offering: GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/464063) in GitLab 17.4 [with a flag](../../../administration/feature_flags/_index.md) named `issues_list_drawer`. Disabled by default.
- In GitLab 17.11 and later, if [the new look for issues](issue_work_items.md) is enabled, this feature is also enabled.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
When this feature is enabled, when you select an issue from the list or issue board, it opens in a drawer.
You can then edit the issue or create comments.
To open the issue in full view:
- Open the issue in a new tab. From the list of issues, either:
- Right-click the issue and open it in a new browser tab.
- Hold <kbd>Cmd</kbd> or <kbd>Ctrl</kbd> and click the issue.
- From the drawer, in the top-left corner, select **Open in full view**.

## Copy issue reference
To refer to an issue elsewhere in GitLab, you can use its full URL or a short reference, which looks like
`namespace/project-name#123`, where `namespace` is either a group or a username.
To copy the issue reference to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, next to **Reference**, select **Copy Reference** ({{< icon name="copy-to-clipboard" >}}).
You can now paste the reference into another description or comment.
Read more about issue references in [GitLab-Flavored Markdown](../../markdown.md#gitlab-specific-references).
## Copy issue email address
You can create a comment in an issue by sending an email.
Sending an email to this address creates a comment that contains the email body.
For more information about creating comments by sending an email and the necessary configuration, see
[Reply to a comment by sending email](../../discussions/_index.md#reply-to-a-comment-by-sending-email).
To copy the issue's email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, next to **Issue email**, select **Copy Reference** ({{< icon name="copy-to-clipboard" >}}).
## Assignees
An issue can be assigned to one or [more users](multiple_assignees_for_issues.md).
The assignees can be changed as often as needed. The idea is that the assignees are
people responsible for the issue.
When an issue is assigned to someone, it appears in their **Assigned issues** page.
If a user is not a member of a project, an issue can only be assigned to them if they create it
themselves or another project member assigns them.
### Change assignee on an issue
{{< history >}}
- Minimum role to change assignee [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To change the assignee on an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Assignee** section, select **Edit**.
1. From the dropdown list, select the user to add as an assignee.
1. Select any area outside the dropdown list.
The assignee is changed without having to refresh the page.
## Similar issues
To prevent duplication of issues on the same topic, GitLab searches for similar issues
when you create a new issue.
As you type in the title text box of the **New issue** page, GitLab searches titles and descriptions
across all issues in the current project. Only issues you have access to are returned.
Up to five similar issues, sorted by most recently updated, are displayed below the title text box.
## Health status
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218618) in GitLab 15.4: health status is visible on issue cards in issue boards.
{{< /history >}}
To better track the risk in meeting your plans, you can assign a health status to each issue.
You can use health status to signal to others in your organization whether issues are progressing
as planned or need attention to stay on schedule.
Incorporate a review of issue health status into your daily stand-up, project status reports, or weekly meetings to address risks to timely delivery of your planned work.
### Change health status of an issue
{{< history >}}
- Minimum role to change health status [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To edit health status of an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Health status** section, select **Edit**.
1. From the dropdown list, select the status to add to this issue:
- On track (green)
- Needs attention (amber)
- At risk (red)
You can see the issue's health status in:
- The **Issues** page
- Epic tree
- Issue cards in issue boards
After an issue is closed, its health status can't be edited and the **Edit** button becomes disabled
until the issue is reopened.
You can also set and clear health statuses using the `/health_status` and `/clear_health_status`
[quick actions](../quick_actions.md#issues-merge-requests-and-epics).
## Status
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../../../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
<!-- Turn off the future tense test because of "won't do". -->
<!-- vale gitlab_base.FutureTense = NO -->
You can assign a status to issues to track their progress through your workflow.
Status provides more granular tracking than the basic open/closed states, so you can use specific
stages like **In progress**, **Done**, or **Won't do**.
For more information about status, including how to configure custom statuses, see [Status](../../work_items/status.md).
<!-- vale gitlab_base.FutureTense = YES -->
### Change status
Prerequisites:
- You must have at least the Planner role for the project, be the author of the issue, or be assigned to the issue.
To change the status of an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. On the right sidebar, in the **Status** section, select **Edit**.
1. From the dropdown list, select the status.
The issue's status updates immediately.
You can view the issue's status in:
- The **Issues** page
- An epic's **Child items** section
- Cards on issue boards
You can also set the status by using the `/status` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
## Publish an issue
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If a status page application is associated with the project, you can use the `/publish`
[quick action](../quick_actions.md) to publish the issue.
For more information, see [GitLab Status Page](../../../operations/incident_management/status_page.md).
## Issue-related quick actions
You can also use [quick actions](../quick_actions.md#issues-merge-requests-and-epics) to manage issues.
Some actions don't have corresponding UI buttons yet.
You can do the following **only by using quick actions**:
- [Add or remove a Zoom meeting](associate_zoom_meeting.md) (`/zoom` and `/remove_zoom`).
- [Publish an issue](#publish-an-issue) (`/publish`).
- Clone an issue to the same or another project (`/clone`).
- Close an issue and mark as a duplicate of another issue (`/duplicate`).
- Copy labels and milestone from another merge request or issue in the project (`/copy_metadata`).
|
https://docs.gitlab.com/user/project/issue_weight
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/issue_weight.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
issue_weight.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Issue weight
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Moved to GitLab Premium in 13.9.
{{< /history >}}
When you have a lot of issues, it can be hard to get an overview.
With weighted issues, you can get a better idea of how much time,
value, or complexity a given issue has or costs. You can also [sort by weight](sorting_issue_lists.md#sorting-by-weight)
to see which issues need to be prioritized.
## View the issue weight
You can view the issue weight on:
- The right sidebar of each issue.
- The issues page, next to a weight icon ({{< icon name="weight" >}}).
- [Issue boards](../issue_board.md), next to a weight icon ({{< icon name="weight" >}}).
- The [milestone](../milestones/_index.md) page, as a total sum of issue weights.
## Set the issue weight
{{< history >}}
- Minimum role to set issue weight [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
You can set the issue weight when you create or edit an issue.
You must enter whole, positive numbers.
When you change the weight of an issue, the new value overwrites the previous value.
### When you create an issue
To set the issue weight when you [create an issue](create_issues.md), enter a
number under **Weight**.
### From an existing issue
To set the issue weight from an existing issue:
1. Go to the issue.
1. On the right sidebar, in the **Weight** section, select **Edit**.
1. Enter the new weight.
1. Select any area outside the dropdown list.
### From an issue board
To set the issue weight when you [edit an issue from an issue board](../issue_board.md#edit-an-issue):
1. Go to your issue board.
1. Select an issue card (not its title).
1. On the right sidebar, in the **Weight** section, select **Edit**.
1. Enter the new weight.
1. Select any area outside the dropdown list.
## Remove issue weight
{{< history >}}
- Minimum role to remove issue weight [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To remove the issue weight, follow the same steps as when you [set the issue weight](#set-the-issue-weight),
and select **remove weight**.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Issue weight
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Moved to GitLab Premium in 13.9.
{{< /history >}}
When you have a lot of issues, it can be hard to get an overview.
With weighted issues, you can get a better idea of how much time,
value, or complexity a given issue has or costs. You can also [sort by weight](sorting_issue_lists.md#sorting-by-weight)
to see which issues need to be prioritized.
## View the issue weight
You can view the issue weight on:
- The right sidebar of each issue.
- The issues page, next to a weight icon ({{< icon name="weight" >}}).
- [Issue boards](../issue_board.md), next to a weight icon ({{< icon name="weight" >}}).
- The [milestone](../milestones/_index.md) page, as a total sum of issue weights.
## Set the issue weight
{{< history >}}
- Minimum role to set issue weight [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
You can set the issue weight when you create or edit an issue.
You must enter whole, positive numbers.
When you change the weight of an issue, the new value overwrites the previous value.
### When you create an issue
To set the issue weight when you [create an issue](create_issues.md), enter a
number under **Weight**.
### From an existing issue
To set the issue weight from an existing issue:
1. Go to the issue.
1. On the right sidebar, in the **Weight** section, select **Edit**.
1. Enter the new weight.
1. Select any area outside the dropdown list.
### From an issue board
To set the issue weight when you [edit an issue from an issue board](../issue_board.md#edit-an-issue):
1. Go to your issue board.
1. Select an issue card (not its title).
1. On the right sidebar, in the **Weight** section, select **Edit**.
1. Enter the new weight.
1. Select any area outside the dropdown list.
## Remove issue weight
{{< history >}}
- Minimum role to remove issue weight [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To remove the issue weight, follow the same steps as when you [set the issue weight](#set-the-issue-weight),
and select **remove weight**.
|
https://docs.gitlab.com/user/project/sorting_issue_lists
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/sorting_issue_lists.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
sorting_issue_lists.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Sorting and ordering issue lists
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can sort a list of issues several ways.
The available sorting options can change based on the context of the list.
## Sorting by blocking issues
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you sort by **Blocking**, the issue list changes to sort descending by the
number of issues each issue is [blocking](related_issues.md#blocking-issues).
## Sorting by created date
When you sort by **Created date**, the issue list changes to sort descending by the issue
creation date. Issues created most recently are first.
## Sorting by due date
When you sort by **Due date**, the issue list changes to sort ascending by the issue
[due date](due_dates.md). Issues with the earliest due date are first,
and issues without a due date are last.
## Sorting by label priority
When you sort by **Label priority**, the issue list changes to sort descending.
Issues with the highest priority label are first, then all other issues.
Ties are broken arbitrarily. Only the highest prioritized label is checked,
and labels with a lower priority are ignored.
For more information, see [issue 14523](https://gitlab.com/gitlab-org/gitlab/-/issues/14523).
To learn how to change label priority, see [Label priority](../labels.md#set-label-priority).
## Sorting by updated date
When you sort by **Updated date**, the issue list changes to sort by the time of a last
update. Issues changed the most recently are shown first.
## Manual sorting
When you sort by **Manual** order, you can change
the order by dragging and dropping the issues. The changed order persists, and
everyone who visits the same list sees the updated issue order, with some exceptions.
Each issue is assigned a relative order value, representing its relative
order with respect to the other issues on the list. When you drag-and-drop reorder
an issue, its relative order value changes.
In addition, any time an issue appears in a manually sorted list,
the updated relative order value is used for the ordering.
So, if anyone drags issue `A` above issue `B` in your GitLab instance,
this ordering is maintained whenever they appear together in any list.
This ordering also affects [issue boards](../issue_board.md#ordering-issues-in-a-list).
Changing the order in an issue list changes the ordering in an issue board,
and the other way around.
## Sorting by milestone due date
When you sort by **Milestone due date**, the issue list changes to sort ascending by the
assigned milestone due date. Issues with milestones with the earliest due date are first,
then issues with a milestone without a due date.
## Sorting by popularity
When you sort by **Popularity**, the issue order changes to sort descending by the
number of upvotes ([emoji reactions](../../emoji_reactions.md) with the "thumbs up")
on each issue. You can use this to identify issues that are in high demand.
The total number of votes is not summed up. An issue with 18 upvotes and 5
downvotes is considered more popular than an issue with 17 upvotes and no
downvotes.
## Sorting by priority
When you sort by **Priority**, the issue order changes to sort in this order:
1. Issues with milestones that have due dates, where the soonest assigned milestone is listed first.
1. Issues with milestones with no due dates.
1. Issues with a higher priority label.
1. Issues without a prioritized label.
Ties are broken arbitrarily.
To learn how to change label priority, see [Label priority](../labels.md#set-label-priority).
## Sorting by title
When you sort by **Title**, the issue order changes to sort alphabetically by the issue
title in this order:
- Emoji
- Special characters
- Numbers
- Letters: first Latin, then accented (for example, `ö`)
## Sorting by health status
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377841) in GitLab 15.7.
{{< /history >}}
When you sort by **Health**, the issue list changes to sort by the
[health status](managing_issues.md#health-status) of the issues
When in descending order, the issues are shown in the following order:
1. **At risk** issues
1. **Needs attention** issues
1. **On track** issues
1. All other issues
## Sorting by weight
When you sort by **Weight**, the issue list changes to sort ascending by the
[issue weight](issue_weight.md).
Issues with lowest weight are first, and issues without a weight are last.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Sorting and ordering issue lists
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can sort a list of issues several ways.
The available sorting options can change based on the context of the list.
## Sorting by blocking issues
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you sort by **Blocking**, the issue list changes to sort descending by the
number of issues each issue is [blocking](related_issues.md#blocking-issues).
## Sorting by created date
When you sort by **Created date**, the issue list changes to sort descending by the issue
creation date. Issues created most recently are first.
## Sorting by due date
When you sort by **Due date**, the issue list changes to sort ascending by the issue
[due date](due_dates.md). Issues with the earliest due date are first,
and issues without a due date are last.
## Sorting by label priority
When you sort by **Label priority**, the issue list changes to sort descending.
Issues with the highest priority label are first, then all other issues.
Ties are broken arbitrarily. Only the highest prioritized label is checked,
and labels with a lower priority are ignored.
For more information, see [issue 14523](https://gitlab.com/gitlab-org/gitlab/-/issues/14523).
To learn how to change label priority, see [Label priority](../labels.md#set-label-priority).
## Sorting by updated date
When you sort by **Updated date**, the issue list changes to sort by the time of a last
update. Issues changed the most recently are shown first.
## Manual sorting
When you sort by **Manual** order, you can change
the order by dragging and dropping the issues. The changed order persists, and
everyone who visits the same list sees the updated issue order, with some exceptions.
Each issue is assigned a relative order value, representing its relative
order with respect to the other issues on the list. When you drag-and-drop reorder
an issue, its relative order value changes.
In addition, any time an issue appears in a manually sorted list,
the updated relative order value is used for the ordering.
So, if anyone drags issue `A` above issue `B` in your GitLab instance,
this ordering is maintained whenever they appear together in any list.
This ordering also affects [issue boards](../issue_board.md#ordering-issues-in-a-list).
Changing the order in an issue list changes the ordering in an issue board,
and the other way around.
## Sorting by milestone due date
When you sort by **Milestone due date**, the issue list changes to sort ascending by the
assigned milestone due date. Issues with milestones with the earliest due date are first,
then issues with a milestone without a due date.
## Sorting by popularity
When you sort by **Popularity**, the issue order changes to sort descending by the
number of upvotes ([emoji reactions](../../emoji_reactions.md) with the "thumbs up")
on each issue. You can use this to identify issues that are in high demand.
The total number of votes is not summed up. An issue with 18 upvotes and 5
downvotes is considered more popular than an issue with 17 upvotes and no
downvotes.
## Sorting by priority
When you sort by **Priority**, the issue order changes to sort in this order:
1. Issues with milestones that have due dates, where the soonest assigned milestone is listed first.
1. Issues with milestones with no due dates.
1. Issues with a higher priority label.
1. Issues without a prioritized label.
Ties are broken arbitrarily.
To learn how to change label priority, see [Label priority](../labels.md#set-label-priority).
## Sorting by title
When you sort by **Title**, the issue order changes to sort alphabetically by the issue
title in this order:
- Emoji
- Special characters
- Numbers
- Letters: first Latin, then accented (for example, `ö`)
## Sorting by health status
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377841) in GitLab 15.7.
{{< /history >}}
When you sort by **Health**, the issue list changes to sort by the
[health status](managing_issues.md#health-status) of the issues
When in descending order, the issues are shown in the following order:
1. **At risk** issues
1. **Needs attention** issues
1. **On track** issues
1. All other issues
## Sorting by weight
When you sort by **Weight**, the issue list changes to sort ascending by the
[issue weight](issue_weight.md).
Issues with lowest weight are first, and issues without a weight are last.
|
https://docs.gitlab.com/user/project/design_management
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/design_management.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
design_management.md
|
Plan
|
Product Planning
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Design management
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With Design Management you can upload design assets (including wireframes and mockups)
to GitLab issues and keep them stored in a single place. Product designers, product managers, and
engineers can collaborate on designs with a single source of truth.
You can share mockups of designs with your team, or visual regressions can be
viewed and addressed.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a video overview, see [Design Management](https://www.youtube.com/watch?v=CCMtCqdK_aM).
<!-- Video published on 2019-07-11 -->
## Prerequisites
- [Git Large File Storage (LFS)](../../../topics/git/lfs/_index.md) must be enabled:
- On GitLab.com, LFS is already enabled.
- On GitLab Self-Managed instances, a GitLab administrator must
[enable LFS globally](../../../administration/lfs/_index.md).
- On both GitLab.com and GitLab Self-Managed instances, LFS must be
[enabled for the project itself](../settings/_index.md#configure-project-features-and-permissions).
If enabled globally, LFS is enabled by default for all projects. If you have
disabled it for your project, you must enable it again.
Designs are stored as LFS objects.
Image thumbnails are stored as other uploads, and are not associated with a project but rather
with a specific design model.
A GitLab administrator can verify the relative path of a hashed-stored project by going to **Admin area > Projects**
and then selecting the project in question. The **Relative path** field contains `@hashed` in its value.
If the requirements are not met, you are notified in the **Designs** section.
## Supported file types
You can upload files of the following types as designs:
- BMP
- GIF
- ICO
- JPEG
- JPG
- PNG
- TIFF
- WEBP
Support for PDF files is tracked in [issue 32811](https://gitlab.com/gitlab-org/gitlab/-/issues/32811).
## View a design
The **Designs** section is in the issue description.
Prerequisites:
- You must have at least the Guest role for the project.
To view a design:
1. Go to an issue.
1. In the **Designs** section, select the design image you want to view.
The design you selected opens. You can then [zoom in](#zoom-in-on-a-design) on it or
[create a comment](#add-a-comment-to-a-design).

When viewing a design, you can move to other designs. To do so, either:
- In the upper-right corner, select **Go to previous design** ({{< icon name="chevron-lg-left" >}}) or **Go to next design** ({{< icon name="chevron-lg-right" >}}).
- Press <kbd>Left</kbd> or <kbd>Right</kbd> on your keyboard.
To return to the issue view, either:
- In the upper-left corner, select the close icon ({{< icon name="close" >}}).
- Press <kbd>Esc</kbd> on your keyboard.
When a design is added, a green icon ({{< icon name="plus-square" >}}) is displayed on the image
thumbnail. When a design has been [changed](#add-a-new-version-of-a-design) in the current version,
a blue icon ({{< icon name="file-modified-solid" >}}) is displayed.
### Zoom in on a design
You can explore a design in more detail by zooming in and out of the image:
- To control the amount of zoom, select plus (`+`) and minus (`-`)
at the bottom of the image.
- To reset the zoom level, select the redo icon ({{< icon name="redo" >}}).
To move around the image while zoomed in, drag the image.
## Add a design to an issue
{{< history >}}
- Ability to edit the description [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388449) in GitLab 16.1.
- Minimum role to add a design to an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147053) from Developer to Reporter in GitLab 16.11.
- Minimum role to add a design to an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
- The names of the uploaded files must be no longer than 255 characters.
To add a design to an issue:
1. Go to an issue.
1. Either:
- Select **Upload designs** and then select images from your file browser. You can select up to
10 files at once.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
- Select **click to upload** and then select images from your file browser. You can select up to
10 files at once.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
- Drag a file from your file browser and drop it in the drop zone in the **Designs** section.

- Take a screenshot or copy a local image file into your clipboard, hover your cursor over the
drop zone, and press <kbd>Control</kbd> or <kbd>Cmd</kbd> + <kbd>V</kbd>.
When pasting images like this, keep the following in mind:
- You can paste only one image at a time. When you paste multiple copied files, only the first
one is uploaded.
- If you are pasting a screenshot, the image is added as a PNG file with a generated name of:
`design_<timestamp>.png`.
- It's not supported in Internet Explorer.
## Add a new version of a design
{{< history >}}
- Minimum role to add a new version of a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147053) from Developer to Reporter in GitLab 16.11.
- Minimum role to add a new version of a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
As discussion on a design continues, you might want to upload a new version of a design.
Prerequisites:
- You must have at least the Planner role for the project.
To do so, [add a design](#add-a-design-to-an-issue) with the same filename.
To browse all the design versions, use the dropdown list at the top of the **Designs** section.
It's shown as either **Showing latest version** or **Showing version #N**.
### Skipped designs
When you upload an image with the same filename as an existing uploaded design and that is the
same, it's skipped. This means that no new version of the design is created.
When designs are skipped, a warning message is displayed.
## Archive a design
{{< history >}}
- Minimum role to archive a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147053) from Developer to Reporter in GitLab 16.11.
- Minimum role to archive a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can archive individual designs or select a few of them to archive at once.
Archived designs are not permanently lost.
You can browse [previous versions](#add-a-new-version-of-a-design).
When you archive a design, its URL changes.
If the design isn't available in the latest version, you can link to it only with the version in the
URL.
Prerequisites:
- You must have at least the Planner role for the project.
- You can archive only the latest version of a design.
To archive a single design:
1. Select the design to view it enlarged.
1. In the upper-right corner, select **Archive design** ({{< icon name="archive" >}}).
1. Select **Archive designs**.
To archive multiple designs at once:
1. Select the checkboxes on the designs you want to archive.
1. Select **Archive selected**.
## Design management data persistence
- Design Management data is not deleted when:
- [A project is destroyed](https://gitlab.com/gitlab-org/gitlab/-/issues/13429).
- [An issue is deleted](https://gitlab.com/gitlab-org/gitlab/-/issues/13427).
### Replicate design management data
Design Management data [can be replicated](../../../administration/geo/replication/datatypes.md#replicated-data-types)
and in GitLab 16.1 and later it can be [verified by Geo as well](https://gitlab.com/gitlab-org/gitlab/-/issues/355660).
## Markdown and rich text editors for descriptions
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388449) in GitLab 16.1 [with a flag](../../../administration/feature_flags/_index.md) named `content_editor_on_issues`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/375172) in GitLab 16.2.
- Feature flag `content_editor_on_issues` removed in GitLab 16.5.
{{< /history >}}
You can use the Markdown and rich text editor in design descriptions.
It's the same editor you use for comments across GitLab.
## Reorder designs
You can change the order of designs by dragging them to a new position.
## Add a comment to a design
You can start [discussions](../../discussions/_index.md) on uploaded designs. To do so:
1. Go to an issue.
1. Select the design.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
<!-- Disable Vale so it doesn't catch "click" -->
1. Click or tap the image. A pin is created in that spot, identifying the discussion's location.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Enter your message.
1. Select **Comment**.
You can adjust a pin's position by dragging it around the image.
Use this when your design's layout has changed, or to move a pin so you can add a new one in
its place.
New discussion threads get different pin numbers, which you can use to refer to them.
New discussions are output to the issue activity,
so that everyone involved can participate in the discussion.
## Delete a comment from a design
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385100) in GitLab 15.9.
- Minimum role to delete comment from a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To delete a comment from a design:
1. On the comment you want to delete, select **More actions** {{< icon name="ellipsis_v" >}} **> Delete comment**.
1. On the confirmation dialog, select **Delete comment**.
## Resolve a discussion thread on a design
When you're done discussing part of a design, you can resolve the discussion thread.
To mark a thread as resolved or open, either:
- In the upper-right corner of the first comment of the discussion, select **Resolve thread** or **Reopen thread** ({{< icon name="check-circle" >}}).
- Add a new comment to the thread and select or clear the **Resolve thread** checkbox.
Resolving a discussion thread also marks any pending [to-do items](../../todos.md) related to notes
inside the thread as done. Only to-do items for the user triggering the action are affected.
Your resolved comment pins disappear from the design to free up space for new discussions.
To revisit a resolved discussion, expand **Resolved Comments** below the visible threads.
## Add a to-do item for a design
To add a [to-do item](../../todos.md) for a design, select **Add a to-do item** on the design sidebar.
## Refer to a design in Markdown
You can refer to a design in a [Markdown](../../markdown.md) text box.
Paste the raw URL of the design in a comment or description.
It's then displayed as a short reference.
For example, if you refer to a design as:
```markdown
See https://gitlab.com/gitlab-org/gitlab/-/issues/13195/designs/Group_view.png.
```
GitLab automatically renders raw URLs as an abbreviated [reference](../../markdown.md#gitlab-specific-references):
> See [#13195[Group_view.png]](https://gitlab.com/gitlab-org/gitlab/-/issues/13195/designs/Group_view.png).
Linking to an image differs from [embedding the image](../../markdown.md#images) in a comment or description.
It's not possible to embed a design this way.
## Design activity records
User activity events on designs (creation, deletion, and updates) are tracked by GitLab and
displayed on the [user profile](../../profile/_index.md#access-your-user-profile),
[group](../../group/manage.md#view-group-activity),
and [project](../working_with_projects.md#view-project-activity) activity pages.
## GitLab-Figma plugin
You can use the GitLab-Figma plugin to upload your designs from Figma directly to your issues
in GitLab.
To use the plugin in Figma, install it from the [Figma Directory](https://www.figma.com/community/plugin/860845891704482356/gitlab)
and connect to GitLab through a personal access token.
For more information, see the [plugin documentation](https://gitlab.com/gitlab-org/gitlab-figma-plugin/-/wikis/home).
## Troubleshooting
When working with Design Management, you might encounter the following issues.
### Could not find design
You might get an error that states `Could not find design`.
This issue occurs when a design has been [archived](#archive-a-design),
so it's not available in the latest version, and the link you've followed doesn't specify a version.
When you archive a design, its URL changes.
If the design isn't available in the latest version, it can be linked to only with the version in the URL.
For example, `https://gitlab.example.com/mygroup/myproject/-/issues/123456/designs/menu.png?version=503554`.
You can no longer access `menu.png` with `https://gitlab.example.com/mygroup/myproject/-/issues/123456/designs/menu.png`.
The workaround is to select one of the previous versions from the dropdown list at the top of the
**Designs** section.
It's shown as either **Showing latest version** or **Showing version #N**.
Issue [392540](https://gitlab.com/gitlab-org/gitlab/-/issues/392540) tracks improving this behavior.
|
---
stage: Plan
group: Product Planning
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Design management
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With Design Management you can upload design assets (including wireframes and mockups)
to GitLab issues and keep them stored in a single place. Product designers, product managers, and
engineers can collaborate on designs with a single source of truth.
You can share mockups of designs with your team, or visual regressions can be
viewed and addressed.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a video overview, see [Design Management](https://www.youtube.com/watch?v=CCMtCqdK_aM).
<!-- Video published on 2019-07-11 -->
## Prerequisites
- [Git Large File Storage (LFS)](../../../topics/git/lfs/_index.md) must be enabled:
- On GitLab.com, LFS is already enabled.
- On GitLab Self-Managed instances, a GitLab administrator must
[enable LFS globally](../../../administration/lfs/_index.md).
- On both GitLab.com and GitLab Self-Managed instances, LFS must be
[enabled for the project itself](../settings/_index.md#configure-project-features-and-permissions).
If enabled globally, LFS is enabled by default for all projects. If you have
disabled it for your project, you must enable it again.
Designs are stored as LFS objects.
Image thumbnails are stored as other uploads, and are not associated with a project but rather
with a specific design model.
A GitLab administrator can verify the relative path of a hashed-stored project by going to **Admin area > Projects**
and then selecting the project in question. The **Relative path** field contains `@hashed` in its value.
If the requirements are not met, you are notified in the **Designs** section.
## Supported file types
You can upload files of the following types as designs:
- BMP
- GIF
- ICO
- JPEG
- JPG
- PNG
- TIFF
- WEBP
Support for PDF files is tracked in [issue 32811](https://gitlab.com/gitlab-org/gitlab/-/issues/32811).
## View a design
The **Designs** section is in the issue description.
Prerequisites:
- You must have at least the Guest role for the project.
To view a design:
1. Go to an issue.
1. In the **Designs** section, select the design image you want to view.
The design you selected opens. You can then [zoom in](#zoom-in-on-a-design) on it or
[create a comment](#add-a-comment-to-a-design).

When viewing a design, you can move to other designs. To do so, either:
- In the upper-right corner, select **Go to previous design** ({{< icon name="chevron-lg-left" >}}) or **Go to next design** ({{< icon name="chevron-lg-right" >}}).
- Press <kbd>Left</kbd> or <kbd>Right</kbd> on your keyboard.
To return to the issue view, either:
- In the upper-left corner, select the close icon ({{< icon name="close" >}}).
- Press <kbd>Esc</kbd> on your keyboard.
When a design is added, a green icon ({{< icon name="plus-square" >}}) is displayed on the image
thumbnail. When a design has been [changed](#add-a-new-version-of-a-design) in the current version,
a blue icon ({{< icon name="file-modified-solid" >}}) is displayed.
### Zoom in on a design
You can explore a design in more detail by zooming in and out of the image:
- To control the amount of zoom, select plus (`+`) and minus (`-`)
at the bottom of the image.
- To reset the zoom level, select the redo icon ({{< icon name="redo" >}}).
To move around the image while zoomed in, drag the image.
## Add a design to an issue
{{< history >}}
- Ability to edit the description [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388449) in GitLab 16.1.
- Minimum role to add a design to an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147053) from Developer to Reporter in GitLab 16.11.
- Minimum role to add a design to an issue [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
- The names of the uploaded files must be no longer than 255 characters.
To add a design to an issue:
1. Go to an issue.
1. Either:
- Select **Upload designs** and then select images from your file browser. You can select up to
10 files at once.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
- Select **click to upload** and then select images from your file browser. You can select up to
10 files at once.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
- Drag a file from your file browser and drop it in the drop zone in the **Designs** section.

- Take a screenshot or copy a local image file into your clipboard, hover your cursor over the
drop zone, and press <kbd>Control</kbd> or <kbd>Cmd</kbd> + <kbd>V</kbd>.
When pasting images like this, keep the following in mind:
- You can paste only one image at a time. When you paste multiple copied files, only the first
one is uploaded.
- If you are pasting a screenshot, the image is added as a PNG file with a generated name of:
`design_<timestamp>.png`.
- It's not supported in Internet Explorer.
## Add a new version of a design
{{< history >}}
- Minimum role to add a new version of a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147053) from Developer to Reporter in GitLab 16.11.
- Minimum role to add a new version of a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
As discussion on a design continues, you might want to upload a new version of a design.
Prerequisites:
- You must have at least the Planner role for the project.
To do so, [add a design](#add-a-design-to-an-issue) with the same filename.
To browse all the design versions, use the dropdown list at the top of the **Designs** section.
It's shown as either **Showing latest version** or **Showing version #N**.
### Skipped designs
When you upload an image with the same filename as an existing uploaded design and that is the
same, it's skipped. This means that no new version of the design is created.
When designs are skipped, a warning message is displayed.
## Archive a design
{{< history >}}
- Minimum role to archive a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147053) from Developer to Reporter in GitLab 16.11.
- Minimum role to archive a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can archive individual designs or select a few of them to archive at once.
Archived designs are not permanently lost.
You can browse [previous versions](#add-a-new-version-of-a-design).
When you archive a design, its URL changes.
If the design isn't available in the latest version, you can link to it only with the version in the
URL.
Prerequisites:
- You must have at least the Planner role for the project.
- You can archive only the latest version of a design.
To archive a single design:
1. Select the design to view it enlarged.
1. In the upper-right corner, select **Archive design** ({{< icon name="archive" >}}).
1. Select **Archive designs**.
To archive multiple designs at once:
1. Select the checkboxes on the designs you want to archive.
1. Select **Archive selected**.
## Design management data persistence
- Design Management data is not deleted when:
- [A project is destroyed](https://gitlab.com/gitlab-org/gitlab/-/issues/13429).
- [An issue is deleted](https://gitlab.com/gitlab-org/gitlab/-/issues/13427).
### Replicate design management data
Design Management data [can be replicated](../../../administration/geo/replication/datatypes.md#replicated-data-types)
and in GitLab 16.1 and later it can be [verified by Geo as well](https://gitlab.com/gitlab-org/gitlab/-/issues/355660).
## Markdown and rich text editors for descriptions
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388449) in GitLab 16.1 [with a flag](../../../administration/feature_flags/_index.md) named `content_editor_on_issues`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/375172) in GitLab 16.2.
- Feature flag `content_editor_on_issues` removed in GitLab 16.5.
{{< /history >}}
You can use the Markdown and rich text editor in design descriptions.
It's the same editor you use for comments across GitLab.
## Reorder designs
You can change the order of designs by dragging them to a new position.
## Add a comment to a design
You can start [discussions](../../discussions/_index.md) on uploaded designs. To do so:
1. Go to an issue.
1. Select the design.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
<!-- Disable Vale so it doesn't catch "click" -->
1. Click or tap the image. A pin is created in that spot, identifying the discussion's location.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Enter your message.
1. Select **Comment**.
You can adjust a pin's position by dragging it around the image.
Use this when your design's layout has changed, or to move a pin so you can add a new one in
its place.
New discussion threads get different pin numbers, which you can use to refer to them.
New discussions are output to the issue activity,
so that everyone involved can participate in the discussion.
## Delete a comment from a design
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385100) in GitLab 15.9.
- Minimum role to delete comment from a design [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To delete a comment from a design:
1. On the comment you want to delete, select **More actions** {{< icon name="ellipsis_v" >}} **> Delete comment**.
1. On the confirmation dialog, select **Delete comment**.
## Resolve a discussion thread on a design
When you're done discussing part of a design, you can resolve the discussion thread.
To mark a thread as resolved or open, either:
- In the upper-right corner of the first comment of the discussion, select **Resolve thread** or **Reopen thread** ({{< icon name="check-circle" >}}).
- Add a new comment to the thread and select or clear the **Resolve thread** checkbox.
Resolving a discussion thread also marks any pending [to-do items](../../todos.md) related to notes
inside the thread as done. Only to-do items for the user triggering the action are affected.
Your resolved comment pins disappear from the design to free up space for new discussions.
To revisit a resolved discussion, expand **Resolved Comments** below the visible threads.
## Add a to-do item for a design
To add a [to-do item](../../todos.md) for a design, select **Add a to-do item** on the design sidebar.
## Refer to a design in Markdown
You can refer to a design in a [Markdown](../../markdown.md) text box.
Paste the raw URL of the design in a comment or description.
It's then displayed as a short reference.
For example, if you refer to a design as:
```markdown
See https://gitlab.com/gitlab-org/gitlab/-/issues/13195/designs/Group_view.png.
```
GitLab automatically renders raw URLs as an abbreviated [reference](../../markdown.md#gitlab-specific-references):
> See [#13195[Group_view.png]](https://gitlab.com/gitlab-org/gitlab/-/issues/13195/designs/Group_view.png).
Linking to an image differs from [embedding the image](../../markdown.md#images) in a comment or description.
It's not possible to embed a design this way.
## Design activity records
User activity events on designs (creation, deletion, and updates) are tracked by GitLab and
displayed on the [user profile](../../profile/_index.md#access-your-user-profile),
[group](../../group/manage.md#view-group-activity),
and [project](../working_with_projects.md#view-project-activity) activity pages.
## GitLab-Figma plugin
You can use the GitLab-Figma plugin to upload your designs from Figma directly to your issues
in GitLab.
To use the plugin in Figma, install it from the [Figma Directory](https://www.figma.com/community/plugin/860845891704482356/gitlab)
and connect to GitLab through a personal access token.
For more information, see the [plugin documentation](https://gitlab.com/gitlab-org/gitlab-figma-plugin/-/wikis/home).
## Troubleshooting
When working with Design Management, you might encounter the following issues.
### Could not find design
You might get an error that states `Could not find design`.
This issue occurs when a design has been [archived](#archive-a-design),
so it's not available in the latest version, and the link you've followed doesn't specify a version.
When you archive a design, its URL changes.
If the design isn't available in the latest version, it can be linked to only with the version in the URL.
For example, `https://gitlab.example.com/mygroup/myproject/-/issues/123456/designs/menu.png?version=503554`.
You can no longer access `menu.png` with `https://gitlab.example.com/mygroup/myproject/-/issues/123456/designs/menu.png`.
The workaround is to select one of the previous versions from the dropdown list at the top of the
**Designs** section.
It's shown as either **Showing latest version** or **Showing version #N**.
Issue [392540](https://gitlab.com/gitlab-org/gitlab/-/issues/392540) tracks improving this behavior.
|
https://docs.gitlab.com/user/project/csv_export
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/csv_export.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
csv_export.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Export issues to CSV
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can export issues from GitLab to a plain-text CSV
([comma-separated values](https://en.wikipedia.org/wiki/Comma-separated_values))
file. The CSV file is attached to an email, and sent to your default
notification email address.
<!-- vale gitlab_base.Spelling = NO -->
CSV files can be used with any plotter or spreadsheet-based program, like
Microsoft Excel, OpenOffice Calc, or Google Sheets. Use a CSV list of issues to:
<!-- vale gitlab_base.Spelling = YES -->
- Create a snapshot of issues for offline analysis, or to share with other
teams who might not be in GitLab.
- Create diagrams, graphs, and charts from the CSV data.
- Convert the data to other formats for auditing or sharing.
- Import the issues to a system outside of GitLab.
- Analyze long-term trends with multiple snapshots created over time.
- Use the long-term data to gather relevant feedback given in the issues, and
improve your product based on real metrics.
## Select issues to export
You can export issues from individual projects, but not groups.
Prerequisites:
- You must have at least the Guest role.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Above the list of issues, select **Search or filter results**.
1. In the dropdown list that appears, select the attributes to filter by.
For more information about filter options, see
[Filter the list of issues](managing_issues.md#filter-the-list-of-issues).
1. In the upper right, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Export as CSV**.
1. In the dialog, verify that the email address is correct, then select **Export issues**.
All matching issues are exported, including those not shown on the first page.
The exported CSV does not contain attachments from issues.
## Format
The CSV file has this format:
- Sort is by title.
- Columns are delimited with commas.
- Fields are quoted with double quotes (`"`) if needed.
- Newline characters separate rows.
{{< alert type="note" >}}
For information about CSV parsing requirements that can affect how exported files display when viewed
in GitLab, see [CSV parsing considerations](../repository/files/csv.md#csv-parsing-considerations).
{{< /alert >}}
## Columns
The following columns are included in the CSV file.
| Column | Description |
|-------------------|-------------|
| Title | Issue `title` |
| Description | Issue `description` |
| Issue ID | Issue `iid` |
| URL | A link to the issue on GitLab |
| State | `Open` or `Closed` |
| Author | Full name of the issue author |
| Author Username | Username of the author, with the `@` symbol omitted |
| Assignee | Full name of the issue assignee |
| Assignee Username | Username of the author, with the `@` symbol omitted |
| Confidential | `Yes` or `No` |
| Locked | `Yes` or `No` |
| Due Date | Formatted as `YYYY-MM-DD` |
| Created At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Updated At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Closed At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Milestone | Title of the issue milestone |
| Weight | Issue weight |
| Labels | Labels, separated by commas |
| Time Estimate | [Time estimate](../time_tracking.md#estimates) in seconds |
| Time Spent | [Time spent](../time_tracking.md#time-spent) in seconds |
| Epic ID | ID of the parent epic |
| Epic Title | Title of the parent epic |
## Troubleshooting
When working with exported issues, you might encounter the following issues.
### Size of export
Issues are sent as an email attachment, with a 15 MB export limit to ensure
successful delivery across a range of email providers. If you reach the limit,
narrow your search before export. For example, consider exporting open and
closed issues separately.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Export issues to CSV
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can export issues from GitLab to a plain-text CSV
([comma-separated values](https://en.wikipedia.org/wiki/Comma-separated_values))
file. The CSV file is attached to an email, and sent to your default
notification email address.
<!-- vale gitlab_base.Spelling = NO -->
CSV files can be used with any plotter or spreadsheet-based program, like
Microsoft Excel, OpenOffice Calc, or Google Sheets. Use a CSV list of issues to:
<!-- vale gitlab_base.Spelling = YES -->
- Create a snapshot of issues for offline analysis, or to share with other
teams who might not be in GitLab.
- Create diagrams, graphs, and charts from the CSV data.
- Convert the data to other formats for auditing or sharing.
- Import the issues to a system outside of GitLab.
- Analyze long-term trends with multiple snapshots created over time.
- Use the long-term data to gather relevant feedback given in the issues, and
improve your product based on real metrics.
## Select issues to export
You can export issues from individual projects, but not groups.
Prerequisites:
- You must have at least the Guest role.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Above the list of issues, select **Search or filter results**.
1. In the dropdown list that appears, select the attributes to filter by.
For more information about filter options, see
[Filter the list of issues](managing_issues.md#filter-the-list-of-issues).
1. In the upper right, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Export as CSV**.
1. In the dialog, verify that the email address is correct, then select **Export issues**.
All matching issues are exported, including those not shown on the first page.
The exported CSV does not contain attachments from issues.
## Format
The CSV file has this format:
- Sort is by title.
- Columns are delimited with commas.
- Fields are quoted with double quotes (`"`) if needed.
- Newline characters separate rows.
{{< alert type="note" >}}
For information about CSV parsing requirements that can affect how exported files display when viewed
in GitLab, see [CSV parsing considerations](../repository/files/csv.md#csv-parsing-considerations).
{{< /alert >}}
## Columns
The following columns are included in the CSV file.
| Column | Description |
|-------------------|-------------|
| Title | Issue `title` |
| Description | Issue `description` |
| Issue ID | Issue `iid` |
| URL | A link to the issue on GitLab |
| State | `Open` or `Closed` |
| Author | Full name of the issue author |
| Author Username | Username of the author, with the `@` symbol omitted |
| Assignee | Full name of the issue assignee |
| Assignee Username | Username of the author, with the `@` symbol omitted |
| Confidential | `Yes` or `No` |
| Locked | `Yes` or `No` |
| Due Date | Formatted as `YYYY-MM-DD` |
| Created At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Updated At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Closed At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Milestone | Title of the issue milestone |
| Weight | Issue weight |
| Labels | Labels, separated by commas |
| Time Estimate | [Time estimate](../time_tracking.md#estimates) in seconds |
| Time Spent | [Time spent](../time_tracking.md#time-spent) in seconds |
| Epic ID | ID of the parent epic |
| Epic Title | Title of the parent epic |
## Troubleshooting
When working with exported issues, you might encounter the following issues.
### Size of export
Issues are sent as an email attachment, with a 15 MB export limit to ensure
successful delivery across a range of email providers. If you reach the limit,
narrow your search before export. For example, consider exporting open and
closed issues separately.
|
https://docs.gitlab.com/user/project/issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
_index.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Issues
|
Tasks, bug reports, feature requests, and tracking.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Issues help you collaborate with your team to plan, track, and deliver work in GitLab.
Issues:
- Track feature proposals, tasks, support requests, and bug reports.
- Organize and prioritize work with assignees, due dates, and health status.
- Facilitate team discussion and decision-making through comments and threaded discussions.
- Support custom workflows through templates, labels, epics, and boards.
- Integrate with external tools like Zoom, Jira, and email services.
For more information about issues, see the GitLab blog post:
[Always start a discussion with an issue](https://about.gitlab.com/blog/2016/03/03/start-with-an-issue/).
Issues are always associated with a specific project. If you have multiple
projects in a group, you can view all of the projects' issues at once.
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=Mt1EzlKToig">Issues - Setting up your Organization with GitLab</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/Mt1EzlKToig" frameborder="0" allowfullscreen> </iframe>
</figure>
<!-- Video published on 2023-10-30 -->
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
To learn how the GitLab Strategic Marketing department uses GitLab issues with [labels](../labels.md) and
[issue boards](../issue_board.md), see the video on
[Managing Commitments with Issues](https://www.youtube.com/watch?v=cuIHNintg1o&t=3).
<!-- Video published on 2020-04-10 -->
## Related topics
- [Create issues](create_issues.md)
- [Create an issue from a template](../description_templates.md#use-the-templates)
- [Edit issues](managing_issues.md#edit-an-issue)
- [Move issues](managing_issues.md#move-an-issue)
- [Close issues](managing_issues.md#close-an-issue)
- [Delete issues](managing_issues.md#delete-an-issue)
- [Promote issues](managing_issues.md#promote-an-issue-to-an-epic)
- [Set a due date](due_dates.md)
- [Import issues](csv_import.md)
- [Export issues](csv_export.md)
- [Upload designs to issues](design_management.md)
- [Linked issues](related_issues.md)
- [Similar issues](managing_issues.md#similar-issues)
- [Health status](managing_issues.md#health-status)
- [Cross-link issues](crosslinking_issues.md)
- [Sort issue lists](sorting_issue_lists.md)
- [Search for issues](managing_issues.md#filter-the-list-of-issues)
- [Epics](../../group/epics/_index.md)
- [Issue boards](../issue_board.md)
- [Issues API](../../../api/issues.md)
- [Configure an external issue tracker](../../../integration/external-issue-tracker.md)
- [Tasks](../../tasks.md)
- [External participants](../service_desk/external_participants.md)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Issues
description: Tasks, bug reports, feature requests, and tracking.
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Issues help you collaborate with your team to plan, track, and deliver work in GitLab.
Issues:
- Track feature proposals, tasks, support requests, and bug reports.
- Organize and prioritize work with assignees, due dates, and health status.
- Facilitate team discussion and decision-making through comments and threaded discussions.
- Support custom workflows through templates, labels, epics, and boards.
- Integrate with external tools like Zoom, Jira, and email services.
For more information about issues, see the GitLab blog post:
[Always start a discussion with an issue](https://about.gitlab.com/blog/2016/03/03/start-with-an-issue/).
Issues are always associated with a specific project. If you have multiple
projects in a group, you can view all of the projects' issues at once.
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=Mt1EzlKToig">Issues - Setting up your Organization with GitLab</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/Mt1EzlKToig" frameborder="0" allowfullscreen> </iframe>
</figure>
<!-- Video published on 2023-10-30 -->
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
To learn how the GitLab Strategic Marketing department uses GitLab issues with [labels](../labels.md) and
[issue boards](../issue_board.md), see the video on
[Managing Commitments with Issues](https://www.youtube.com/watch?v=cuIHNintg1o&t=3).
<!-- Video published on 2020-04-10 -->
## Related topics
- [Create issues](create_issues.md)
- [Create an issue from a template](../description_templates.md#use-the-templates)
- [Edit issues](managing_issues.md#edit-an-issue)
- [Move issues](managing_issues.md#move-an-issue)
- [Close issues](managing_issues.md#close-an-issue)
- [Delete issues](managing_issues.md#delete-an-issue)
- [Promote issues](managing_issues.md#promote-an-issue-to-an-epic)
- [Set a due date](due_dates.md)
- [Import issues](csv_import.md)
- [Export issues](csv_export.md)
- [Upload designs to issues](design_management.md)
- [Linked issues](related_issues.md)
- [Similar issues](managing_issues.md#similar-issues)
- [Health status](managing_issues.md#health-status)
- [Cross-link issues](crosslinking_issues.md)
- [Sort issue lists](sorting_issue_lists.md)
- [Search for issues](managing_issues.md#filter-the-list-of-issues)
- [Epics](../../group/epics/_index.md)
- [Issue boards](../issue_board.md)
- [Issues API](../../../api/issues.md)
- [Configure an external issue tracker](../../../integration/external-issue-tracker.md)
- [Tasks](../../tasks.md)
- [External participants](../service_desk/external_participants.md)
|
https://docs.gitlab.com/user/project/associate_zoom_meeting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/associate_zoom_meeting.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
associate_zoom_meeting.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Associate a Zoom meeting with an issue
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To communicate synchronously for incidents management,
you can associate a Zoom meeting with an issue.
After you start a Zoom call for a fire-fight, you need a way to
associate the conference call with an issue. This is so that your
team members can join swiftly without requesting a link.
## Adding a Zoom meeting to an issue
To associate a Zoom meeting with an issue, you can use GitLab
[quick actions](../quick_actions.md#issues-merge-requests-and-epics).
In an issue, leave a comment using the `/zoom` quick action followed by a valid Zoom link:
```shell
/zoom https://zoom.us/j/123456789
```
If the Zoom meeting URL is valid and you have at least the Reporter role,
a system alert notifies you of its successful addition.
The issue's description is automatically edited to include the Zoom link, and a button
appears right under the issue's title.

You are only allowed to attach a single Zoom meeting to an issue. If you attempt
to add a second Zoom meeting using the `/zoom` quick action, it doesn't work. You
need to [remove it](#removing-an-existing-zoom-meeting-from-an-issue) first.
Users on GitLab Premium and Ultimate can also
[add multiple Zoom links to incidents](../../../operations/incident_management/linked_resources.md#link-zoom-meetings-from-an-incident).
## Removing an existing Zoom meeting from an issue
Similarly to adding a Zoom meeting, you can remove it with a quick action:
```shell
/remove_zoom
```
If you have at least the Reporter role,
a system alert notifies you that the meeting URL was successfully removed.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Associate a Zoom meeting with an issue
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To communicate synchronously for incidents management,
you can associate a Zoom meeting with an issue.
After you start a Zoom call for a fire-fight, you need a way to
associate the conference call with an issue. This is so that your
team members can join swiftly without requesting a link.
## Adding a Zoom meeting to an issue
To associate a Zoom meeting with an issue, you can use GitLab
[quick actions](../quick_actions.md#issues-merge-requests-and-epics).
In an issue, leave a comment using the `/zoom` quick action followed by a valid Zoom link:
```shell
/zoom https://zoom.us/j/123456789
```
If the Zoom meeting URL is valid and you have at least the Reporter role,
a system alert notifies you of its successful addition.
The issue's description is automatically edited to include the Zoom link, and a button
appears right under the issue's title.

You are only allowed to attach a single Zoom meeting to an issue. If you attempt
to add a second Zoom meeting using the `/zoom` quick action, it doesn't work. You
need to [remove it](#removing-an-existing-zoom-meeting-from-an-issue) first.
Users on GitLab Premium and Ultimate can also
[add multiple Zoom links to incidents](../../../operations/incident_management/linked_resources.md#link-zoom-meetings-from-an-incident).
## Removing an existing Zoom meeting from an issue
Similarly to adding a Zoom meeting, you can remove it with a quick action:
```shell
/remove_zoom
```
If you have at least the Reporter role,
a system alert notifies you that the meeting URL was successfully removed.
|
https://docs.gitlab.com/user/project/create_issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/create_issues.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
create_issues.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Create an issue
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you create an issue, you are prompted to enter the fields of the issue.
If you know the values you want to assign to an issue, you can use
[quick actions](../quick_actions.md) to enter them.
You can create an issue in many ways in GitLab:
- [From a project](#from-a-project)
- [From a group](#from-a-group)
- [From another issue or incident](#from-another-issue-or-incident)
- [From an issue board](#from-an-issue-board)
- [By sending an email](#by-sending-an-email)
- [Using a URL with prefilled values](#using-a-url-with-prefilled-values)
- [Using Service Desk](#using-service-desk)
## From a project
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Either:
- On the left sidebar, select **Plan > Issues**, and then, in the upper-right corner, select **New issue**.
- On the left sidebar, at the top, select the plus sign ({{< icon name="plus" >}}) and then, under **In this project**,
select **New issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
## From a group
Issues belong to projects, but when you're in a group, you can access and create issues that belong
to the projects in the group.
Prerequisites:
- You must have at least the Guest role for the project in the group.
To create an issue from a group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Plan > Issues**.
1. In the upper-right corner, select **Select project to create issue**.
1. Select the project you'd like to create an issue for. The button now reflects the selected
project.
1. Select **New issue in `<project name>`**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
The project you selected most recently becomes the default for your next visit.
This can save you a lot of time, if you mostly create issues for the same project.
## From another issue or incident
You can create a new issue from an existing one. The two issues can then be marked as related.
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from another issue:
1. In an existing issue, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **New related issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
The new issue form has a **Relate to issue #123** checkbox, where `123` is the ID of the
issue of origin. If you keep this checkbox checked, the two issues become
[linked](related_issues.md).
1. Select **Create issue**.
The newly created issue opens.
## From an issue board
You can create a new issue from an [issue board](../issue_board.md).
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from a project issue board:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issue boards**.
1. At the top of a board list, select **Create new issue** ({{< icon name="plus-square" >}}).
1. Enter the issue's title.
1. Select **Create issue**.
To create an issue from a group issue board:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Plan > Issue boards**.
1. At the top of a board list, select **Create new issue** ({{< icon name="plus-square" >}}).
1. Enter the issue's title.
1. Under **Projects**, select the project in the group that the issue should belong to.
1. Select **Create issue**.
The issue is created and shows up in the board list. It shares the list's characteristic, so, for
example, if the list is scoped to a label `Frontend`, the new issue also has this label.
## By sending an email
You can send an email to create an issue in a project on the project's
**Issues** page.
Prerequisites:
- Your GitLab instance must have [incoming email](../../../administration/incoming_email.md)
configured with [email sub-addressing or catch-all mailbox](../../../administration/incoming_email.md#requirements).
- There must be at least one issue in the issue list.
- You must have at least the Guest role for the project.
To email an issue to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. At the bottom of the page, select **Email a new issue to this project**.
1. To copy the email address, select **Copy** ({{< icon name="copy-to-clipboard" >}}).
1. From your email client, send an email to this address.
The subject is used as the title of the new issue, and the email body becomes the description.
You can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md).
A new issue is created, with your user as the author.
You can save this address as a contact in your email client to use it again.
{{< alert type="warning" >}}
The email address you see is a private email address, generated just for you.
**Keep it to yourself**, because anyone who knows it can create issues or merge requests as if they
were you.
{{< /alert >}}
To regenerate the email address:
1. On the **Issues** page, select **Email a new issue to this project**.
1. Select **reset this token**.
## Using a URL with prefilled values
To link directly to the new issue page with prefilled fields, use query
string parameters in a URL. You can embed a URL in an external
HTML page to create issues with certain fields prefilled.
To build the URL to create an issue with prefilled values, combine:
1. The project's or group's Issues page URL, followed by `/new`.
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new`
1. `?` to start listing parameters.
1. URL parameter, followed by `=` and value.
For example: `issue[title]=My%20test%20issue`.
1. Optional. `&` to join more parameters.
| Field | URL parameter | Notes |
| ---------------------------------------------------------------------------------------------- | ---------------------- | ----- |
| Title | `issue[title]` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). |
| Issue type | `issue[issue_type]` | Either `incident` or `issue`. |
| Description template (issues, incidents, and merge requests) | `issuable_template` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). |
| Description template (tasks, OKRs, issues [with the new look](issue_work_items.md), and epics. | `description_template` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/513095) in GitLab 17.9. |
| Description | `issue[description]` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). If used in combination with `issuable_template` or a [default issue template](../description_templates.md#set-a-default-template-for-merge-requests-and-issues), the `issue[description]` value is appended to the template. |
| Confidential | `issue[confidential]` | If `true`, the issue is marked as confidential. |
| Relate to… | `add_related_issue` | A numeric issue ID. If present, the issue form shows a [**Relate to** checkbox](#from-another-issue-or-incident) to optionally link the new issue to the specified existing issue. |
In [GitLab 17.8 and later](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177215),
when you select an issue template, the URL changes to show the template used.
Adapt these examples to form your new issue URL with prefilled fields.
To create an issue in the GitLab project:
- With a prefilled title and description:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Whoa%2C%20we%27re%20half-way%20there&issue[description]=Whoa%2C%20livin%27%20in%20a%20URL
```
- With a prefilled title and description template:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issuable_template=Feature%20Proposal%20-%20basic
```
- With a prefilled title, description, and marked as confidential:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea&issue[confidential]=true
```
## Using Service Desk
To offer email support, enable [Service Desk](../service_desk/_index.md) for your project.
Now, when your customer sends a new email, a new issue can be created in
the appropriate project and followed up from there.
## Fields in the new issue form
{{< history >}}
- Iteration field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233517) in GitLab 15.6.
{{< /history >}}
When you're creating a new issue, you can complete the following fields:
- Title
- Project: defaults to the current project
- Type: either issue (default) or incident
- [Description template](../description_templates.md): overwrites anything in the Description text box
- Description: you can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md)
- Checkbox to make the issue [confidential](confidential_issues.md)
- [Assignees](managing_issues.md#assignees)
- [Weight](issue_weight.md)
- [Epic](../../group/epics/_index.md) (named Parent if [the new look for issues](issue_work_items.md) is enabled)
- [Due date](due_dates.md) (named Dates if [the new look for issues](issue_work_items.md) is enabled)
- [Milestone](../milestones/_index.md)
- [Labels](../labels.md)
- [Iteration](../../group/iterations/_index.md)
- [Health status](managing_issues.md#health-status) ([the new look for issues](issue_work_items.md) must be enabled)
- [Contacts](../../crm/_index.md) ([the new look for issues](issue_work_items.md) must be enabled)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Create an issue
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you create an issue, you are prompted to enter the fields of the issue.
If you know the values you want to assign to an issue, you can use
[quick actions](../quick_actions.md) to enter them.
You can create an issue in many ways in GitLab:
- [From a project](#from-a-project)
- [From a group](#from-a-group)
- [From another issue or incident](#from-another-issue-or-incident)
- [From an issue board](#from-an-issue-board)
- [By sending an email](#by-sending-an-email)
- [Using a URL with prefilled values](#using-a-url-with-prefilled-values)
- [Using Service Desk](#using-service-desk)
## From a project
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Either:
- On the left sidebar, select **Plan > Issues**, and then, in the upper-right corner, select **New issue**.
- On the left sidebar, at the top, select the plus sign ({{< icon name="plus" >}}) and then, under **In this project**,
select **New issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
## From a group
Issues belong to projects, but when you're in a group, you can access and create issues that belong
to the projects in the group.
Prerequisites:
- You must have at least the Guest role for the project in the group.
To create an issue from a group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Plan > Issues**.
1. In the upper-right corner, select **Select project to create issue**.
1. Select the project you'd like to create an issue for. The button now reflects the selected
project.
1. Select **New issue in `<project name>`**.
1. Complete the [fields](#fields-in-the-new-issue-form).
1. Select **Create issue**.
The newly created issue opens.
The project you selected most recently becomes the default for your next visit.
This can save you a lot of time, if you mostly create issues for the same project.
## From another issue or incident
You can create a new issue from an existing one. The two issues can then be marked as related.
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from another issue:
1. In an existing issue, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **New related issue**.
1. Complete the [fields](#fields-in-the-new-issue-form).
The new issue form has a **Relate to issue #123** checkbox, where `123` is the ID of the
issue of origin. If you keep this checkbox checked, the two issues become
[linked](related_issues.md).
1. Select **Create issue**.
The newly created issue opens.
## From an issue board
You can create a new issue from an [issue board](../issue_board.md).
Prerequisites:
- You must have at least the Guest role for the project.
To create an issue from a project issue board:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issue boards**.
1. At the top of a board list, select **Create new issue** ({{< icon name="plus-square" >}}).
1. Enter the issue's title.
1. Select **Create issue**.
To create an issue from a group issue board:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Plan > Issue boards**.
1. At the top of a board list, select **Create new issue** ({{< icon name="plus-square" >}}).
1. Enter the issue's title.
1. Under **Projects**, select the project in the group that the issue should belong to.
1. Select **Create issue**.
The issue is created and shows up in the board list. It shares the list's characteristic, so, for
example, if the list is scoped to a label `Frontend`, the new issue also has this label.
## By sending an email
You can send an email to create an issue in a project on the project's
**Issues** page.
Prerequisites:
- Your GitLab instance must have [incoming email](../../../administration/incoming_email.md)
configured with [email sub-addressing or catch-all mailbox](../../../administration/incoming_email.md#requirements).
- There must be at least one issue in the issue list.
- You must have at least the Guest role for the project.
To email an issue to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. At the bottom of the page, select **Email a new issue to this project**.
1. To copy the email address, select **Copy** ({{< icon name="copy-to-clipboard" >}}).
1. From your email client, send an email to this address.
The subject is used as the title of the new issue, and the email body becomes the description.
You can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md).
A new issue is created, with your user as the author.
You can save this address as a contact in your email client to use it again.
{{< alert type="warning" >}}
The email address you see is a private email address, generated just for you.
**Keep it to yourself**, because anyone who knows it can create issues or merge requests as if they
were you.
{{< /alert >}}
To regenerate the email address:
1. On the **Issues** page, select **Email a new issue to this project**.
1. Select **reset this token**.
## Using a URL with prefilled values
To link directly to the new issue page with prefilled fields, use query
string parameters in a URL. You can embed a URL in an external
HTML page to create issues with certain fields prefilled.
To build the URL to create an issue with prefilled values, combine:
1. The project's or group's Issues page URL, followed by `/new`.
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new`
1. `?` to start listing parameters.
1. URL parameter, followed by `=` and value.
For example: `issue[title]=My%20test%20issue`.
1. Optional. `&` to join more parameters.
| Field | URL parameter | Notes |
| ---------------------------------------------------------------------------------------------- | ---------------------- | ----- |
| Title | `issue[title]` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). |
| Issue type | `issue[issue_type]` | Either `incident` or `issue`. |
| Description template (issues, incidents, and merge requests) | `issuable_template` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). |
| Description template (tasks, OKRs, issues [with the new look](issue_work_items.md), and epics. | `description_template` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/513095) in GitLab 17.9. |
| Description | `issue[description]` | Must be [URL-encoded](../../../api/rest/_index.md#namespaced-paths). If used in combination with `issuable_template` or a [default issue template](../description_templates.md#set-a-default-template-for-merge-requests-and-issues), the `issue[description]` value is appended to the template. |
| Confidential | `issue[confidential]` | If `true`, the issue is marked as confidential. |
| Relate to… | `add_related_issue` | A numeric issue ID. If present, the issue form shows a [**Relate to** checkbox](#from-another-issue-or-incident) to optionally link the new issue to the specified existing issue. |
In [GitLab 17.8 and later](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177215),
when you select an issue template, the URL changes to show the template used.
Adapt these examples to form your new issue URL with prefilled fields.
To create an issue in the GitLab project:
- With a prefilled title and description:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Whoa%2C%20we%27re%20half-way%20there&issue[description]=Whoa%2C%20livin%27%20in%20a%20URL
```
- With a prefilled title and description template:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issuable_template=Feature%20Proposal%20-%20basic
```
- With a prefilled title, description, and marked as confidential:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea&issue[confidential]=true
```
## Using Service Desk
To offer email support, enable [Service Desk](../service_desk/_index.md) for your project.
Now, when your customer sends a new email, a new issue can be created in
the appropriate project and followed up from there.
## Fields in the new issue form
{{< history >}}
- Iteration field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233517) in GitLab 15.6.
{{< /history >}}
When you're creating a new issue, you can complete the following fields:
- Title
- Project: defaults to the current project
- Type: either issue (default) or incident
- [Description template](../description_templates.md): overwrites anything in the Description text box
- Description: you can use [Markdown](../../markdown.md) and [quick actions](../quick_actions.md)
- Checkbox to make the issue [confidential](confidential_issues.md)
- [Assignees](managing_issues.md#assignees)
- [Weight](issue_weight.md)
- [Epic](../../group/epics/_index.md) (named Parent if [the new look for issues](issue_work_items.md) is enabled)
- [Due date](due_dates.md) (named Dates if [the new look for issues](issue_work_items.md) is enabled)
- [Milestone](../milestones/_index.md)
- [Labels](../labels.md)
- [Iteration](../../group/iterations/_index.md)
- [Health status](managing_issues.md#health-status) ([the new look for issues](issue_work_items.md) must be enabled)
- [Contacts](../../crm/_index.md) ([the new look for issues](issue_work_items.md) must be enabled)
|
https://docs.gitlab.com/user/project/crosslinking_issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/crosslinking_issues.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
crosslinking_issues.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Crosslinking issues
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Crosslinking creates relationships between issues in GitLab.
Crosslinking:
- Connects related issues for better tracking and visibility.
- Links issues to their related commits and merge requests.
- Creates references through commit messages, branch names, and descriptions.
- Works across projects and groups.
- Shows relationships in each issue's **Linked items** section.
You can create crosslinks through:
- [Commit messages](#from-commit-messages)
- [Linked issues](#from-linked-issues)
- [Merge requests](#from-merge-requests)
- [Branch names](#from-branch-names)
## From commit messages
Every time you mention an issue in your commit message, you're creating
a relationship between the two stages of the development workflow: the
issue itself and the first commit related to that issue.
If the issue and the code you're committing are both in the same project,
add `#xxx` to the commit message, where `xxx` is the issue number.
```shell
git commit -m "this is my commit message. Ref #xxx"
```
Commit messages cannot usually begin with a `#` character, so you may use
the alternative `GL-xxx` notation as well:
```shell
git commit -m "GL-xxx: this is my commit message"
```
If they are in different projects, but in the same group,
add `projectname#xxx` to the commit message.
```shell
git commit -m "this is my commit message. Ref projectname#xxx"
```
If they are not in the same group, you can add the full URL to the issue
(`https://gitlab.com/<username>/<projectname>/-/issues/<xxx>`).
{{< alert type="note" >}}
For performance reasons, GitLab processes only the first 1,000 full URLs in commit messages
for automatic linking. Additional URLs beyond this limit are not converted to links.
{{< /alert >}}
```shell
git commit -m "this is my commit message. Related to https://gitlab.com/<username>/<projectname>/-/issues/<xxx>"
```
Of course, you can replace `gitlab.com` with the URL of your own GitLab instance.
Linking your first commit to your issue is relevant
for tracking your process with [GitLab Value Stream Analytics](https://about.gitlab.com/solutions/value-stream-management/).
It measures the time taken for planning the implementation of that issue,
which is the time between creating an issue and making the first commit.
## From linked issues
Mentioning linked issues in merge requests and other issues helps your team members and
collaborators know that there are opened issues regarding the same topic.
When mentioning issue `#111` in issue `#222`, issue `#111` also displays a notification
in its **Activity** feed. That is, you only need to mention the relationship once for it to
display in both issues. The same is valid when mentioning issues in [merge requests](#from-merge-requests).
When the activity feed for an issue is filtered to **Show history only** or **Show all activity**,
crosslinks are shown as `(Username) mentioned in issue #(number) (time ago)`.
## From merge requests
Mentioning issues in merge request comments works exactly the same way as
they do for [linked issues](#from-linked-issues).
When you mention an issue in a merge request description, it
[links the issue and merge request together](#from-linked-issues). Additionally,
you can also [set an issue to close automatically](managing_issues.md#closing-issues-automatically)
as soon as the merge request is merged.
When the activity feed for an issue is filtered to **Show history only** or **Show all activity**,
crosslinks are shown as `(Username) mentioned in merge request !(number) (time ago)`.
## From branch names
When you create a branch in the same project as an issue and start the branch name with the issue
number, followed by a hyphen, the issue and MR you create are linked.
For more information, see
[Prefix branch names with issue numbers](../repository/branches/_index.md#prefix-branch-names-with-a-number).
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Crosslinking issues
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Crosslinking creates relationships between issues in GitLab.
Crosslinking:
- Connects related issues for better tracking and visibility.
- Links issues to their related commits and merge requests.
- Creates references through commit messages, branch names, and descriptions.
- Works across projects and groups.
- Shows relationships in each issue's **Linked items** section.
You can create crosslinks through:
- [Commit messages](#from-commit-messages)
- [Linked issues](#from-linked-issues)
- [Merge requests](#from-merge-requests)
- [Branch names](#from-branch-names)
## From commit messages
Every time you mention an issue in your commit message, you're creating
a relationship between the two stages of the development workflow: the
issue itself and the first commit related to that issue.
If the issue and the code you're committing are both in the same project,
add `#xxx` to the commit message, where `xxx` is the issue number.
```shell
git commit -m "this is my commit message. Ref #xxx"
```
Commit messages cannot usually begin with a `#` character, so you may use
the alternative `GL-xxx` notation as well:
```shell
git commit -m "GL-xxx: this is my commit message"
```
If they are in different projects, but in the same group,
add `projectname#xxx` to the commit message.
```shell
git commit -m "this is my commit message. Ref projectname#xxx"
```
If they are not in the same group, you can add the full URL to the issue
(`https://gitlab.com/<username>/<projectname>/-/issues/<xxx>`).
{{< alert type="note" >}}
For performance reasons, GitLab processes only the first 1,000 full URLs in commit messages
for automatic linking. Additional URLs beyond this limit are not converted to links.
{{< /alert >}}
```shell
git commit -m "this is my commit message. Related to https://gitlab.com/<username>/<projectname>/-/issues/<xxx>"
```
Of course, you can replace `gitlab.com` with the URL of your own GitLab instance.
Linking your first commit to your issue is relevant
for tracking your process with [GitLab Value Stream Analytics](https://about.gitlab.com/solutions/value-stream-management/).
It measures the time taken for planning the implementation of that issue,
which is the time between creating an issue and making the first commit.
## From linked issues
Mentioning linked issues in merge requests and other issues helps your team members and
collaborators know that there are opened issues regarding the same topic.
When mentioning issue `#111` in issue `#222`, issue `#111` also displays a notification
in its **Activity** feed. That is, you only need to mention the relationship once for it to
display in both issues. The same is valid when mentioning issues in [merge requests](#from-merge-requests).
When the activity feed for an issue is filtered to **Show history only** or **Show all activity**,
crosslinks are shown as `(Username) mentioned in issue #(number) (time ago)`.
## From merge requests
Mentioning issues in merge request comments works exactly the same way as
they do for [linked issues](#from-linked-issues).
When you mention an issue in a merge request description, it
[links the issue and merge request together](#from-linked-issues). Additionally,
you can also [set an issue to close automatically](managing_issues.md#closing-issues-automatically)
as soon as the merge request is merged.
When the activity feed for an issue is filtered to **Show history only** or **Show all activity**,
crosslinks are shown as `(Username) mentioned in merge request !(number) (time ago)`.
## From branch names
When you create a branch in the same project as an issue and start the branch name with the issue
number, followed by a hyphen, the issue and MR you create are linked.
For more information, see
[Prefix branch names with issue numbers](../repository/branches/_index.md#prefix-branch-names-with-a-number).
|
https://docs.gitlab.com/user/project/confidential_issues
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/confidential_issues.md
|
2025-08-13
|
doc/user/project/issues
|
[
"doc",
"user",
"project",
"issues"
] |
confidential_issues.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Confidential issues
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Confidential issues are [issues](_index.md) visible only to members of a project with
[sufficient permissions](#who-can-see-confidential-issues).
Confidential issues can be used by open source projects and companies alike to
keep security vulnerabilities private or prevent surprises from leaking out.
## Make an issue confidential
{{< history >}}
- Minimum role to make an issue confidential [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can make an issue confidential when you create or edit an issue.
Prerequisites:
- You must have at least the Planner role for the project to convert an existing issue to confidential.
- If the issue you want to make confidential has any child [tasks](../../tasks.md),
you must first make all the child tasks confidential.
A confidential issue can have only confidential children.
### In a new issue
When you create a new issue, a checkbox right below the text area is available
to mark the issue as confidential. Check that box and select **Create issue**
to create the issue.
When you create a confidential issue in a project, the project becomes listed in the **Contributed projects** section in your [profile](../../profile/_index.md). **Contributed projects** does not show information about the confidential issue; it only shows the project name.
To create a confidential issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}).
1. From the dropdown list, select **New issue**.
1. Complete the [fields](create_issues.md#fields-in-the-new-issue-form).
- Select the **Turn on confidentiality** checkbox.
1. Select **Create issue**.
### In an existing issue
To change the confidentiality of an existing issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Select the title of your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}) and then **Turn on confidentiality** (or **Turn off confidentiality** to make the issue non-confidential).
Alternatively, you can use the `/confidential` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
## Who can see confidential issues
{{< history >}}
- Minimum role to see confidential issues [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When an issue is made confidential, only users with at least the Planner role
for the project have access to the issue.
Users with Guest or [Minimal](../../permissions.md#users-with-minimal-access) roles can't access
the issue even if they were actively participating before the change.
However, a user with the **Guest role** can create confidential issues, but can only view the ones
that they created themselves.
Users with the Guest role or non-members can read the confidential issue if they are assigned to the issue.
When a Guest user or non-member is unassigned from a confidential issue, they can no longer view it.
Confidential issues are hidden in search results for users without the necessary permissions.
## Confidential issue indicators
Confidential issues are visually different from regular issues in a few ways.
In the **Issues** and **Issue boards** pages, you can see the confidential ({{< icon name="eye-slash" >}}) icon
next to issues marked as confidential.
If you don't have [enough permissions](#who-can-see-confidential-issues),
you cannot see confidential issues at all.
Likewise, while inside the issue, you can see the confidential ({{< icon name="eye-slash" >}}) icon right next to
the issue number. There is also an indicator in the comment area that the
issue you are commenting on is confidential.
There is also an indicator on the sidebar denoting confidentiality.
Every change from regular to confidential and vice versa, is indicated by a
system note in the issue's comments, for example:
- {{< icon name="eye-slash" >}} Jo Garcia made the issue confidential 5 minutes ago
- {{< icon name="eye" >}} Jo Garcia made the issue visible to everyone just now
## Merge requests for confidential issues
Although you can create confidential issues (and make existing issues confidential) in a public project, you cannot make confidential merge requests.
Learn how to create [merge requests for confidential issues](../merge_requests/confidential.md) that prevent leaks of private data.
## Related topics
- [Merge requests for confidential issues](../merge_requests/confidential.md)
- [Make an epic confidential](../../group/epics/manage_epics.md#make-an-epic-confidential)
- [Add an internal note](../../discussions/_index.md#add-an-internal-note)
- [Security practices for confidential merge requests](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/engineer.md#security-releases-critical-non-critical-as-a-developer) at GitLab
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Confidential issues
breadcrumbs:
- doc
- user
- project
- issues
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Confidential issues are [issues](_index.md) visible only to members of a project with
[sufficient permissions](#who-can-see-confidential-issues).
Confidential issues can be used by open source projects and companies alike to
keep security vulnerabilities private or prevent surprises from leaking out.
## Make an issue confidential
{{< history >}}
- Minimum role to make an issue confidential [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can make an issue confidential when you create or edit an issue.
Prerequisites:
- You must have at least the Planner role for the project to convert an existing issue to confidential.
- If the issue you want to make confidential has any child [tasks](../../tasks.md),
you must first make all the child tasks confidential.
A confidential issue can have only confidential children.
### In a new issue
When you create a new issue, a checkbox right below the text area is available
to mark the issue as confidential. Check that box and select **Create issue**
to create the issue.
When you create a confidential issue in a project, the project becomes listed in the **Contributed projects** section in your [profile](../../profile/_index.md). **Contributed projects** does not show information about the confidential issue; it only shows the project name.
To create a confidential issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}).
1. From the dropdown list, select **New issue**.
1. Complete the [fields](create_issues.md#fields-in-the-new-issue-form).
- Select the **Turn on confidentiality** checkbox.
1. Select **Create issue**.
### In an existing issue
To change the confidentiality of an existing issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. Select the title of your issue to view it.
1. In the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}) and then **Turn on confidentiality** (or **Turn off confidentiality** to make the issue non-confidential).
Alternatively, you can use the `/confidential` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
## Who can see confidential issues
{{< history >}}
- Minimum role to see confidential issues [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When an issue is made confidential, only users with at least the Planner role
for the project have access to the issue.
Users with Guest or [Minimal](../../permissions.md#users-with-minimal-access) roles can't access
the issue even if they were actively participating before the change.
However, a user with the **Guest role** can create confidential issues, but can only view the ones
that they created themselves.
Users with the Guest role or non-members can read the confidential issue if they are assigned to the issue.
When a Guest user or non-member is unassigned from a confidential issue, they can no longer view it.
Confidential issues are hidden in search results for users without the necessary permissions.
## Confidential issue indicators
Confidential issues are visually different from regular issues in a few ways.
In the **Issues** and **Issue boards** pages, you can see the confidential ({{< icon name="eye-slash" >}}) icon
next to issues marked as confidential.
If you don't have [enough permissions](#who-can-see-confidential-issues),
you cannot see confidential issues at all.
Likewise, while inside the issue, you can see the confidential ({{< icon name="eye-slash" >}}) icon right next to
the issue number. There is also an indicator in the comment area that the
issue you are commenting on is confidential.
There is also an indicator on the sidebar denoting confidentiality.
Every change from regular to confidential and vice versa, is indicated by a
system note in the issue's comments, for example:
- {{< icon name="eye-slash" >}} Jo Garcia made the issue confidential 5 minutes ago
- {{< icon name="eye" >}} Jo Garcia made the issue visible to everyone just now
## Merge requests for confidential issues
Although you can create confidential issues (and make existing issues confidential) in a public project, you cannot make confidential merge requests.
Learn how to create [merge requests for confidential issues](../merge_requests/confidential.md) that prevent leaks of private data.
## Related topics
- [Merge requests for confidential issues](../merge_requests/confidential.md)
- [Make an epic confidential](../../group/epics/manage_epics.md#make-an-epic-confidential)
- [Add an internal note](../../discussions/_index.md#add-an-internal-note)
- [Security practices for confidential merge requests](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/engineer.md#security-releases-critical-non-critical-as-a-developer) at GitLab
|
https://docs.gitlab.com/user/project/external_participants
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/external_participants.md
|
2025-08-13
|
doc/user/project/service_desk
|
[
"doc",
"user",
"project",
"service_desk"
] |
external_participants.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
External participants
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3758) in GitLab 17.0.
{{< /history >}}
External participants are users without a GitLab account that can interact with an issue or Service Desk ticket only by email.
They get notified of public comments on an issue or ticket by [Service Desk emails](configure.md#customize-emails-sent-to-external-participants).
The maximum number of external participants on an issue or ticket is 10.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Multiple external participants in GitLab Service Desk](https://www.youtube.com/watch?v=eKNe7fYQCLc).
<!-- Video published on 2024-05-13 -->
## Service Desk tickets
GitLab adds the external author of a Service Desk ticket as an external participant.
That usually is the email address from the `From` header of the initial email that created the ticket.
### Add external participants from the `Cc` header
By default GitLab only adds the sender of the email that creates the Service Desk ticket as an external participant.
You can configure GitLab to also add all email addresses from the `Cc` header to the Service Desk ticket.
This works for the initial email and all replies to the [`thank_you` email](configure.md#customize-emails-sent-to-external-participants).
External participants added from the `Cc` header receive the `new_participant` email instead of the `thank_you` email to let them know they were added to the ticket.
Prerequisites:
- You must have at least the Maintainer role for the project.
To enable the setting for the project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Select **Add external participants from the `Cc` header**.
1. Select **Save changes**.
## As an external participant
An external participant receives a notification for each public comment on the issue or ticket
using [Service Desk emails](configure.md#customize-emails-sent-to-external-participants).
### Replying to notification emails
An external participant can [reply to the received notification email](../../../administration/reply_by_email.md#you-reply-to-the-notification-email).
It creates a new comment on the issue or ticket and displays the email address of the external participant
instead of a GitLab username. The email address is followed by `(external participant)`.

### Unsubscribing from notification emails
External participants can use the unsubscribe link in the default Service Desk email template to
unsubscribe from the issue or ticket.
If you [customize your `thank_you`, `new_participant`, and `new_note` email templates](configure.md#customize-emails-sent-to-external-participants),
you can use the `%{UNSUBSCRIBE_URL}` placeholder to add the unsubscribe link to the templates.
Your GitLab instance must be reachable (for example, from the public internet) for the external participant to successfully unsubscribe.
If that's not the case, consider removing the unsubscribe link from your template.
Emails from GitLab also contain special headers that allow supported email clients and other software
to [unsubscribe external participants automatically](../../profile/notifications.md#using-an-email-client-or-other-software).
## As a GitLab user
To see the email address of an external participant you must have at least the Reporter role for the project.
The external participant's email address is obfuscated if both these conditions are true:
- You are not a member of the project or have the Guest role.
- The issue or ticket is public ([non-confidential](../issues/confidential_issues.md)).
The external participant's email address is then obfuscated in:
- The author field of a Service Desk ticket.
- All [system notes](../system_notes.md) that mention an external participant.
- The [REST](../../../api/notes.md) and [GraphQL](../../../api/graphql/_index.md) APIs.
- The warning message below the comment editor.
For example:

### Notifications sent to external participants
External participants get notifications for all public comments on an issue.
For private communication, use [internal notes](../../discussions/_index.md#add-an-internal-note).
External participants don't receive notifications for any other issue or ticket event.
### View all external participants
Get an overview of all external participants that receive a Service Desk email for a new comment.
Prerequisites:
- You must have at least the Reporter role for the project.
To see a list of all external participants:
1. Go to the issue or ticket.
1. Scroll down to the comment editor.
1. If the issue or ticket has external participants, you can see a warning under the comment editor
that lists all external participants.

### Add an external participant
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/350460) in GitLab 13.8 [with a flag](../../feature_flags.md) named `issue_email_participants`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
Add an external participant using the `/add_email` [quick action](../quick_actions.md) when you want
to include them in the conversation at any time.
When added, the external participant starts receiving notifications using Service Desk emails.
New external participants receive the `new_participant` email to let them know they were added to the ticket.
GitLab doesn't send a `thank_you` email for manually added external participants.
You should add external participants in a dedicated comment because they don't receive a notification
email for the comment that contains the `/add_email` quick action.
Prerequisites:
- You must have at least the Reporter role for the project.
To add an external participant to an issue or ticket:
1. Go to the issue or ticket.
1. Add a comment that contains only the quick action `/add_email user@example.com`.
You can chain up to 6 email addresses. For example `/add_email user@example.com user2@example.com`
You should see a success message and a new system note with the email address.
### Remove an external participant
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/350460) in GitLab 13.8 [with a flag](../../feature_flags.md) named `issue_email_participants`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
Remove an external participant from an issue or Service Desk ticket using the `/remove_email`
[quick action](../quick_actions.md) when they should stop receiving notifications.
After removing them from the issue or ticket they don't receive new notifications.
But they can still reply to emails they received before and create a new comment on the issue or ticket.
Prerequisites:
- You must have at least the Reporter role for the project.
- There must be at least one external participant on the issue or ticket.
To remove an existing external participant from an issue or ticket:
1. Go to the issue or ticket.
1. Add a comment that contains only the quick action `/remove_email user@example.com`.
You can chain up to 6 email addresses. For example `/remove_email user@example.com user2@example.com`
You should see a success message and a new system note with the email address.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: External participants
breadcrumbs:
- doc
- user
- project
- service_desk
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3758) in GitLab 17.0.
{{< /history >}}
External participants are users without a GitLab account that can interact with an issue or Service Desk ticket only by email.
They get notified of public comments on an issue or ticket by [Service Desk emails](configure.md#customize-emails-sent-to-external-participants).
The maximum number of external participants on an issue or ticket is 10.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Multiple external participants in GitLab Service Desk](https://www.youtube.com/watch?v=eKNe7fYQCLc).
<!-- Video published on 2024-05-13 -->
## Service Desk tickets
GitLab adds the external author of a Service Desk ticket as an external participant.
That usually is the email address from the `From` header of the initial email that created the ticket.
### Add external participants from the `Cc` header
By default GitLab only adds the sender of the email that creates the Service Desk ticket as an external participant.
You can configure GitLab to also add all email addresses from the `Cc` header to the Service Desk ticket.
This works for the initial email and all replies to the [`thank_you` email](configure.md#customize-emails-sent-to-external-participants).
External participants added from the `Cc` header receive the `new_participant` email instead of the `thank_you` email to let them know they were added to the ticket.
Prerequisites:
- You must have at least the Maintainer role for the project.
To enable the setting for the project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Select **Add external participants from the `Cc` header**.
1. Select **Save changes**.
## As an external participant
An external participant receives a notification for each public comment on the issue or ticket
using [Service Desk emails](configure.md#customize-emails-sent-to-external-participants).
### Replying to notification emails
An external participant can [reply to the received notification email](../../../administration/reply_by_email.md#you-reply-to-the-notification-email).
It creates a new comment on the issue or ticket and displays the email address of the external participant
instead of a GitLab username. The email address is followed by `(external participant)`.

### Unsubscribing from notification emails
External participants can use the unsubscribe link in the default Service Desk email template to
unsubscribe from the issue or ticket.
If you [customize your `thank_you`, `new_participant`, and `new_note` email templates](configure.md#customize-emails-sent-to-external-participants),
you can use the `%{UNSUBSCRIBE_URL}` placeholder to add the unsubscribe link to the templates.
Your GitLab instance must be reachable (for example, from the public internet) for the external participant to successfully unsubscribe.
If that's not the case, consider removing the unsubscribe link from your template.
Emails from GitLab also contain special headers that allow supported email clients and other software
to [unsubscribe external participants automatically](../../profile/notifications.md#using-an-email-client-or-other-software).
## As a GitLab user
To see the email address of an external participant you must have at least the Reporter role for the project.
The external participant's email address is obfuscated if both these conditions are true:
- You are not a member of the project or have the Guest role.
- The issue or ticket is public ([non-confidential](../issues/confidential_issues.md)).
The external participant's email address is then obfuscated in:
- The author field of a Service Desk ticket.
- All [system notes](../system_notes.md) that mention an external participant.
- The [REST](../../../api/notes.md) and [GraphQL](../../../api/graphql/_index.md) APIs.
- The warning message below the comment editor.
For example:

### Notifications sent to external participants
External participants get notifications for all public comments on an issue.
For private communication, use [internal notes](../../discussions/_index.md#add-an-internal-note).
External participants don't receive notifications for any other issue or ticket event.
### View all external participants
Get an overview of all external participants that receive a Service Desk email for a new comment.
Prerequisites:
- You must have at least the Reporter role for the project.
To see a list of all external participants:
1. Go to the issue or ticket.
1. Scroll down to the comment editor.
1. If the issue or ticket has external participants, you can see a warning under the comment editor
that lists all external participants.

### Add an external participant
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/350460) in GitLab 13.8 [with a flag](../../feature_flags.md) named `issue_email_participants`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
Add an external participant using the `/add_email` [quick action](../quick_actions.md) when you want
to include them in the conversation at any time.
When added, the external participant starts receiving notifications using Service Desk emails.
New external participants receive the `new_participant` email to let them know they were added to the ticket.
GitLab doesn't send a `thank_you` email for manually added external participants.
You should add external participants in a dedicated comment because they don't receive a notification
email for the comment that contains the `/add_email` quick action.
Prerequisites:
- You must have at least the Reporter role for the project.
To add an external participant to an issue or ticket:
1. Go to the issue or ticket.
1. Add a comment that contains only the quick action `/add_email user@example.com`.
You can chain up to 6 email addresses. For example `/add_email user@example.com user2@example.com`
You should see a success message and a new system note with the email address.
### Remove an external participant
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/350460) in GitLab 13.8 [with a flag](../../feature_flags.md) named `issue_email_participants`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
Remove an external participant from an issue or Service Desk ticket using the `/remove_email`
[quick action](../quick_actions.md) when they should stop receiving notifications.
After removing them from the issue or ticket they don't receive new notifications.
But they can still reply to emails they received before and create a new comment on the issue or ticket.
Prerequisites:
- You must have at least the Reporter role for the project.
- There must be at least one external participant on the issue or ticket.
To remove an existing external participant from an issue or ticket:
1. Go to the issue or ticket.
1. Add a comment that contains only the quick action `/remove_email user@example.com`.
You can chain up to 6 email addresses. For example `/remove_email user@example.com user2@example.com`
You should see a success message and a new system note with the email address.
|
https://docs.gitlab.com/user/project/using_service_desk
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/using_service_desk.md
|
2025-08-13
|
doc/user/project/service_desk
|
[
"doc",
"user",
"project",
"service_desk"
] |
using_service_desk.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Use Service Desk
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
You can use Service Desk to [create an issue](#as-an-end-user-issue-creator) or [respond to one](#as-a-responder-to-the-issue).
In these issues, you can also see our friendly neighborhood [Support Bot](configure.md#support-bot-user).
## View Service Desk email address
To check what the Service Desk email address is for your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
The email address is available at the top of the issue list.
## As an end user (issue creator)
To create a Service Desk issue, an end user does not need to know anything about
the GitLab instance. They just send an email to the address they are given, and
receive an email back from GitLab Support Bot, confirming receipt:
```plaintext
Thank you for your support request! We are tracking your request as ticket `#%{issue_iid}`, and will respond as soon as we can.
```
This email also gives the end user an option to unsubscribe.
If they don't choose to unsubscribe, then any new comments added to the issue
are sent as emails.
Any responses they send by email are displayed in the issue itself.
For additional information see [External participants](external_participants.md) and the
[headers used for treating email](../../../administration/incoming_email.md#accepted-headers).
### Create a Service Desk ticket in GitLab UI
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `convert_to_ticket_quick_action`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.10. Feature flag `convert_to_ticket_quick_action` removed.
{{< /history >}}
To create a Service Desk ticket from the UI:
1. [Create an issue](../issues/create_issues.md)
1. Add a comment that contains only the quick action `/convert_to_ticket user@example.com`.
You should see a comment from the [GitLab Support Bot](configure.md#support-bot-user).
1. Reload the page so the UI reflects the type change.
1. Optional. Add a comment on the ticket to send an initial Service Desk email to the external participant.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a walkthrough, see [Create Service Desk tickets in the UI and API (GitLab 16.10)](https://www.youtube.com/watch?v=ibUGNc2wifQ).
<!-- Video published on 2024-03-05 -->
## As a responder to the issue
For responders to the issue, everything works just like other GitLab issues.
GitLab displays a familiar-looking issue tracker where responders can see
issues created through customer support requests, and filter or interact with them.

Messages from the end user are shown as coming from the special
[Support Bot user](../../../subscriptions/manage_users_and_seats.md#criteria-for-non-billable-users).
You can read and write comments as you usually do in GitLab:
- The project's visibility (private, internal, public) does not affect Service Desk.
- The path to the project, including its group or namespace, is shown in emails.
### View Service Desk issues
Prerequisites:
- You must have at least the Reporter role for the project.
To view Service Desk issues:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
#### Redesigned issue list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/413092) in GitLab 16.1 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_vue_list`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/415385) in GitLab 16.10. Feature flag `service_desk_vue_list` removed.
{{< /history >}}
The Service Desk issue list more closely matches the regular issue list.
Available features include:
- The same sorting and ordering options [as on the issue list](../issues/sorting_issue_lists.md).
- The same filters, including [the OR operator](#filter-with-the-or-operator) and [filtering by issue ID](#filter-issues-by-id).
There is no longer an option to create a new issue from the Service Desk issue list.
This decision better reflects the nature of Service Desk, where new issues are created by emailing
a dedicated email address.
##### Filter the list of issues
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
1. Above the list of issues, select **Search or filter results**.
1. In the dropdown list that appears, select the attribute you want to filter by.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
- `=`: Is
- `!=`: Is not one of
1. Enter the text to filter the attribute by.
You can filter some attributes by **None** or **Any**.
1. Repeat this process to filter by multiple attributes. Multiple attributes are joined by a logical
`AND`.
##### Filter with the OR operator
When [filtering with the OR operator](../issues/managing_issues.md#filter-with-the-or-operator) is enabled,
you can use **is one of: `||`**
when you [filter the list of issues](#filter-the-list-of-issues) by:
- Assignees
- Labels
`is one of` represents an inclusive OR. For example, if you filter by `Assignee is one of Sidney Jones` and
`Assignee is one of Zhang Wei`, GitLab shows issues where either `Sidney`, `Zhang`, or both of them are assignees.
##### Filter issues by ID
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
1. In the **Search** box, type the issue ID. For example, enter filter `#10` to return only issue 10.
## Email contents and formatting
### Special HTML formatting in HTML emails
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109811) in GitLab 15.9 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_html_to_text_email_handler`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116809) in GitLab 15.11. Feature flag `service_desk_html_to_text_email_handler` removed.
{{< /history >}}
HTML emails show HTML formatting, such as:
- Tables
- Blockquotes
- Images
- Collapsible sections
### Files attached to comments
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11733) in GitLab 15.8 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_new_note_email_native_attachments`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/386860) in GitLab 15.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/11733) in GitLab 16.6. Feature flag `service_desk_new_note_email_native_attachments` removed.
{{< /history >}}
If a comment contains any attachments and their total size is less than or equal to 10 MB, these
attachments are sent as part of the email. In other cases, the email contains links to the attachments.
In GitLab 15.9 and earlier, uploads to a comment are sent as links in the email.
## Convert a regular issue to a Service Desk ticket
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `convert_to_ticket_quick_action`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.10. Feature flag `convert_to_ticket_quick_action` removed.
{{< /history >}}
Use the quick action `/convert_to_ticket external-issue-author@example.com` to convert any regular issue
into a Service Desk ticket. This assigns the provided email address as the external author of the ticket
and adds them to the list of external participants. They receive Service Desk emails for any public
comment on the ticket and can reply to these emails. Replies add a new comment on the ticket.
GitLab doesn't send [the default `thank_you` email](configure.md#customize-emails-sent-to-external-participants).
You can add a public comment on the ticket to let the end user know that the ticket has been created.
## Privacy considerations
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108901) the minimum required role to view the creator's and participant's email in GitLab 15.9.
{{< /history >}}
Service Desk issues are [confidential](../issues/confidential_issues.md), so they are
only visible to project members. The project owner can
[make an issue public](../issues/confidential_issues.md#in-an-existing-issue).
When a Service Desk issue becomes public, the issue creator's and participants' email addresses are
visible to signed-in users with at least the Reporter role for the project.
In GitLab 15.8 and earlier, when a Service Desk issue becomes public, the issue creator's email
address is disclosed to everyone who can view the project.
Anyone in your project can use the Service Desk email address to create an issue in this project, **regardless
of their role** in the project.
The unique internal email address is visible to project members at least
the Planner role in your GitLab instance.
An external user (issue creator) cannot see the internal email address
displayed in the information note.
### Moving a Service Desk issue
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/372246) in GitLab 15.7: customers continue receiving notifications when a Service Desk issue is moved.
{{< /history >}}
You can move a Service Desk issue the same way you
[move a regular issue](../issues/managing_issues.md#move-an-issue) in GitLab.
If a Service Desk issue is moved to a different project with Service Desk enabled,
the customer who created the issue continues to receive email notifications.
Because a moved issue is first closed, then copied, the customer is considered to be a participant
in both issues. They continue to receive any notifications in the old issue and the new one.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Use Service Desk
breadcrumbs:
- doc
- user
- project
- service_desk
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
You can use Service Desk to [create an issue](#as-an-end-user-issue-creator) or [respond to one](#as-a-responder-to-the-issue).
In these issues, you can also see our friendly neighborhood [Support Bot](configure.md#support-bot-user).
## View Service Desk email address
To check what the Service Desk email address is for your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
The email address is available at the top of the issue list.
## As an end user (issue creator)
To create a Service Desk issue, an end user does not need to know anything about
the GitLab instance. They just send an email to the address they are given, and
receive an email back from GitLab Support Bot, confirming receipt:
```plaintext
Thank you for your support request! We are tracking your request as ticket `#%{issue_iid}`, and will respond as soon as we can.
```
This email also gives the end user an option to unsubscribe.
If they don't choose to unsubscribe, then any new comments added to the issue
are sent as emails.
Any responses they send by email are displayed in the issue itself.
For additional information see [External participants](external_participants.md) and the
[headers used for treating email](../../../administration/incoming_email.md#accepted-headers).
### Create a Service Desk ticket in GitLab UI
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `convert_to_ticket_quick_action`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.10. Feature flag `convert_to_ticket_quick_action` removed.
{{< /history >}}
To create a Service Desk ticket from the UI:
1. [Create an issue](../issues/create_issues.md)
1. Add a comment that contains only the quick action `/convert_to_ticket user@example.com`.
You should see a comment from the [GitLab Support Bot](configure.md#support-bot-user).
1. Reload the page so the UI reflects the type change.
1. Optional. Add a comment on the ticket to send an initial Service Desk email to the external participant.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a walkthrough, see [Create Service Desk tickets in the UI and API (GitLab 16.10)](https://www.youtube.com/watch?v=ibUGNc2wifQ).
<!-- Video published on 2024-03-05 -->
## As a responder to the issue
For responders to the issue, everything works just like other GitLab issues.
GitLab displays a familiar-looking issue tracker where responders can see
issues created through customer support requests, and filter or interact with them.

Messages from the end user are shown as coming from the special
[Support Bot user](../../../subscriptions/manage_users_and_seats.md#criteria-for-non-billable-users).
You can read and write comments as you usually do in GitLab:
- The project's visibility (private, internal, public) does not affect Service Desk.
- The path to the project, including its group or namespace, is shown in emails.
### View Service Desk issues
Prerequisites:
- You must have at least the Reporter role for the project.
To view Service Desk issues:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
#### Redesigned issue list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/413092) in GitLab 16.1 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_vue_list`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/415385) in GitLab 16.10. Feature flag `service_desk_vue_list` removed.
{{< /history >}}
The Service Desk issue list more closely matches the regular issue list.
Available features include:
- The same sorting and ordering options [as on the issue list](../issues/sorting_issue_lists.md).
- The same filters, including [the OR operator](#filter-with-the-or-operator) and [filtering by issue ID](#filter-issues-by-id).
There is no longer an option to create a new issue from the Service Desk issue list.
This decision better reflects the nature of Service Desk, where new issues are created by emailing
a dedicated email address.
##### Filter the list of issues
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
1. Above the list of issues, select **Search or filter results**.
1. In the dropdown list that appears, select the attribute you want to filter by.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
- `=`: Is
- `!=`: Is not one of
1. Enter the text to filter the attribute by.
You can filter some attributes by **None** or **Any**.
1. Repeat this process to filter by multiple attributes. Multiple attributes are joined by a logical
`AND`.
##### Filter with the OR operator
When [filtering with the OR operator](../issues/managing_issues.md#filter-with-the-or-operator) is enabled,
you can use **is one of: `||`**
when you [filter the list of issues](#filter-the-list-of-issues) by:
- Assignees
- Labels
`is one of` represents an inclusive OR. For example, if you filter by `Assignee is one of Sidney Jones` and
`Assignee is one of Zhang Wei`, GitLab shows issues where either `Sidney`, `Zhang`, or both of them are assignees.
##### Filter issues by ID
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Service Desk**.
1. In the **Search** box, type the issue ID. For example, enter filter `#10` to return only issue 10.
## Email contents and formatting
### Special HTML formatting in HTML emails
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109811) in GitLab 15.9 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_html_to_text_email_handler`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116809) in GitLab 15.11. Feature flag `service_desk_html_to_text_email_handler` removed.
{{< /history >}}
HTML emails show HTML formatting, such as:
- Tables
- Blockquotes
- Images
- Collapsible sections
### Files attached to comments
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11733) in GitLab 15.8 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_new_note_email_native_attachments`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/386860) in GitLab 15.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/11733) in GitLab 16.6. Feature flag `service_desk_new_note_email_native_attachments` removed.
{{< /history >}}
If a comment contains any attachments and their total size is less than or equal to 10 MB, these
attachments are sent as part of the email. In other cases, the email contains links to the attachments.
In GitLab 15.9 and earlier, uploads to a comment are sent as links in the email.
## Convert a regular issue to a Service Desk ticket
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `convert_to_ticket_quick_action`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.10. Feature flag `convert_to_ticket_quick_action` removed.
{{< /history >}}
Use the quick action `/convert_to_ticket external-issue-author@example.com` to convert any regular issue
into a Service Desk ticket. This assigns the provided email address as the external author of the ticket
and adds them to the list of external participants. They receive Service Desk emails for any public
comment on the ticket and can reply to these emails. Replies add a new comment on the ticket.
GitLab doesn't send [the default `thank_you` email](configure.md#customize-emails-sent-to-external-participants).
You can add a public comment on the ticket to let the end user know that the ticket has been created.
## Privacy considerations
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108901) the minimum required role to view the creator's and participant's email in GitLab 15.9.
{{< /history >}}
Service Desk issues are [confidential](../issues/confidential_issues.md), so they are
only visible to project members. The project owner can
[make an issue public](../issues/confidential_issues.md#in-an-existing-issue).
When a Service Desk issue becomes public, the issue creator's and participants' email addresses are
visible to signed-in users with at least the Reporter role for the project.
In GitLab 15.8 and earlier, when a Service Desk issue becomes public, the issue creator's email
address is disclosed to everyone who can view the project.
Anyone in your project can use the Service Desk email address to create an issue in this project, **regardless
of their role** in the project.
The unique internal email address is visible to project members at least
the Planner role in your GitLab instance.
An external user (issue creator) cannot see the internal email address
displayed in the information note.
### Moving a Service Desk issue
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/372246) in GitLab 15.7: customers continue receiving notifications when a Service Desk issue is moved.
{{< /history >}}
You can move a Service Desk issue the same way you
[move a regular issue](../issues/managing_issues.md#move-an-issue) in GitLab.
If a Service Desk issue is moved to a different project with Service Desk enabled,
the customer who created the issue continues to receive email notifications.
Because a moved issue is first closed, then copied, the customer is considered to be a participant
in both issues. They continue to receive any notifications in the old issue and the new one.
|
https://docs.gitlab.com/user/project/service_desk
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/service_desk
|
[
"doc",
"user",
"project",
"service_desk"
] |
_index.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Service Desk
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< alert type="note" >}}
This feature is not under active development, but
[community contributions](https://about.gitlab.com/community/contribute/) are welcome.
To determine if the feature as it is meets your needs, explore the existing documentation or see the
[open issues for the Service Desk category](https://gitlab.com/gitlab-org/gitlab/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Category%3AService%20Desk&first_page_size=100)
to learn more about work that hasn't been done yet.
The decision to deprioritize Service Desk has been made to
focus on building and extending the work item framework which
the Service Desk category will also benefit from long-term.
For the information on moving Service Desk into the work item framework,
see [epic 10772](https://gitlab.com/groups/gitlab-org/-/epics/10772).
{{< /alert >}}
With Service Desk, your customers
can email you bug reports, feature requests, or general feedback.
Service Desk provides a unique email address, so they don't need their own GitLab accounts.
Service Desk emails are created in your GitLab project as new issues.
Your team can respond directly from the project, while customers interact with the thread only
through email.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a video overview, see [Introducing GitLab Service Desk (GitLab 16.7)](https://www.youtube.com/watch?v=LDVQXv3I5rI).
<!-- Video published on 2023-12-19 -->
## Service Desk workflow
For example, let's assume you develop a game for iOS or Android.
The codebase is hosted in your GitLab instance, built and deployed
with GitLab CI/CD.
Here's how Service Desk works for you:
1. You provide a project-specific email address to your paying customers, who can email you directly
from the application.
1. Each email they send creates an issue in the appropriate project.
1. Your team members go to the Service Desk issue tracker, where they can see new support
requests and respond inside associated issues.
1. Your team communicates with the customer to understand the request.
1. Your team starts working on implementing code to solve your customer's problem.
1. When your team finishes the implementation, the merge request is merged and the issue
is closed automatically.
Meanwhile:
- The customer interacts with your team entirely through email, without needing access to your
GitLab instance.
- Your team saves time by not having to leave GitLab (or set up integrations) to follow up with
your customer.
## Related topics
- [Configure Service Desk](configure.md)
- [Improve your project's security](configure.md#improve-your-projects-security)
- [Customize emails sent to external participants](configure.md#customize-emails-sent-to-external-participants)
- [Use a custom template for Service Desk tickets](configure.md#use-a-custom-template-for-service-desk-tickets)
- [Support Bot user](configure.md#support-bot-user)
- [Default ticket visibility](configure.md#default-ticket-visibility)
- [Reopen issues when an external participant comments](configure.md#reopen-issues-when-an-external-participant-comments)
- [Custom email address](configure.md#custom-email-address)
- [Use an additional Service Desk alias email](configure.md#use-an-additional-service-desk-alias-email)
- [Configure email ingestion in multi-node environments](configure.md#configure-email-ingestion-in-multi-node-environments)
- [Use Service Desk](using_service_desk.md)
- [As an end user (issue creator)](using_service_desk.md#as-an-end-user-issue-creator)
- [As a responder to the issue](using_service_desk.md#as-a-responder-to-the-issue)
- [Email contents and formatting](using_service_desk.md#email-contents-and-formatting)
- [Convert a regular issue to a Service Desk ticket](using_service_desk.md#convert-a-regular-issue-to-a-service-desk-ticket)
- [Privacy considerations](using_service_desk.md#privacy-considerations)
- [External Participants](external_participants.md)
- [Service Desk tickets](external_participants.md#service-desk-tickets)
- [As an external participant](external_participants.md#as-an-external-participant)
- [As a GitLab user](external_participants.md#as-a-gitlab-user)
## Troubleshooting Service Desk
### Emails to Service Desk do not create issues
- Your emails might be ignored because they contain one of the
[email headers that GitLab ignores](../../../administration/incoming_email.md#rejected-headers).
- Emails might get dropped if the sender email domain is using strict DKIM rules and there is a verification
failure due to forwarding emails to the project-specific Service Desk address.
A typical DKIM failure message, which can be found in email headers, might look like:
```plaintext
dkim=fail (signature did not verify) ... arc=fail
```
The exact wording of the failure message may vary depending on the specific email system or tools in use.
Also see [this article on DKIM failures](https://automatedemailwarmup.com/blog/dkim-fail/) for more
information and potential solutions.
### Email ingestion doesn't work in 16.6.0
GitLab Self-Managed `16.6.0` introduced a regression that prevents `mail_room` (email ingestion) from starting.
Service Desk and other reply-by-email features don't work.
[Issue 432257](https://gitlab.com/gitlab-org/gitlab/-/issues/432257) tracks fixing this problem.
The workaround is to run the following commands in your GitLab installation
to patch the affected files:
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
```shell
curl --output /tmp/mailroom.patch --url "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137279.diff"
patch -p1 -d /opt/gitlab/embedded/service/gitlab-rails < /tmp/mailroom.patch
gitlab-ctl restart mailroom
```
{{< /tab >}}
{{< tab title="Docker" >}}
```shell
curl --output /tmp/mailroom.patch --url "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137279.diff"
cd /opt/gitlab/embedded/service/gitlab-rails
patch -p1 < /tmp/mailroom.patch
gitlab-ctl restart mailroom
```
{{< /tab >}}
{{< /tabs >}}
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Service Desk
breadcrumbs:
- doc
- user
- project
- service_desk
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< alert type="note" >}}
This feature is not under active development, but
[community contributions](https://about.gitlab.com/community/contribute/) are welcome.
To determine if the feature as it is meets your needs, explore the existing documentation or see the
[open issues for the Service Desk category](https://gitlab.com/gitlab-org/gitlab/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Category%3AService%20Desk&first_page_size=100)
to learn more about work that hasn't been done yet.
The decision to deprioritize Service Desk has been made to
focus on building and extending the work item framework which
the Service Desk category will also benefit from long-term.
For the information on moving Service Desk into the work item framework,
see [epic 10772](https://gitlab.com/groups/gitlab-org/-/epics/10772).
{{< /alert >}}
With Service Desk, your customers
can email you bug reports, feature requests, or general feedback.
Service Desk provides a unique email address, so they don't need their own GitLab accounts.
Service Desk emails are created in your GitLab project as new issues.
Your team can respond directly from the project, while customers interact with the thread only
through email.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a video overview, see [Introducing GitLab Service Desk (GitLab 16.7)](https://www.youtube.com/watch?v=LDVQXv3I5rI).
<!-- Video published on 2023-12-19 -->
## Service Desk workflow
For example, let's assume you develop a game for iOS or Android.
The codebase is hosted in your GitLab instance, built and deployed
with GitLab CI/CD.
Here's how Service Desk works for you:
1. You provide a project-specific email address to your paying customers, who can email you directly
from the application.
1. Each email they send creates an issue in the appropriate project.
1. Your team members go to the Service Desk issue tracker, where they can see new support
requests and respond inside associated issues.
1. Your team communicates with the customer to understand the request.
1. Your team starts working on implementing code to solve your customer's problem.
1. When your team finishes the implementation, the merge request is merged and the issue
is closed automatically.
Meanwhile:
- The customer interacts with your team entirely through email, without needing access to your
GitLab instance.
- Your team saves time by not having to leave GitLab (or set up integrations) to follow up with
your customer.
## Related topics
- [Configure Service Desk](configure.md)
- [Improve your project's security](configure.md#improve-your-projects-security)
- [Customize emails sent to external participants](configure.md#customize-emails-sent-to-external-participants)
- [Use a custom template for Service Desk tickets](configure.md#use-a-custom-template-for-service-desk-tickets)
- [Support Bot user](configure.md#support-bot-user)
- [Default ticket visibility](configure.md#default-ticket-visibility)
- [Reopen issues when an external participant comments](configure.md#reopen-issues-when-an-external-participant-comments)
- [Custom email address](configure.md#custom-email-address)
- [Use an additional Service Desk alias email](configure.md#use-an-additional-service-desk-alias-email)
- [Configure email ingestion in multi-node environments](configure.md#configure-email-ingestion-in-multi-node-environments)
- [Use Service Desk](using_service_desk.md)
- [As an end user (issue creator)](using_service_desk.md#as-an-end-user-issue-creator)
- [As a responder to the issue](using_service_desk.md#as-a-responder-to-the-issue)
- [Email contents and formatting](using_service_desk.md#email-contents-and-formatting)
- [Convert a regular issue to a Service Desk ticket](using_service_desk.md#convert-a-regular-issue-to-a-service-desk-ticket)
- [Privacy considerations](using_service_desk.md#privacy-considerations)
- [External Participants](external_participants.md)
- [Service Desk tickets](external_participants.md#service-desk-tickets)
- [As an external participant](external_participants.md#as-an-external-participant)
- [As a GitLab user](external_participants.md#as-a-gitlab-user)
## Troubleshooting Service Desk
### Emails to Service Desk do not create issues
- Your emails might be ignored because they contain one of the
[email headers that GitLab ignores](../../../administration/incoming_email.md#rejected-headers).
- Emails might get dropped if the sender email domain is using strict DKIM rules and there is a verification
failure due to forwarding emails to the project-specific Service Desk address.
A typical DKIM failure message, which can be found in email headers, might look like:
```plaintext
dkim=fail (signature did not verify) ... arc=fail
```
The exact wording of the failure message may vary depending on the specific email system or tools in use.
Also see [this article on DKIM failures](https://automatedemailwarmup.com/blog/dkim-fail/) for more
information and potential solutions.
### Email ingestion doesn't work in 16.6.0
GitLab Self-Managed `16.6.0` introduced a regression that prevents `mail_room` (email ingestion) from starting.
Service Desk and other reply-by-email features don't work.
[Issue 432257](https://gitlab.com/gitlab-org/gitlab/-/issues/432257) tracks fixing this problem.
The workaround is to run the following commands in your GitLab installation
to patch the affected files:
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
```shell
curl --output /tmp/mailroom.patch --url "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137279.diff"
patch -p1 -d /opt/gitlab/embedded/service/gitlab-rails < /tmp/mailroom.patch
gitlab-ctl restart mailroom
```
{{< /tab >}}
{{< tab title="Docker" >}}
```shell
curl --output /tmp/mailroom.patch --url "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137279.diff"
cd /opt/gitlab/embedded/service/gitlab-rails
patch -p1 < /tmp/mailroom.patch
gitlab-ctl restart mailroom
```
{{< /tab >}}
{{< /tabs >}}
|
https://docs.gitlab.com/user/project/configure
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/configure.md
|
2025-08-13
|
doc/user/project/service_desk
|
[
"doc",
"user",
"project",
"service_desk"
] |
configure.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Configure Service Desk
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
By default, Service Desk is active in new projects.
If it's not active, you can do it in the project's settings.
Prerequisites:
- You must have at least the Maintainer role for the project.
- On GitLab Self-Managed, you must [set up incoming email](../../../administration/incoming_email.md#set-it-up)
for the GitLab instance. You should use
[email sub-addressing](../../../administration/incoming_email.md#email-sub-addressing),
but you can also use [catch-all mailboxes](../../../administration/incoming_email.md#catch-all-mailbox).
To do this, you must have administrator access.
- You must have enabled [issue](../settings/_index.md#configure-project-features-and-permissions)
tracker for the project.
To enable Service Desk in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Turn on the **Activate Service Desk** toggle.
1. Optional. Complete the fields.
- [Add a suffix](#configure-a-suffix-for-service-desk-alias-email) to your Service Desk email address.
- If the list below **Template to append to all Service Desk issues** is empty, create a
[description template](../description_templates.md) in your repository.
1. Select **Save changes**.
Service Desk is now enabled for this project.
If anyone sends an email to the address available below **Email address to use for Service Desk**,
GitLab creates a confidential issue with the email's content.
## Service Desk glossary
This glossary provides definitions for terms related to Service Desk.
| Term | Definition |
|--------------------------------------------------|------------|
| [External participant](external_participants.md) | Users without a GitLab account that can interact with an issue or Service Desk ticket only by email. |
| Requester | External participant that created the Service Desk ticket or was added as requester using the [`/convert_to_ticket` quick action](using_service_desk.md#create-a-service-desk-ticket-in-gitlab-ui). |
## Improve your project's security
To improve your Service Desk project's security, you should:
- Put the Service Desk email address behind an alias on your email system so you can change it later.
- [Enable Akismet](../../../integration/akismet.md) on your GitLab instance to add spam checking to this service.
Unblocked email spam can result in many spam issues being created.
## Customize emails sent to external participants
{{< history >}}
- `UNSUBSCRIBE_URL`, `SYSTEM_HEADER`, `SYSTEM_FOOTER`, and `ADDITIONAL_TEXT` placeholders [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/285512) in GitLab 15.9.
- `%{ISSUE_DESCRIPTION}` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/223751) in GitLab 16.0.
- `%{ISSUE_URL}` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/408793) in GitLab 16.1.
{{< /history >}}
An email is sent to external participants when:
- A requester submits a new ticket by emailing Service Desk.
- An external participant is added to a Service Desk ticket.
- A new public comment is added on a Service Desk ticket.
- Editing a comment does not trigger a new email to be sent.
You can customize the body of these email messages with Service Desk email templates. The templates
can include [GitLab Flavored Markdown](../../markdown.md) and [some HTML tags](../../markdown.md#inline-html).
For example, you can format the emails to include a header and footer in accordance with your
organization's brand guidelines. You can also include the following placeholders to display dynamic
content specific to the Service Desk ticket or your GitLab instance.
| Placeholder | `thank_you.md` and `new_participant` | `new_note.md` | Description |
|------------------------|--------------------------------------|------------------------|-------------|
| `%{ISSUE_ID}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Ticket IID. |
| `%{ISSUE_PATH}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Project path appended with the ticket IID. |
| `%{ISSUE_URL}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | URL of the ticket. External participants can only view the ticket if the project is public and ticket is not confidential (Service Desk tickets are confidential by default). |
| `%{ISSUE_DESCRIPTION}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Ticket description. If a user has edited the description, it may contain sensitive information that is not intended to be delivered to external participants. Use this placeholder with care and ideally only if you never modify descriptions or your team is aware of the template design. |
| `%{UNSUBSCRIBE_URL}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Unsubscribe URL. Learn how to [unsubscribe as an external participant](external_participants.md#unsubscribing-from-notification-emails) and [use unsubscribe headers in notification emails from GitLab](../../profile/notifications.md#using-an-email-client-or-other-software). |
| `%{NOTE_TEXT}` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | The new comment added to the ticket by a user. Take care to include this placeholder in `new_note.md`. Otherwise, the external participants may never see the updates on their Service Desk ticket. |
### Thank you email
When a requester submits an issue through Service Desk, GitLab sends a **thank you email**.
Without additional configuration, GitLab sends the default thank you email.
To create a custom thank you email template:
1. In the `.gitlab/service_desk_templates/` directory of your repository, create a file named `thank_you.md`.
1. Populate the Markdown file with text, [GitLab Flavored Markdown](../../markdown.md),
[some selected HTML tags](../../markdown.md#inline-html), and placeholders to customize the reply
to Service Desk requesters.
### New participant email
{{< history >}}
- `new_participant` email [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299261) in GitLab 17.0.
{{< /history >}}
When an [external participant](external_participants.md) is added to the ticket, GitLab sends a **new participant email** to let them know they are part of the conversation.
Without additional configuration, GitLab sends the default new participant email.
To create a custom new participant email template:
1. In the `.gitlab/service_desk_templates/` directory of your repository, create a file named `new_participant.md`.
1. Populate the Markdown file with text, [GitLab Flavored Markdown](../../markdown.md),
[some selected HTML tags](../../markdown.md#inline-html), and placeholders to customize the reply
to Service Desk requesters.
### New note email
When a Service Desk ticket has a new public comment, GitLab sends a **new note email**.
Without additional configuration, GitLab sends the content of the comment.
To keep your emails on brand, you can create a custom new note email template. To do so:
1. In the `.gitlab/service_desk_templates/` directory in your repository, create a file named `new_note.md`.
1. Populate the Markdown file with text, [GitLab Flavored Markdown](../../markdown.md),
[some selected HTML tags](../../markdown.md#inline-html), and placeholders to customize the new note
email. Be sure to include the `%{NOTE_TEXT}` in the template to make sure the email recipient can
read the contents of the comment.
### Instance-wide email header, footer, and additional text
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/344819) in GitLab 15.9.
{{< /history >}}
Instance administrators can add a header, footer or additional text to the GitLab instance and apply
them to all emails sent from GitLab. If you're using a custom `thank_you.md`, `new_participant` or `new_note.md`, to include
this content, add `%{SYSTEM_HEADER}`, `%{SYSTEM_FOOTER}`, or `%{ADDITIONAL_TEXT}` to your templates.
For more information, see [System header and footer messages](../../../administration/appearance.md#add-system-header-and-footer-messages) and [custom additional text](../../../administration/settings/email.md#custom-additional-text).
## Use a custom template for Service Desk tickets
You can select one [description template](../description_templates.md#create-a-description-template)
**per project** to be appended to every new Service Desk ticket's description.
You can set description templates at various levels:
- The entire [instance](../description_templates.md#set-instance-level-description-templates).
- A specific [group or subgroup](../description_templates.md#set-group-level-description-templates).
- A specific [project](../description_templates.md#set-a-default-template-for-merge-requests-and-issues).
The templates are inherited. For example, in a project, you can also access templates set for the instance, or the project's parent groups.
Prerequisites:
- You must have [created a description template](../description_templates.md#create-a-description-template).
To use a custom description template with Service Desk:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. From the dropdown list **Template to append to all Service Desk issues**, search or select your template.
## Support Bot user
Behind the scenes, Service Desk works by the special Support Bot user creating issues.
This user isn't a [billable user](../../../subscriptions/manage_users_and_seats.md#criteria-for-non-billable-users),
so it does not count toward the license limit count.
In GitLab 16.0 and earlier, comments generated from Service Desk emails show `GitLab Support Bot`
as the author. In [GitLab 16.1 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/226995),
these comments show the email of the user who sent the email.
This feature only applies to comments made in GitLab 16.1 and later.
### Change the Support Bot's display name
You can change the display name of the Support Bot user. Emails sent from Service Desk have
this name in the `From` header. The default display name is `GitLab Support Bot`.
To edit the custom email display name:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Below **Email display name**, enter a new name.
1. Select **Save changes**.
## Default ticket visibility
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/33091) in GitLab 17.2.
{{< /history >}}
New tickets are confidential by default, so only project members with at least the Planner role
can view them.
In private and internal projects, you can configure GitLab so that new tickets are not confidential by default, and any project member can view them.
In public projects, this setting is not available because new tickets are always confidential by default.
Prerequisites:
- You must have at least the Maintainer role for the project.
To disable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Clear the **New tickets are confidential by default** checkbox.
1. Select **Save changes**.
## Reopen issues when an external participant comments
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/8549) in GitLab 16.7
{{< /history >}}
You can configure GitLab to reopen closed issues when an external participant adds
a new comment on an issue by email. This also adds an internal comment that mentions
the assignees of the issue and creates to-do items for them.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a walkthrough, see [a short showcase video](https://youtu.be/163wDM1e43o).
<!-- Video published on 2023-12-12 -->
Prerequisites:
- You must have at least the Maintainer role for the project.
To enable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Select the **Reopen issues on a new note from an external participant** checkbox.
1. Select **Save changes**.
## Custom email address
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329990) in GitLab 16.3 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_custom_email`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/387003) in GitLab 16.4.
- Ability to select the SMTP authentication method [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429680) in GitLab 16.6.
- [Feature flag `service_desk_custom_email` removed](https://gitlab.com/gitlab-org/gitlab/-/issues/387003) in GitLab 16.7.
- Local network allowed for SMTP host on GitLab Self-Managed [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/435206) in GitLab 16.7.
{{< /history >}}
Configure a custom email address to show as the sender of your support communication.
Maintain brand identity and instill confidence among support requesters with a domain they recognize.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [a short showcase video](https://youtu.be/_moD5U3xcQs).
<!-- Video published on 2023-09-12 -->
This feature is in [beta](../../../policy/development_stages_support.md#beta).
A beta feature is not production-ready, but is unlikely to change drastically
before it's released. We encourage users to try beta features and provide feedback
in [the feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/416637).
### Prerequisites
You can use one custom email address for Service Desk per project and it must be unique across the instance.
The custom email address you want to use must meet all of the following requirements:
- You can set up email forwarding.
- Forwarded emails preserve the original `From` header.
- Your service provider must support sub-addressing. An email address consists of a local part (everything before `@`) and a
domain part.
With email sub-addressing you can create unique variations of an email address by adding a `+` symbol followed
by any text to the local part. Given the email address `support@example.com`, check whether sub-addressing is supported by
sending an email to `support+1@example.com`. This email should appear in your mailbox.
- You have SMTP credentials (ideally, you should use an app password).
The username and password are stored in the database using the Advanced Encryption Standard (AES)
with a 256-bit key.
- The **SMTP host** must be resolvable from the network of your GitLab instance (on GitLab Self-Managed)
or the public internet (on GitLab.com).
- You must have at least the Maintainer role for the project.
- Service Desk must be configured for the project.
### Configure a custom email address
Configure and verify a custom email address when you want to send Service Desk emails using your own email address.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk** and find the **Configure a custom email address** section.
1. Note the presented Service Desk address of this project, and with your email provider
(for example, Gmail), set up email forwarding from the custom email address to the
Service Desk address.
1. Back in GitLab, complete the fields.
1. Select **Save & test connection**.
The configuration has been saved and the verification of the custom email address is triggered.
#### Verification
1. After completing the configuration, all project owners and the administrator that saved the custom email configuration receive a notification email.
1. A verification email is sent using the provided SMTP credentials to the custom email address (with a sub-addressing part).
The email contains a verification token. When email forwarding is set up correctly and all prerequisites are met,
the email is forwarded to your Service Desk address and ingested by GitLab. GitLab checks the following conditions:
1. GitLab can send an email using the SMTP credentials.
1. Sub-addressing is supported (with the `+verify` sub-addressing part).
1. `From` header is preserved after forwarding.
1. Verification token is correct.
1. Email is received in 30 minutes.
Typically the process takes only a few minutes.
To cancel verification at any time or if it fails, select **Reset custom email**.
The settings page updates accordingly and reflects the current state of the verification.
The SMTP credentials are deleted and you can start the configuration again.
On failure and success all project owners and the user who triggered the verification process receive a
notification email with the verification result.
If the verification failed, the email also contains details of the reason.
If the verification was successful, the custom email address is ready to be used.
You can now enable sending Service Desk emails with the custom email address.
#### Troubleshooting your configuration
When configuring a custom email you might encounter the following issues.
##### Invalid credentials
You might get an error that states that invalid credentials were used.
This occurs when the SMTP server returns that the authentication wasn't successful.
To troubleshoot this:
1. Check your SMTP credentials, especially the username and password.
1. Sometimes GitLab cannot automatically select an authentication method that the SMTP server supports. Either:
- Try the available authentication methods (**Plain**, **Login** and **CRAM-MD5**).
- Check which authentication methods your SMTP server supports, using the
[`swaks` command line tool](https://www.jetmore.org/john/code/swaks/):
1. Run the following command with your credentials and look for a line that starts with `250-AUTH`:
```shell
swaks --to user@example.com \
--from support@example.com \
--auth-user support@example.com \
--server smtp@example.com:587 \
-tls-optional \
--auth-password your-app-password
```
1. Select one of the supported authentication methods in the custom email setup form.
##### Incorrect forwarding target
You might get an error that states that an incorrect forwarding target was used.
This occurs when the verification email was forwarded to a different email address than the
project-specific Service Desk address that's displayed in the custom email configuration form.
You must use the Service Desk address generated from `incoming_email`. Forwarding to the additional
Service Desk alias address generated from `service_desk_email` is not supported because it doesn't support
all reply by email functionalities.
To troubleshoot this:
1. Find the correct email address to forward emails to. Either:
- Note the address from the verification result email that all project owners and the user that
triggered the verification process receive.
- Copy the address from the **Service Desk email address to forward emails to** input in the
custom email setup form.
1. Forward all emails to the custom email address to the correct target email address.
### Enable or disable the custom email address
After the custom email address has been verified, administrators can enable or disable sending Service Desk emails with the custom email address.
To **enable** the custom email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Turn on the **Enable custom email** toggle.
Service Desk emails to external participants are sent using the SMTP credentials.
To **disable** the custom email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Turn off the **Enable custom email** toggle.
Because you set up email forwarding, emails to your custom email address continue to be processed and
appear as Service Desk Tickets in your project.
Service Desk emails to external participants are now sent using the GitLab instance's default outgoing
email configuration.
### Change or remove custom email configuration
To change the custom email configuration you must reset and remove it and configure custom email again.
To reset the configuration at any step in the process, select **Reset custom email**.
The credentials are then removed from the database.
### Custom email reply address
External participants can [reply by email](../../../administration/reply_by_email.md) to Service Desk tickets.
GitLab uses an email reply address with a 32-character reply key that corresponds to the ticket.
When a custom email is configured, GitLab generates the reply address from that email.
### Use Google Workspace with your own domain
Set up a custom email address for Service Desk when using Google Workspace with your own domain.
Prerequisites:
- You already have a Google Workspace account.
- You can create new accounts for your tenant.
To configure a custom Service Desk email address with Google Workspace:
1. [Configure a Google Workspace account](#configure-a-google-workspace-account).
1. [Configure email forwarding in Google Workspace](#configure-email-forwarding-in-google-workspace).
1. [Configure custom email address using a Google Workspace account](#configure-custom-email-address-using-a-google-workspace-account).
#### Configure a Google Workspace account
First, you must create and configure a Google Workspace account.
In Google Workspace:
1. Create a new account for the custom email address you'd like to use (for example, `support@example.com`).
1. Sign in to that account and activate
[two-factor authentication](https://myaccount.google.com/u/3/signinoptions/two-step-verification).
1. [Create an app password](https://myaccount.google.com/u/3/apppasswords) that you can use as your
SMTP password.
Store it in a secure place and remove spaces between the characters.
Next, you must [configure email forwarding in Google Workspace](#configure-email-forwarding-in-google-workspace).
#### Configure email forwarding in Google Workspace
The following steps require moving between GitLab and Google Workspace.
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk**.
1. Note the email address below **Service Desk email address to forward emails to**.
In Google Workspace:
1. Sign in to the custom email account and open the [Forwarding and POP/IMAP](https://mail.google.com/mail/u/0/#settings/fwdandpop) settings page.
1. Select **Add a forwarding address**.
1. Enter the Service Desk address from the custom email form.
1. Select **Next**.
1. Confirm your input and select **Proceed**. Google sends an email to the Service Desk address and
requires a confirmation code.
In GitLab:
1. Go to **Issues** of the project and wait for a new issue to be created from the confirmation
email from Google.
1. Open the issue and note the confirmation code.
1. (Optional) Delete the issue.
In Google Workspace:
1. Enter the confirmation code and select **Verify**.
1. Select **Forward a copy of incoming mail to** and make sure the Service Desk address is selected
from the dropdown list.
1. At the bottom of the page, select **Save Changes**.
Next, [configure custom email address using a Google Workspace account](#configure-custom-email-address-using-a-google-workspace-account)
to use with Service Desk.
#### Configure custom email address using a Google Workspace account
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk** and find the custom email settings.
1. Complete the fields:
- **Custom email address**: Your custom email address.
- **SMTP host**: `smtp.gmail.com`.
- **SMTP port**: `587`.
- **SMTP username**: Prefilled with the custom email address.
- **SMTP password**: The app password you previously created for the custom email account.
- **SMTP authentication method**: Let GitLab select a server-supported method (recommended)
1. Select **Save and test connection**
1. After the [verification process](#verification) you should be able to
[enable the custom email address](#enable-or-disable-the-custom-email-address).
### Use Microsoft 365 (Exchange online) with your own domain
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/496396) in GitLab 17.5.
{{< /history >}}
Set up a custom email address for Service Desk when using Microsoft 365 (Exchange) with your own domain.
Prerequisites:
- You already have a Microsoft 365 account.
- You can create new accounts for your tenant.
To configure a custom Service Desk email address with Microsoft 365:
1. [Configure a Microsoft 365 account](#configure-a-microsoft-365-account).
1. [Configure email forwarding in Microsoft 365](#configure-email-forwarding-in-microsoft-365).
1. [Configure custom email address using a Microsoft 365 account](#configure-custom-email-address-using-a-microsoft-365-account).
#### Configure a Microsoft 365 account
First, you must create and configure a Microsoft 365 account.
In this guide, use a licensed user for the custom email mailbox.
You can also experiment with other configuration options.
In [Microsoft 365 admin center](https://admin.microsoft.com/Adminportal/Home#/homepage):
1. Create a new account for the custom email address you'd like to use (for example, `support@example.com`).
1. Expand the **Users** section and select **Active users** from the menu.
1. Select **Add a user** and follow the instructions on the screen.
1. In Microsoft Entra (previously named Active Directory), enable two-factor authentication for the account.
1. [Allow users to create app passwords](https://learn.microsoft.com/en-us/entra/identity/authentication/howto-mfa-app-passwords).
1. Enable **Authenticated SMTP** for the account.
1. Select the account from the list.
1. In the drawer select **Mail**.
1. Below **Email apps** select **Manage email apps**.
1. Check **Authenticated SMTP** and select **Save changes**.
1. Depending on your overall Exchange online configuration you might need to configure the following:
1. Use Azure Cloud Shell to allow SMTP client authentication:
```powershell
Set-TransportConfig -SmtpClientAuthenticationDisabled $false
```
1. Use Azure Cloud Shell to allow
[legacy TLS clients using SMTP AUTH](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/opt-in-exchange-online-endpoint-for-legacy-tls-using-smtp-auth):
```powershell
Set-TransportConfig -AllowLegacyTLSClients $true
```
1. If you want to forward to an external recipient, see this guide on how to enable
[external email forwarding](https://learn.microsoft.com/en-gb/defender-office-365/outbound-spam-policies-external-email-forwarding).
You might also want to [create an outbound anti-spam policy](https://security.microsoft.com/antispam)
to allow forwarding to external recipients only for users who need it.
1. Sign in to that account and activate two-factor authentication.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
1. From the menu in the upper-right corner, select **View account** and [browse to **Security Info**](https://mysignins.microsoft.com/security-info).
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Select **Add sign-in method** and select a method that works for you (authenticator app, phone or email).
1. Follow the instructions on the screen.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
1. On the [**Security Info**](https://mysignins.microsoft.com/security-info) page,
create an app password that you can use as your SMTP password.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Select **Add sign-in method** and select **App password** from the dropdown list.
1. Set a descriptive name for the app password, such as `GitLab SD`.
1. Select **Next**.
1. Copy the displayed password and store it in a secure place.
1. Optional. Ensure you can send emails using SMTP using the [`swaks` command line tool](https://www.jetmore.org/john/code/swaks/).
1. Run the following command with your credentials and use the app password as the `auth-password`:
```shell
swaks --to your-email@example.com \
--from custom-email@example.com \
--auth-user custom-email@example.com \
--server smtp.office365.com:587 \
-tls-optional \
--auth-password <your_app_password>
```
Next, you must [configure email forwarding in Microsoft 365](#configure-email-forwarding-in-microsoft-365).
#### Configure email forwarding in Microsoft 365
The following steps require moving between GitLab and Microsoft 365 admin center.
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk**.
1. Note the email address below **Service Desk email address to forward emails to** without the
sub-address part.
Emails aren't forwarded if the recipient address contains a sub-address (for example reply
addresses generated by GitLab) and the forwarding email address contains a sub-address
(the **Service Desk email address to forward emails to**).
For example, `incoming+group-project-12346426-issue-@incoming.gitlab.com` becomes `incoming@incoming.gitlab.com`.
That's okay because Exchange online preserves the custom email address in the `To` header
after forwarding and GitLab can assign the correct project based on the custom email address.
In [Microsoft 365 admin center](https://admin.microsoft.com/Adminportal/Home#/homepage):
<!-- vale gitlab_base.SubstitutionWarning = NO -->
1. Expand the **Users** section and select **Active users** from the menu.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Select the account you'd like to use for the custom email from the list.
1. In the drawer select **Mail**.
1. Below **Email forwarding** select **Manage email forwarding**.
1. Check **Forward all emails sent to this mailbox**.
1. Enter the Service Desk address from the custom email form in **Forwarding email address** without the sub-address part.
1. Select **Save changes**.
Next, [configure a custom email address using a Microsoft 365 account](#configure-custom-email-address-using-a-microsoft-365-account)
to use with Service Desk.
#### Configure custom email address using a Microsoft 365 account
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk** and find the custom email settings.
1. Complete the fields:
- **Custom email address**: Your custom email address.
- **SMTP host**: `smtp.office365.com`.
- **SMTP port**: `587`.
- **SMTP username**: Prefilled with the custom email address.
- **SMTP password**: The app password you previously created for the custom email account.
- **SMTP authentication method**: Login
1. Select **Save and test connection**
1. After the [verification process](#verification) you should be able to
[enable the custom email address](#enable-or-disable-the-custom-email-address).
### Known issues
- Some service providers don't allow SMTP connections any more.
Often you can enable them on a per user basis and create an app password.
## Use an additional Service Desk alias email
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
{{< /details >}}
You can use an additional alias email address for Service Desk for an instance.
To do this, you must configure
a [`service_desk_email`](#configure-service-desk-alias-email) in the instance configuration. You can also configure a
[custom suffix](#configure-a-suffix-for-service-desk-alias-email) that replaces the default `-issue-` portion on the sub-addressing part.
### Configure Service Desk alias email
{{< alert type="note" >}}
On GitLab.com a custom mailbox is already configured with `contact-project+%{key}@incoming.gitlab.com` as the email address. You can still configure the
[custom suffix](#configure-a-suffix-for-service-desk-alias-email) in project settings.
{{< /alert >}}
Service Desk uses the [incoming email](../../../administration/incoming_email.md)
configuration by default. However, to have a separate email address for Service Desk,
configure `service_desk_email` with a [custom suffix](#configure-a-suffix-for-service-desk-alias-email)
in project settings.
Prerequisites:
- The `address` must include the `+%{key}` placeholder in the `user` portion of the address,
before the `@`. The placeholder is used to identify the project where the issue should be created.
- The `service_desk_email` and `incoming_email` configurations must always use separate mailboxes
to make sure Service Desk emails are processed correctly.
To configure a custom mailbox for Service Desk with IMAP, add the following snippets to your configuration file in full:
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
{{< alert type="note" >}}
In GitLab 15.3 and later, Service Desk uses `webhook` (internal API call) by default instead of enqueuing a Sidekiq job.
To use `webhook` on a Linux package installation running GitLab 15.3, you must generate a secret file.
For more information, see [merge request 5927](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/5927).
In GitLab 15.4, reconfiguring a Linux package installation generates this secret file automatically, so no
secret file configuration setting is needed.
For more information, see [issue 1462](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/1462).
{{< /alert >}}
```ruby
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@gmail.com"
gitlab_rails['service_desk_email_email'] = "project_contact@gmail.com"
gitlab_rails['service_desk_email_password'] = "[REDACTED]"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_idle_timeout'] = 60
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_host'] = "imap.gmail.com"
gitlab_rails['service_desk_email_port'] = 993
gitlab_rails['service_desk_email_ssl'] = true
gitlab_rails['service_desk_email_start_tls'] = false
```
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
```yaml
service_desk_email:
enabled: true
address: "project_contact+%{key}@example.com"
user: "project_contact@example.com"
password: "[REDACTED]"
host: "imap.gmail.com"
delivery_method: webhook
secret_file: .gitlab-mailroom-secret
port: 993
ssl: true
start_tls: false
log_path: "log/mailroom.log"
mailbox: "inbox"
idle_timeout: 60
expunge_deleted: true
```
{{< /tab >}}
{{< /tabs >}}
The configuration options are the same as for configuring
[incoming email](../../../administration/incoming_email.md#set-it-up).
#### Use encrypted credentials
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108279) in GitLab 15.9.
{{< /history >}}
Instead of having the Service Desk email credentials stored in plaintext in the configuration files, you can optionally
use an encrypted file for the incoming email credentials.
Prerequisites:
- To use encrypted credentials, you must first enable the
[encrypted configuration](../../../administration/encrypted_configuration.md).
The supported configuration items for the encrypted file are:
- `user`
- `password`
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
1. If initially your Service Desk configuration in `/etc/gitlab/gitlab.rb` looked like:
```ruby
gitlab_rails['service_desk_email_email'] = "service-desk-email@mail.example.com"
gitlab_rails['service_desk_email_password'] = "examplepassword"
```
1. Edit the encrypted secret:
```shell
sudo gitlab-rake gitlab:service_desk_email:secret:edit EDITOR=vim
```
1. Enter the unencrypted contents of the Service Desk email secret:
```yaml
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit `/etc/gitlab/gitlab.rb` and remove the `service_desk` settings for `email` and `password`.
1. Save the file and reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
{{< /tab >}}
{{< tab title="Helm chart (Kubernetes)" >}}
Use a Kubernetes secret to store the Service Desk email password. For more information,
read about [Helm IMAP secrets](https://docs.gitlab.com/charts/installation/secrets.html#imap-password-for-service-desk-emails).
{{< /tab >}}
{{< tab title="Docker" >}}
1. If initially your Service Desk configuration in `docker-compose.yml` looked like:
```yaml
version: "3.6"
services:
gitlab:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['service_desk_email_email'] = "service-desk-email@mail.example.com"
gitlab_rails['service_desk_email_password'] = "examplepassword"
```
1. Get inside the container, and edit the encrypted secret:
```shell
sudo docker exec -t <container_name> bash
gitlab-rake gitlab:service_desk_email:secret:edit EDITOR=editor
```
1. Enter the unencrypted contents of the Service Desk secret:
```yaml
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit `docker-compose.yml` and remove the `service_desk` settings for `email` and `password`.
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
1. If initially your Service Desk configuration in `/home/git/gitlab/config/gitlab.yml` looked like:
```yaml
production:
service_desk_email:
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit the encrypted secret:
```shell
bundle exec rake gitlab:service_desk_email:secret:edit EDITOR=vim RAILS_ENVIRONMENT=production
```
1. Enter the unencrypted contents of the Service Desk secret:
```yaml
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit `/home/git/gitlab/config/gitlab.yml` and remove the `service_desk_email:` settings for `user` and `password`.
1. Save the file and restart GitLab and Mailroom
```shell
# For systems running systemd
sudo systemctl restart gitlab.target
# For systems running SysV init
sudo service gitlab restart
```
{{< /tab >}}
{{< /tabs >}}
#### Microsoft Graph
{{< history >}}
- [Introduced for self-compiled (source) installs](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116494) in GitLab 15.11.
{{< /history >}}
`service_desk_email` can be configured to read Microsoft Exchange Online mailboxes with the Microsoft
Graph API instead of IMAP. Set up an OAuth 2.0 application for Microsoft Graph
[the same way as for incoming email](../../../administration/incoming_email.md#microsoft-graph).
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines, substituting
the values you want:
```ruby
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.onmicrosoft.com"
gitlab_rails['service_desk_email_email'] = "project_contact@example.onmicrosoft.com"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azure_ad_endpoint` and `graph_endpoint` settings. For example:
```ruby
gitlab_rails['service_desk_email_inbox_options'] = {
'azure_ad_endpoint': 'https://login.microsoftonline.us',
'graph_endpoint': 'https://graph.microsoft.us',
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
{{< /tab >}}
{{< tab title="Helm chart (Kubernetes)" >}}
1. Create the [Kubernetes Secret containing the OAuth 2.0 application client secret](https://docs.gitlab.com/charts/installation/secrets.html#microsoft-graph-client-secret-for-service-desk-emails):
```shell
kubectl create secret generic service-desk-email-client-secret --from-literal=secret=<YOUR-CLIENT_SECRET>
```
1. Create the [Kubernetes Secret for the GitLab Service Desk email auth token](https://docs.gitlab.com/charts/installation/secrets.html#gitlab-service-desk-email-auth-token).
Replace `<name>` with the name of the [Helm release name](https://helm.sh/docs/intro/using_helm/) for the GitLab installation:
```shell
kubectl create secret generic <name>-service-desk-email-auth-token --from-literal=authToken=$(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 32 | base64)
```
1. Export the Helm values:
```shell
helm get values gitlab > gitlab_values.yaml
```
1. Edit `gitlab_values.yaml`:
```yaml
global:
appConfig:
serviceDeskEmail:
enabled: true
address: "project_contact+%{key}@example.onmicrosoft.com"
user: "project_contact@example.onmicrosoft.com"
mailbox: inbox
inboxMethod: microsoft_graph
azureAdEndpoint: https://login.microsoftonline.com
graphEndpoint: https://graph.microsoft.com
tenantId: "YOUR-TENANT-ID"
clientId: "YOUR-CLIENT-ID"
clientSecret:
secret: service-desk-email-client-secret
key: secret
deliveryMethod: webhook
authToken:
secret: <name>-service-desk-email-auth-token
key: authToken
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azureAdEndpoint` and `graphEndpoint` settings. These fields are case-sensitive:
```yaml
global:
appConfig:
serviceDeskEmail:
[..]
azureAdEndpoint: https://login.microsoftonline.us
graphEndpoint: https://graph.microsoft.us
[..]
```
1. Save the file and apply the new values:
```shell
helm upgrade -f gitlab_values.yaml gitlab gitlab/gitlab
```
{{< /tab >}}
{{< tab title="Docker" >}}
1. Edit `docker-compose.yml`:
```yaml
version: "3.6"
services:
gitlab:
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.onmicrosoft.com"
gitlab_rails['service_desk_email_email'] = "project_contact@example.onmicrosoft.com"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azure_ad_endpoint` and `graph_endpoint` settings:
1. Edit `docker-compose.yml`:
```yaml
version: "3.6"
services:
gitlab:
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.onmicrosoft.com"
gitlab_rails['service_desk_email_email'] = "project_contact@example.onmicrosoft.com"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
'azure_ad_endpoint': 'https://login.microsoftonline.us',
'graph_endpoint': 'https://graph.microsoft.us',
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
1. Edit `/home/git/gitlab/config/gitlab.yml`:
```yaml
service_desk_email:
enabled: true
address: "project_contact+%{key}@example.onmicrosoft.com"
user: "project_contact@example.onmicrosoft.com"
mailbox: "inbox"
delivery_method: webhook
log_path: "log/mailroom.log"
secret_file: .gitlab-mailroom-secret
inbox_method: "microsoft_graph"
inbox_options:
tenant_id: "<YOUR-TENANT-ID>"
client_id: "<YOUR-CLIENT-ID>"
client_secret: "<YOUR-CLIENT-SECRET>"
poll_interval: 60 # Optional
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azure_ad_endpoint` and `graph_endpoint` settings. For example:
```yaml
service_desk_email:
enabled: true
address: "project_contact+%{key}@example.onmicrosoft.com"
user: "project_contact@example.onmicrosoft.com"
mailbox: "inbox"
delivery_method: webhook
log_path: "log/mailroom.log"
secret_file: .gitlab-mailroom-secret
inbox_method: "microsoft_graph"
inbox_options:
azure_ad_endpoint: "https://login.microsoftonline.us"
graph_endpoint: "https://graph.microsoft.us"
tenant_id: "<YOUR-TENANT-ID>"
client_id: "<YOUR-CLIENT-ID>"
client_secret: "<YOUR-CLIENT-SECRET>"
poll_interval: 60 # Optional
```
{{< /tab >}}
{{< /tabs >}}
### Configure a suffix for Service Desk alias email
You can set a custom suffix in your project's Service Desk settings.
A suffix can contain only lowercase letters (`a-z`), numbers (`0-9`), or underscores (`_`).
When configured, the custom suffix creates a new Service Desk email address, consisting of the
`service_desk_email_address` setting and a key of the format: `<project_full_path>-<custom_suffix>`
Prerequisites:
- You must have configured a [Service Desk alias email](#configure-service-desk-alias-email).
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Below **Email address suffix**, enter the suffix to use.
1. Select **Save changes**.
For example, suppose the `mygroup/myproject` project Service Desk settings has the following configured:
- Email address suffix is set to `support`.
- Service Desk email address is configured to `contact+%{key}@example.com`.
The Service Desk email address for this project is: `contact+mygroup-myproject-support@example.com`.
The [incoming email](../../../administration/incoming_email.md) address still works.
If you don't configure a custom suffix, the default project identification is used for identifying
the project.
## Configure email ingestion in multi-node environments
A multi-node environment is a setup where GitLab is run across multiple servers
for scalability, fault tolerance, and performance reasons.
GitLab uses a separate process called `mail_room` to ingest new unread emails
from the `incoming_email` and `service_desk_email` mailboxes.
### Helm chart (Kubernetes)
The [GitLab Helm chart](https://docs.gitlab.com/charts/) is made up of multiple subcharts, and one of them is
the [Mailroom subchart](https://docs.gitlab.com/charts/charts/gitlab/mailroom/). Configure the
[common settings for `incoming_email`](https://docs.gitlab.com/charts/installation/command-line-options.html#incoming-email-configuration)
and the [common settings for `service_desk_email`](https://docs.gitlab.com/charts/installation/command-line-options.html#service-desk-email-configuration).
### Linux package (Omnibus)
In multi-node Linux package installation environments, run `mail_room` only on one node. Run it either on a single
`rails` node (for example, `application_role`)
or completely separately.
#### Set up all nodes
1. Add basic configuration for `incoming_email` and `service_desk_email` on every node
to render email addresses in the web UI and in generated emails.
Find the `incoming_email` or `service_desk_email` section in `/etc/gitlab/gitlab.rb`:
{{< tabs >}}
{{< tab title="`incoming_email`" >}}
```ruby
gitlab_rails['incoming_email_enabled'] = true
gitlab_rails['incoming_email_address'] = "incoming+%{key}@example.com"
```
{{< /tab >}}
{{< tab title="`service_desk_email`" >}}
```ruby
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.com"
```
{{< /tab >}}
{{< /tabs >}}
1. GitLab offers two methods to transport emails from `mail_room` to the GitLab
application. You can configure the `delivery_method` for each email setting individually:
1. Recommended: `webhook` (default in GitLab 15.3 and later) sends the email payload with an API POST request to your GitLab
application. It uses a shared token to authenticate. If you choose this method,
make sure the `mail_room` process can access the API endpoint and distribute the shared
token across all application nodes.
{{< tabs >}}
{{< tab title="`incoming_email`" >}}
```ruby
gitlab_rails['incoming_email_delivery_method'] = "webhook"
# The URL that mail_room can contact. You can also use an internal URL or IP,
# just make sure mail_room can access the GitLab API with that address.
# Do not end with "/".
gitlab_rails['incoming_email_gitlab_url'] = "https://gitlab.example.com"
# The shared secret file that should contain a random token. Make sure it's the same on every node.
gitlab_rails['incoming_email_secret_file'] = ".gitlab_mailroom_secret"
```
{{< /tab >}}
{{< tab title="`service_desk_email`" >}}
```ruby
gitlab_rails['service_desk_email_delivery_method'] = "webhook"
# The URL that mail_room can contact. You can also use an internal URL or IP,
# just make sure mail_room can access the GitLab API with that address.
# Do not end with "/".
gitlab_rails['service_desk_email_gitlab_url'] = "https://gitlab.example.com"
# The shared secret file that should contain a random token. Make sure it's the same on every node.
gitlab_rails['service_desk_email_secret_file'] = ".gitlab_mailroom_secret"
```
{{< /tab >}}
{{< /tabs >}}
1. [Deprecated in GitLab 16.0 and planned for removal in 19.0](../../../update/deprecations.md#sidekiq-delivery-method-for-incoming_email-and-service_desk_email-is-deprecated):
If you experience issues with the `webhook` setup, use `sidekiq` to deliver the email payload directly to GitLab Sidekiq using Redis.
{{< tabs >}}
{{< tab title="`incoming_email`" >}}
```ruby
# It uses the Redis configuration to directly add Sidekiq jobs
gitlab_rails['incoming_email_delivery_method'] = "sidekiq"
```
{{< /tab >}}
{{< tab title="`service_desk_email`" >}}
```ruby
# It uses the Redis configuration to directly add Sidekiq jobs
gitlab_rails['service_desk_email_delivery_method'] = "sidekiq"
```
{{< /tab >}}
{{< /tabs >}}
1. Disable `mail_room` on all nodes that should not run email ingestion. For example, in `/etc/gitlab/gitlab.rb`:
```ruby
mailroom['enable'] = false
```
1. [Reconfigure GitLab](../../../administration/restart_gitlab.md) for the changes to take effect.
#### Set up a single email ingestion node
After setting up all nodes and disabling the `mail_room` process, enable `mail_room` on a single node.
This node polls the mailboxes for `incoming_email` and `service_desk_email` on a regular basis and
move new unread emails to GitLab.
1. Choose an existing node that additionally handles email ingestion.
1. Add [full configuration and credentials](../../../administration/incoming_email.md#configuration-examples)
for `incoming_email` and `service_desk_email`.
1. Enable `mail_room` on this node. For example, in `/etc/gitlab/gitlab.rb`:
```ruby
mailroom['enable'] = true
```
1. [Reconfigure GitLab](../../../administration/restart_gitlab.md) on this node for the changes to take effect.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Configure Service Desk
breadcrumbs:
- doc
- user
- project
- service_desk
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
By default, Service Desk is active in new projects.
If it's not active, you can do it in the project's settings.
Prerequisites:
- You must have at least the Maintainer role for the project.
- On GitLab Self-Managed, you must [set up incoming email](../../../administration/incoming_email.md#set-it-up)
for the GitLab instance. You should use
[email sub-addressing](../../../administration/incoming_email.md#email-sub-addressing),
but you can also use [catch-all mailboxes](../../../administration/incoming_email.md#catch-all-mailbox).
To do this, you must have administrator access.
- You must have enabled [issue](../settings/_index.md#configure-project-features-and-permissions)
tracker for the project.
To enable Service Desk in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Turn on the **Activate Service Desk** toggle.
1. Optional. Complete the fields.
- [Add a suffix](#configure-a-suffix-for-service-desk-alias-email) to your Service Desk email address.
- If the list below **Template to append to all Service Desk issues** is empty, create a
[description template](../description_templates.md) in your repository.
1. Select **Save changes**.
Service Desk is now enabled for this project.
If anyone sends an email to the address available below **Email address to use for Service Desk**,
GitLab creates a confidential issue with the email's content.
## Service Desk glossary
This glossary provides definitions for terms related to Service Desk.
| Term | Definition |
|--------------------------------------------------|------------|
| [External participant](external_participants.md) | Users without a GitLab account that can interact with an issue or Service Desk ticket only by email. |
| Requester | External participant that created the Service Desk ticket or was added as requester using the [`/convert_to_ticket` quick action](using_service_desk.md#create-a-service-desk-ticket-in-gitlab-ui). |
## Improve your project's security
To improve your Service Desk project's security, you should:
- Put the Service Desk email address behind an alias on your email system so you can change it later.
- [Enable Akismet](../../../integration/akismet.md) on your GitLab instance to add spam checking to this service.
Unblocked email spam can result in many spam issues being created.
## Customize emails sent to external participants
{{< history >}}
- `UNSUBSCRIBE_URL`, `SYSTEM_HEADER`, `SYSTEM_FOOTER`, and `ADDITIONAL_TEXT` placeholders [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/285512) in GitLab 15.9.
- `%{ISSUE_DESCRIPTION}` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/223751) in GitLab 16.0.
- `%{ISSUE_URL}` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/408793) in GitLab 16.1.
{{< /history >}}
An email is sent to external participants when:
- A requester submits a new ticket by emailing Service Desk.
- An external participant is added to a Service Desk ticket.
- A new public comment is added on a Service Desk ticket.
- Editing a comment does not trigger a new email to be sent.
You can customize the body of these email messages with Service Desk email templates. The templates
can include [GitLab Flavored Markdown](../../markdown.md) and [some HTML tags](../../markdown.md#inline-html).
For example, you can format the emails to include a header and footer in accordance with your
organization's brand guidelines. You can also include the following placeholders to display dynamic
content specific to the Service Desk ticket or your GitLab instance.
| Placeholder | `thank_you.md` and `new_participant` | `new_note.md` | Description |
|------------------------|--------------------------------------|------------------------|-------------|
| `%{ISSUE_ID}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Ticket IID. |
| `%{ISSUE_PATH}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Project path appended with the ticket IID. |
| `%{ISSUE_URL}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | URL of the ticket. External participants can only view the ticket if the project is public and ticket is not confidential (Service Desk tickets are confidential by default). |
| `%{ISSUE_DESCRIPTION}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Ticket description. If a user has edited the description, it may contain sensitive information that is not intended to be delivered to external participants. Use this placeholder with care and ideally only if you never modify descriptions or your team is aware of the template design. |
| `%{UNSUBSCRIBE_URL}` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Unsubscribe URL. Learn how to [unsubscribe as an external participant](external_participants.md#unsubscribing-from-notification-emails) and [use unsubscribe headers in notification emails from GitLab](../../profile/notifications.md#using-an-email-client-or-other-software). |
| `%{NOTE_TEXT}` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | The new comment added to the ticket by a user. Take care to include this placeholder in `new_note.md`. Otherwise, the external participants may never see the updates on their Service Desk ticket. |
### Thank you email
When a requester submits an issue through Service Desk, GitLab sends a **thank you email**.
Without additional configuration, GitLab sends the default thank you email.
To create a custom thank you email template:
1. In the `.gitlab/service_desk_templates/` directory of your repository, create a file named `thank_you.md`.
1. Populate the Markdown file with text, [GitLab Flavored Markdown](../../markdown.md),
[some selected HTML tags](../../markdown.md#inline-html), and placeholders to customize the reply
to Service Desk requesters.
### New participant email
{{< history >}}
- `new_participant` email [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299261) in GitLab 17.0.
{{< /history >}}
When an [external participant](external_participants.md) is added to the ticket, GitLab sends a **new participant email** to let them know they are part of the conversation.
Without additional configuration, GitLab sends the default new participant email.
To create a custom new participant email template:
1. In the `.gitlab/service_desk_templates/` directory of your repository, create a file named `new_participant.md`.
1. Populate the Markdown file with text, [GitLab Flavored Markdown](../../markdown.md),
[some selected HTML tags](../../markdown.md#inline-html), and placeholders to customize the reply
to Service Desk requesters.
### New note email
When a Service Desk ticket has a new public comment, GitLab sends a **new note email**.
Without additional configuration, GitLab sends the content of the comment.
To keep your emails on brand, you can create a custom new note email template. To do so:
1. In the `.gitlab/service_desk_templates/` directory in your repository, create a file named `new_note.md`.
1. Populate the Markdown file with text, [GitLab Flavored Markdown](../../markdown.md),
[some selected HTML tags](../../markdown.md#inline-html), and placeholders to customize the new note
email. Be sure to include the `%{NOTE_TEXT}` in the template to make sure the email recipient can
read the contents of the comment.
### Instance-wide email header, footer, and additional text
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/344819) in GitLab 15.9.
{{< /history >}}
Instance administrators can add a header, footer or additional text to the GitLab instance and apply
them to all emails sent from GitLab. If you're using a custom `thank_you.md`, `new_participant` or `new_note.md`, to include
this content, add `%{SYSTEM_HEADER}`, `%{SYSTEM_FOOTER}`, or `%{ADDITIONAL_TEXT}` to your templates.
For more information, see [System header and footer messages](../../../administration/appearance.md#add-system-header-and-footer-messages) and [custom additional text](../../../administration/settings/email.md#custom-additional-text).
## Use a custom template for Service Desk tickets
You can select one [description template](../description_templates.md#create-a-description-template)
**per project** to be appended to every new Service Desk ticket's description.
You can set description templates at various levels:
- The entire [instance](../description_templates.md#set-instance-level-description-templates).
- A specific [group or subgroup](../description_templates.md#set-group-level-description-templates).
- A specific [project](../description_templates.md#set-a-default-template-for-merge-requests-and-issues).
The templates are inherited. For example, in a project, you can also access templates set for the instance, or the project's parent groups.
Prerequisites:
- You must have [created a description template](../description_templates.md#create-a-description-template).
To use a custom description template with Service Desk:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. From the dropdown list **Template to append to all Service Desk issues**, search or select your template.
## Support Bot user
Behind the scenes, Service Desk works by the special Support Bot user creating issues.
This user isn't a [billable user](../../../subscriptions/manage_users_and_seats.md#criteria-for-non-billable-users),
so it does not count toward the license limit count.
In GitLab 16.0 and earlier, comments generated from Service Desk emails show `GitLab Support Bot`
as the author. In [GitLab 16.1 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/226995),
these comments show the email of the user who sent the email.
This feature only applies to comments made in GitLab 16.1 and later.
### Change the Support Bot's display name
You can change the display name of the Support Bot user. Emails sent from Service Desk have
this name in the `From` header. The default display name is `GitLab Support Bot`.
To edit the custom email display name:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Below **Email display name**, enter a new name.
1. Select **Save changes**.
## Default ticket visibility
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/33091) in GitLab 17.2.
{{< /history >}}
New tickets are confidential by default, so only project members with at least the Planner role
can view them.
In private and internal projects, you can configure GitLab so that new tickets are not confidential by default, and any project member can view them.
In public projects, this setting is not available because new tickets are always confidential by default.
Prerequisites:
- You must have at least the Maintainer role for the project.
To disable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Clear the **New tickets are confidential by default** checkbox.
1. Select **Save changes**.
## Reopen issues when an external participant comments
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/8549) in GitLab 16.7
{{< /history >}}
You can configure GitLab to reopen closed issues when an external participant adds
a new comment on an issue by email. This also adds an internal comment that mentions
the assignees of the issue and creates to-do items for them.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a walkthrough, see [a short showcase video](https://youtu.be/163wDM1e43o).
<!-- Video published on 2023-12-12 -->
Prerequisites:
- You must have at least the Maintainer role for the project.
To enable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Select the **Reopen issues on a new note from an external participant** checkbox.
1. Select **Save changes**.
## Custom email address
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329990) in GitLab 16.3 [with a flag](../../../administration/feature_flags/_index.md) named `service_desk_custom_email`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/387003) in GitLab 16.4.
- Ability to select the SMTP authentication method [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429680) in GitLab 16.6.
- [Feature flag `service_desk_custom_email` removed](https://gitlab.com/gitlab-org/gitlab/-/issues/387003) in GitLab 16.7.
- Local network allowed for SMTP host on GitLab Self-Managed [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/435206) in GitLab 16.7.
{{< /history >}}
Configure a custom email address to show as the sender of your support communication.
Maintain brand identity and instill confidence among support requesters with a domain they recognize.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [a short showcase video](https://youtu.be/_moD5U3xcQs).
<!-- Video published on 2023-09-12 -->
This feature is in [beta](../../../policy/development_stages_support.md#beta).
A beta feature is not production-ready, but is unlikely to change drastically
before it's released. We encourage users to try beta features and provide feedback
in [the feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/416637).
### Prerequisites
You can use one custom email address for Service Desk per project and it must be unique across the instance.
The custom email address you want to use must meet all of the following requirements:
- You can set up email forwarding.
- Forwarded emails preserve the original `From` header.
- Your service provider must support sub-addressing. An email address consists of a local part (everything before `@`) and a
domain part.
With email sub-addressing you can create unique variations of an email address by adding a `+` symbol followed
by any text to the local part. Given the email address `support@example.com`, check whether sub-addressing is supported by
sending an email to `support+1@example.com`. This email should appear in your mailbox.
- You have SMTP credentials (ideally, you should use an app password).
The username and password are stored in the database using the Advanced Encryption Standard (AES)
with a 256-bit key.
- The **SMTP host** must be resolvable from the network of your GitLab instance (on GitLab Self-Managed)
or the public internet (on GitLab.com).
- You must have at least the Maintainer role for the project.
- Service Desk must be configured for the project.
### Configure a custom email address
Configure and verify a custom email address when you want to send Service Desk emails using your own email address.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk** and find the **Configure a custom email address** section.
1. Note the presented Service Desk address of this project, and with your email provider
(for example, Gmail), set up email forwarding from the custom email address to the
Service Desk address.
1. Back in GitLab, complete the fields.
1. Select **Save & test connection**.
The configuration has been saved and the verification of the custom email address is triggered.
#### Verification
1. After completing the configuration, all project owners and the administrator that saved the custom email configuration receive a notification email.
1. A verification email is sent using the provided SMTP credentials to the custom email address (with a sub-addressing part).
The email contains a verification token. When email forwarding is set up correctly and all prerequisites are met,
the email is forwarded to your Service Desk address and ingested by GitLab. GitLab checks the following conditions:
1. GitLab can send an email using the SMTP credentials.
1. Sub-addressing is supported (with the `+verify` sub-addressing part).
1. `From` header is preserved after forwarding.
1. Verification token is correct.
1. Email is received in 30 minutes.
Typically the process takes only a few minutes.
To cancel verification at any time or if it fails, select **Reset custom email**.
The settings page updates accordingly and reflects the current state of the verification.
The SMTP credentials are deleted and you can start the configuration again.
On failure and success all project owners and the user who triggered the verification process receive a
notification email with the verification result.
If the verification failed, the email also contains details of the reason.
If the verification was successful, the custom email address is ready to be used.
You can now enable sending Service Desk emails with the custom email address.
#### Troubleshooting your configuration
When configuring a custom email you might encounter the following issues.
##### Invalid credentials
You might get an error that states that invalid credentials were used.
This occurs when the SMTP server returns that the authentication wasn't successful.
To troubleshoot this:
1. Check your SMTP credentials, especially the username and password.
1. Sometimes GitLab cannot automatically select an authentication method that the SMTP server supports. Either:
- Try the available authentication methods (**Plain**, **Login** and **CRAM-MD5**).
- Check which authentication methods your SMTP server supports, using the
[`swaks` command line tool](https://www.jetmore.org/john/code/swaks/):
1. Run the following command with your credentials and look for a line that starts with `250-AUTH`:
```shell
swaks --to user@example.com \
--from support@example.com \
--auth-user support@example.com \
--server smtp@example.com:587 \
-tls-optional \
--auth-password your-app-password
```
1. Select one of the supported authentication methods in the custom email setup form.
##### Incorrect forwarding target
You might get an error that states that an incorrect forwarding target was used.
This occurs when the verification email was forwarded to a different email address than the
project-specific Service Desk address that's displayed in the custom email configuration form.
You must use the Service Desk address generated from `incoming_email`. Forwarding to the additional
Service Desk alias address generated from `service_desk_email` is not supported because it doesn't support
all reply by email functionalities.
To troubleshoot this:
1. Find the correct email address to forward emails to. Either:
- Note the address from the verification result email that all project owners and the user that
triggered the verification process receive.
- Copy the address from the **Service Desk email address to forward emails to** input in the
custom email setup form.
1. Forward all emails to the custom email address to the correct target email address.
### Enable or disable the custom email address
After the custom email address has been verified, administrators can enable or disable sending Service Desk emails with the custom email address.
To **enable** the custom email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Turn on the **Enable custom email** toggle.
Service Desk emails to external participants are sent using the SMTP credentials.
To **disable** the custom email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Turn off the **Enable custom email** toggle.
Because you set up email forwarding, emails to your custom email address continue to be processed and
appear as Service Desk Tickets in your project.
Service Desk emails to external participants are now sent using the GitLab instance's default outgoing
email configuration.
### Change or remove custom email configuration
To change the custom email configuration you must reset and remove it and configure custom email again.
To reset the configuration at any step in the process, select **Reset custom email**.
The credentials are then removed from the database.
### Custom email reply address
External participants can [reply by email](../../../administration/reply_by_email.md) to Service Desk tickets.
GitLab uses an email reply address with a 32-character reply key that corresponds to the ticket.
When a custom email is configured, GitLab generates the reply address from that email.
### Use Google Workspace with your own domain
Set up a custom email address for Service Desk when using Google Workspace with your own domain.
Prerequisites:
- You already have a Google Workspace account.
- You can create new accounts for your tenant.
To configure a custom Service Desk email address with Google Workspace:
1. [Configure a Google Workspace account](#configure-a-google-workspace-account).
1. [Configure email forwarding in Google Workspace](#configure-email-forwarding-in-google-workspace).
1. [Configure custom email address using a Google Workspace account](#configure-custom-email-address-using-a-google-workspace-account).
#### Configure a Google Workspace account
First, you must create and configure a Google Workspace account.
In Google Workspace:
1. Create a new account for the custom email address you'd like to use (for example, `support@example.com`).
1. Sign in to that account and activate
[two-factor authentication](https://myaccount.google.com/u/3/signinoptions/two-step-verification).
1. [Create an app password](https://myaccount.google.com/u/3/apppasswords) that you can use as your
SMTP password.
Store it in a secure place and remove spaces between the characters.
Next, you must [configure email forwarding in Google Workspace](#configure-email-forwarding-in-google-workspace).
#### Configure email forwarding in Google Workspace
The following steps require moving between GitLab and Google Workspace.
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk**.
1. Note the email address below **Service Desk email address to forward emails to**.
In Google Workspace:
1. Sign in to the custom email account and open the [Forwarding and POP/IMAP](https://mail.google.com/mail/u/0/#settings/fwdandpop) settings page.
1. Select **Add a forwarding address**.
1. Enter the Service Desk address from the custom email form.
1. Select **Next**.
1. Confirm your input and select **Proceed**. Google sends an email to the Service Desk address and
requires a confirmation code.
In GitLab:
1. Go to **Issues** of the project and wait for a new issue to be created from the confirmation
email from Google.
1. Open the issue and note the confirmation code.
1. (Optional) Delete the issue.
In Google Workspace:
1. Enter the confirmation code and select **Verify**.
1. Select **Forward a copy of incoming mail to** and make sure the Service Desk address is selected
from the dropdown list.
1. At the bottom of the page, select **Save Changes**.
Next, [configure custom email address using a Google Workspace account](#configure-custom-email-address-using-a-google-workspace-account)
to use with Service Desk.
#### Configure custom email address using a Google Workspace account
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk** and find the custom email settings.
1. Complete the fields:
- **Custom email address**: Your custom email address.
- **SMTP host**: `smtp.gmail.com`.
- **SMTP port**: `587`.
- **SMTP username**: Prefilled with the custom email address.
- **SMTP password**: The app password you previously created for the custom email account.
- **SMTP authentication method**: Let GitLab select a server-supported method (recommended)
1. Select **Save and test connection**
1. After the [verification process](#verification) you should be able to
[enable the custom email address](#enable-or-disable-the-custom-email-address).
### Use Microsoft 365 (Exchange online) with your own domain
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/496396) in GitLab 17.5.
{{< /history >}}
Set up a custom email address for Service Desk when using Microsoft 365 (Exchange) with your own domain.
Prerequisites:
- You already have a Microsoft 365 account.
- You can create new accounts for your tenant.
To configure a custom Service Desk email address with Microsoft 365:
1. [Configure a Microsoft 365 account](#configure-a-microsoft-365-account).
1. [Configure email forwarding in Microsoft 365](#configure-email-forwarding-in-microsoft-365).
1. [Configure custom email address using a Microsoft 365 account](#configure-custom-email-address-using-a-microsoft-365-account).
#### Configure a Microsoft 365 account
First, you must create and configure a Microsoft 365 account.
In this guide, use a licensed user for the custom email mailbox.
You can also experiment with other configuration options.
In [Microsoft 365 admin center](https://admin.microsoft.com/Adminportal/Home#/homepage):
1. Create a new account for the custom email address you'd like to use (for example, `support@example.com`).
1. Expand the **Users** section and select **Active users** from the menu.
1. Select **Add a user** and follow the instructions on the screen.
1. In Microsoft Entra (previously named Active Directory), enable two-factor authentication for the account.
1. [Allow users to create app passwords](https://learn.microsoft.com/en-us/entra/identity/authentication/howto-mfa-app-passwords).
1. Enable **Authenticated SMTP** for the account.
1. Select the account from the list.
1. In the drawer select **Mail**.
1. Below **Email apps** select **Manage email apps**.
1. Check **Authenticated SMTP** and select **Save changes**.
1. Depending on your overall Exchange online configuration you might need to configure the following:
1. Use Azure Cloud Shell to allow SMTP client authentication:
```powershell
Set-TransportConfig -SmtpClientAuthenticationDisabled $false
```
1. Use Azure Cloud Shell to allow
[legacy TLS clients using SMTP AUTH](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/opt-in-exchange-online-endpoint-for-legacy-tls-using-smtp-auth):
```powershell
Set-TransportConfig -AllowLegacyTLSClients $true
```
1. If you want to forward to an external recipient, see this guide on how to enable
[external email forwarding](https://learn.microsoft.com/en-gb/defender-office-365/outbound-spam-policies-external-email-forwarding).
You might also want to [create an outbound anti-spam policy](https://security.microsoft.com/antispam)
to allow forwarding to external recipients only for users who need it.
1. Sign in to that account and activate two-factor authentication.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
1. From the menu in the upper-right corner, select **View account** and [browse to **Security Info**](https://mysignins.microsoft.com/security-info).
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Select **Add sign-in method** and select a method that works for you (authenticator app, phone or email).
1. Follow the instructions on the screen.
<!-- vale gitlab_base.SubstitutionWarning = NO -->
1. On the [**Security Info**](https://mysignins.microsoft.com/security-info) page,
create an app password that you can use as your SMTP password.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Select **Add sign-in method** and select **App password** from the dropdown list.
1. Set a descriptive name for the app password, such as `GitLab SD`.
1. Select **Next**.
1. Copy the displayed password and store it in a secure place.
1. Optional. Ensure you can send emails using SMTP using the [`swaks` command line tool](https://www.jetmore.org/john/code/swaks/).
1. Run the following command with your credentials and use the app password as the `auth-password`:
```shell
swaks --to your-email@example.com \
--from custom-email@example.com \
--auth-user custom-email@example.com \
--server smtp.office365.com:587 \
-tls-optional \
--auth-password <your_app_password>
```
Next, you must [configure email forwarding in Microsoft 365](#configure-email-forwarding-in-microsoft-365).
#### Configure email forwarding in Microsoft 365
The following steps require moving between GitLab and Microsoft 365 admin center.
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk**.
1. Note the email address below **Service Desk email address to forward emails to** without the
sub-address part.
Emails aren't forwarded if the recipient address contains a sub-address (for example reply
addresses generated by GitLab) and the forwarding email address contains a sub-address
(the **Service Desk email address to forward emails to**).
For example, `incoming+group-project-12346426-issue-@incoming.gitlab.com` becomes `incoming@incoming.gitlab.com`.
That's okay because Exchange online preserves the custom email address in the `To` header
after forwarding and GitLab can assign the correct project based on the custom email address.
In [Microsoft 365 admin center](https://admin.microsoft.com/Adminportal/Home#/homepage):
<!-- vale gitlab_base.SubstitutionWarning = NO -->
1. Expand the **Users** section and select **Active users** from the menu.
<!-- vale gitlab_base.SubstitutionWarning = YES -->
1. Select the account you'd like to use for the custom email from the list.
1. In the drawer select **Mail**.
1. Below **Email forwarding** select **Manage email forwarding**.
1. Check **Forward all emails sent to this mailbox**.
1. Enter the Service Desk address from the custom email form in **Forwarding email address** without the sub-address part.
1. Select **Save changes**.
Next, [configure a custom email address using a Microsoft 365 account](#configure-custom-email-address-using-a-microsoft-365-account)
to use with Service Desk.
#### Configure custom email address using a Microsoft 365 account
In GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**
1. Expand **Service Desk** and find the custom email settings.
1. Complete the fields:
- **Custom email address**: Your custom email address.
- **SMTP host**: `smtp.office365.com`.
- **SMTP port**: `587`.
- **SMTP username**: Prefilled with the custom email address.
- **SMTP password**: The app password you previously created for the custom email account.
- **SMTP authentication method**: Login
1. Select **Save and test connection**
1. After the [verification process](#verification) you should be able to
[enable the custom email address](#enable-or-disable-the-custom-email-address).
### Known issues
- Some service providers don't allow SMTP connections any more.
Often you can enable them on a per user basis and create an app password.
## Use an additional Service Desk alias email
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
{{< /details >}}
You can use an additional alias email address for Service Desk for an instance.
To do this, you must configure
a [`service_desk_email`](#configure-service-desk-alias-email) in the instance configuration. You can also configure a
[custom suffix](#configure-a-suffix-for-service-desk-alias-email) that replaces the default `-issue-` portion on the sub-addressing part.
### Configure Service Desk alias email
{{< alert type="note" >}}
On GitLab.com a custom mailbox is already configured with `contact-project+%{key}@incoming.gitlab.com` as the email address. You can still configure the
[custom suffix](#configure-a-suffix-for-service-desk-alias-email) in project settings.
{{< /alert >}}
Service Desk uses the [incoming email](../../../administration/incoming_email.md)
configuration by default. However, to have a separate email address for Service Desk,
configure `service_desk_email` with a [custom suffix](#configure-a-suffix-for-service-desk-alias-email)
in project settings.
Prerequisites:
- The `address` must include the `+%{key}` placeholder in the `user` portion of the address,
before the `@`. The placeholder is used to identify the project where the issue should be created.
- The `service_desk_email` and `incoming_email` configurations must always use separate mailboxes
to make sure Service Desk emails are processed correctly.
To configure a custom mailbox for Service Desk with IMAP, add the following snippets to your configuration file in full:
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
{{< alert type="note" >}}
In GitLab 15.3 and later, Service Desk uses `webhook` (internal API call) by default instead of enqueuing a Sidekiq job.
To use `webhook` on a Linux package installation running GitLab 15.3, you must generate a secret file.
For more information, see [merge request 5927](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/5927).
In GitLab 15.4, reconfiguring a Linux package installation generates this secret file automatically, so no
secret file configuration setting is needed.
For more information, see [issue 1462](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/1462).
{{< /alert >}}
```ruby
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@gmail.com"
gitlab_rails['service_desk_email_email'] = "project_contact@gmail.com"
gitlab_rails['service_desk_email_password'] = "[REDACTED]"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_idle_timeout'] = 60
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_host'] = "imap.gmail.com"
gitlab_rails['service_desk_email_port'] = 993
gitlab_rails['service_desk_email_ssl'] = true
gitlab_rails['service_desk_email_start_tls'] = false
```
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
```yaml
service_desk_email:
enabled: true
address: "project_contact+%{key}@example.com"
user: "project_contact@example.com"
password: "[REDACTED]"
host: "imap.gmail.com"
delivery_method: webhook
secret_file: .gitlab-mailroom-secret
port: 993
ssl: true
start_tls: false
log_path: "log/mailroom.log"
mailbox: "inbox"
idle_timeout: 60
expunge_deleted: true
```
{{< /tab >}}
{{< /tabs >}}
The configuration options are the same as for configuring
[incoming email](../../../administration/incoming_email.md#set-it-up).
#### Use encrypted credentials
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108279) in GitLab 15.9.
{{< /history >}}
Instead of having the Service Desk email credentials stored in plaintext in the configuration files, you can optionally
use an encrypted file for the incoming email credentials.
Prerequisites:
- To use encrypted credentials, you must first enable the
[encrypted configuration](../../../administration/encrypted_configuration.md).
The supported configuration items for the encrypted file are:
- `user`
- `password`
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
1. If initially your Service Desk configuration in `/etc/gitlab/gitlab.rb` looked like:
```ruby
gitlab_rails['service_desk_email_email'] = "service-desk-email@mail.example.com"
gitlab_rails['service_desk_email_password'] = "examplepassword"
```
1. Edit the encrypted secret:
```shell
sudo gitlab-rake gitlab:service_desk_email:secret:edit EDITOR=vim
```
1. Enter the unencrypted contents of the Service Desk email secret:
```yaml
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit `/etc/gitlab/gitlab.rb` and remove the `service_desk` settings for `email` and `password`.
1. Save the file and reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
{{< /tab >}}
{{< tab title="Helm chart (Kubernetes)" >}}
Use a Kubernetes secret to store the Service Desk email password. For more information,
read about [Helm IMAP secrets](https://docs.gitlab.com/charts/installation/secrets.html#imap-password-for-service-desk-emails).
{{< /tab >}}
{{< tab title="Docker" >}}
1. If initially your Service Desk configuration in `docker-compose.yml` looked like:
```yaml
version: "3.6"
services:
gitlab:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['service_desk_email_email'] = "service-desk-email@mail.example.com"
gitlab_rails['service_desk_email_password'] = "examplepassword"
```
1. Get inside the container, and edit the encrypted secret:
```shell
sudo docker exec -t <container_name> bash
gitlab-rake gitlab:service_desk_email:secret:edit EDITOR=editor
```
1. Enter the unencrypted contents of the Service Desk secret:
```yaml
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit `docker-compose.yml` and remove the `service_desk` settings for `email` and `password`.
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
1. If initially your Service Desk configuration in `/home/git/gitlab/config/gitlab.yml` looked like:
```yaml
production:
service_desk_email:
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit the encrypted secret:
```shell
bundle exec rake gitlab:service_desk_email:secret:edit EDITOR=vim RAILS_ENVIRONMENT=production
```
1. Enter the unencrypted contents of the Service Desk secret:
```yaml
user: 'service-desk-email@mail.example.com'
password: 'examplepassword'
```
1. Edit `/home/git/gitlab/config/gitlab.yml` and remove the `service_desk_email:` settings for `user` and `password`.
1. Save the file and restart GitLab and Mailroom
```shell
# For systems running systemd
sudo systemctl restart gitlab.target
# For systems running SysV init
sudo service gitlab restart
```
{{< /tab >}}
{{< /tabs >}}
#### Microsoft Graph
{{< history >}}
- [Introduced for self-compiled (source) installs](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116494) in GitLab 15.11.
{{< /history >}}
`service_desk_email` can be configured to read Microsoft Exchange Online mailboxes with the Microsoft
Graph API instead of IMAP. Set up an OAuth 2.0 application for Microsoft Graph
[the same way as for incoming email](../../../administration/incoming_email.md#microsoft-graph).
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines, substituting
the values you want:
```ruby
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.onmicrosoft.com"
gitlab_rails['service_desk_email_email'] = "project_contact@example.onmicrosoft.com"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azure_ad_endpoint` and `graph_endpoint` settings. For example:
```ruby
gitlab_rails['service_desk_email_inbox_options'] = {
'azure_ad_endpoint': 'https://login.microsoftonline.us',
'graph_endpoint': 'https://graph.microsoft.us',
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
{{< /tab >}}
{{< tab title="Helm chart (Kubernetes)" >}}
1. Create the [Kubernetes Secret containing the OAuth 2.0 application client secret](https://docs.gitlab.com/charts/installation/secrets.html#microsoft-graph-client-secret-for-service-desk-emails):
```shell
kubectl create secret generic service-desk-email-client-secret --from-literal=secret=<YOUR-CLIENT_SECRET>
```
1. Create the [Kubernetes Secret for the GitLab Service Desk email auth token](https://docs.gitlab.com/charts/installation/secrets.html#gitlab-service-desk-email-auth-token).
Replace `<name>` with the name of the [Helm release name](https://helm.sh/docs/intro/using_helm/) for the GitLab installation:
```shell
kubectl create secret generic <name>-service-desk-email-auth-token --from-literal=authToken=$(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 32 | base64)
```
1. Export the Helm values:
```shell
helm get values gitlab > gitlab_values.yaml
```
1. Edit `gitlab_values.yaml`:
```yaml
global:
appConfig:
serviceDeskEmail:
enabled: true
address: "project_contact+%{key}@example.onmicrosoft.com"
user: "project_contact@example.onmicrosoft.com"
mailbox: inbox
inboxMethod: microsoft_graph
azureAdEndpoint: https://login.microsoftonline.com
graphEndpoint: https://graph.microsoft.com
tenantId: "YOUR-TENANT-ID"
clientId: "YOUR-CLIENT-ID"
clientSecret:
secret: service-desk-email-client-secret
key: secret
deliveryMethod: webhook
authToken:
secret: <name>-service-desk-email-auth-token
key: authToken
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azureAdEndpoint` and `graphEndpoint` settings. These fields are case-sensitive:
```yaml
global:
appConfig:
serviceDeskEmail:
[..]
azureAdEndpoint: https://login.microsoftonline.us
graphEndpoint: https://graph.microsoft.us
[..]
```
1. Save the file and apply the new values:
```shell
helm upgrade -f gitlab_values.yaml gitlab gitlab/gitlab
```
{{< /tab >}}
{{< tab title="Docker" >}}
1. Edit `docker-compose.yml`:
```yaml
version: "3.6"
services:
gitlab:
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.onmicrosoft.com"
gitlab_rails['service_desk_email_email'] = "project_contact@example.onmicrosoft.com"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azure_ad_endpoint` and `graph_endpoint` settings:
1. Edit `docker-compose.yml`:
```yaml
version: "3.6"
services:
gitlab:
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.onmicrosoft.com"
gitlab_rails['service_desk_email_email'] = "project_contact@example.onmicrosoft.com"
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
'azure_ad_endpoint': 'https://login.microsoftonline.us',
'graph_endpoint': 'https://graph.microsoft.us',
'tenant_id': '<YOUR-TENANT-ID>',
'client_id': '<YOUR-CLIENT-ID>',
'client_secret': '<YOUR-CLIENT-SECRET>',
'poll_interval': 60 # Optional
}
```
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
1. Edit `/home/git/gitlab/config/gitlab.yml`:
```yaml
service_desk_email:
enabled: true
address: "project_contact+%{key}@example.onmicrosoft.com"
user: "project_contact@example.onmicrosoft.com"
mailbox: "inbox"
delivery_method: webhook
log_path: "log/mailroom.log"
secret_file: .gitlab-mailroom-secret
inbox_method: "microsoft_graph"
inbox_options:
tenant_id: "<YOUR-TENANT-ID>"
client_id: "<YOUR-CLIENT-ID>"
client_secret: "<YOUR-CLIENT-SECRET>"
poll_interval: 60 # Optional
```
For Microsoft Cloud for US Government or [other Azure deployments](https://learn.microsoft.com/en-us/graph/deployments),
configure the `azure_ad_endpoint` and `graph_endpoint` settings. For example:
```yaml
service_desk_email:
enabled: true
address: "project_contact+%{key}@example.onmicrosoft.com"
user: "project_contact@example.onmicrosoft.com"
mailbox: "inbox"
delivery_method: webhook
log_path: "log/mailroom.log"
secret_file: .gitlab-mailroom-secret
inbox_method: "microsoft_graph"
inbox_options:
azure_ad_endpoint: "https://login.microsoftonline.us"
graph_endpoint: "https://graph.microsoft.us"
tenant_id: "<YOUR-TENANT-ID>"
client_id: "<YOUR-CLIENT-ID>"
client_secret: "<YOUR-CLIENT-SECRET>"
poll_interval: 60 # Optional
```
{{< /tab >}}
{{< /tabs >}}
### Configure a suffix for Service Desk alias email
You can set a custom suffix in your project's Service Desk settings.
A suffix can contain only lowercase letters (`a-z`), numbers (`0-9`), or underscores (`_`).
When configured, the custom suffix creates a new Service Desk email address, consisting of the
`service_desk_email_address` setting and a key of the format: `<project_full_path>-<custom_suffix>`
Prerequisites:
- You must have configured a [Service Desk alias email](#configure-service-desk-alias-email).
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Service Desk**.
1. Below **Email address suffix**, enter the suffix to use.
1. Select **Save changes**.
For example, suppose the `mygroup/myproject` project Service Desk settings has the following configured:
- Email address suffix is set to `support`.
- Service Desk email address is configured to `contact+%{key}@example.com`.
The Service Desk email address for this project is: `contact+mygroup-myproject-support@example.com`.
The [incoming email](../../../administration/incoming_email.md) address still works.
If you don't configure a custom suffix, the default project identification is used for identifying
the project.
## Configure email ingestion in multi-node environments
A multi-node environment is a setup where GitLab is run across multiple servers
for scalability, fault tolerance, and performance reasons.
GitLab uses a separate process called `mail_room` to ingest new unread emails
from the `incoming_email` and `service_desk_email` mailboxes.
### Helm chart (Kubernetes)
The [GitLab Helm chart](https://docs.gitlab.com/charts/) is made up of multiple subcharts, and one of them is
the [Mailroom subchart](https://docs.gitlab.com/charts/charts/gitlab/mailroom/). Configure the
[common settings for `incoming_email`](https://docs.gitlab.com/charts/installation/command-line-options.html#incoming-email-configuration)
and the [common settings for `service_desk_email`](https://docs.gitlab.com/charts/installation/command-line-options.html#service-desk-email-configuration).
### Linux package (Omnibus)
In multi-node Linux package installation environments, run `mail_room` only on one node. Run it either on a single
`rails` node (for example, `application_role`)
or completely separately.
#### Set up all nodes
1. Add basic configuration for `incoming_email` and `service_desk_email` on every node
to render email addresses in the web UI and in generated emails.
Find the `incoming_email` or `service_desk_email` section in `/etc/gitlab/gitlab.rb`:
{{< tabs >}}
{{< tab title="`incoming_email`" >}}
```ruby
gitlab_rails['incoming_email_enabled'] = true
gitlab_rails['incoming_email_address'] = "incoming+%{key}@example.com"
```
{{< /tab >}}
{{< tab title="`service_desk_email`" >}}
```ruby
gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "project_contact+%{key}@example.com"
```
{{< /tab >}}
{{< /tabs >}}
1. GitLab offers two methods to transport emails from `mail_room` to the GitLab
application. You can configure the `delivery_method` for each email setting individually:
1. Recommended: `webhook` (default in GitLab 15.3 and later) sends the email payload with an API POST request to your GitLab
application. It uses a shared token to authenticate. If you choose this method,
make sure the `mail_room` process can access the API endpoint and distribute the shared
token across all application nodes.
{{< tabs >}}
{{< tab title="`incoming_email`" >}}
```ruby
gitlab_rails['incoming_email_delivery_method'] = "webhook"
# The URL that mail_room can contact. You can also use an internal URL or IP,
# just make sure mail_room can access the GitLab API with that address.
# Do not end with "/".
gitlab_rails['incoming_email_gitlab_url'] = "https://gitlab.example.com"
# The shared secret file that should contain a random token. Make sure it's the same on every node.
gitlab_rails['incoming_email_secret_file'] = ".gitlab_mailroom_secret"
```
{{< /tab >}}
{{< tab title="`service_desk_email`" >}}
```ruby
gitlab_rails['service_desk_email_delivery_method'] = "webhook"
# The URL that mail_room can contact. You can also use an internal URL or IP,
# just make sure mail_room can access the GitLab API with that address.
# Do not end with "/".
gitlab_rails['service_desk_email_gitlab_url'] = "https://gitlab.example.com"
# The shared secret file that should contain a random token. Make sure it's the same on every node.
gitlab_rails['service_desk_email_secret_file'] = ".gitlab_mailroom_secret"
```
{{< /tab >}}
{{< /tabs >}}
1. [Deprecated in GitLab 16.0 and planned for removal in 19.0](../../../update/deprecations.md#sidekiq-delivery-method-for-incoming_email-and-service_desk_email-is-deprecated):
If you experience issues with the `webhook` setup, use `sidekiq` to deliver the email payload directly to GitLab Sidekiq using Redis.
{{< tabs >}}
{{< tab title="`incoming_email`" >}}
```ruby
# It uses the Redis configuration to directly add Sidekiq jobs
gitlab_rails['incoming_email_delivery_method'] = "sidekiq"
```
{{< /tab >}}
{{< tab title="`service_desk_email`" >}}
```ruby
# It uses the Redis configuration to directly add Sidekiq jobs
gitlab_rails['service_desk_email_delivery_method'] = "sidekiq"
```
{{< /tab >}}
{{< /tabs >}}
1. Disable `mail_room` on all nodes that should not run email ingestion. For example, in `/etc/gitlab/gitlab.rb`:
```ruby
mailroom['enable'] = false
```
1. [Reconfigure GitLab](../../../administration/restart_gitlab.md) for the changes to take effect.
#### Set up a single email ingestion node
After setting up all nodes and disabling the `mail_room` process, enable `mail_room` on a single node.
This node polls the mailboxes for `incoming_email` and `service_desk_email` on a regular basis and
move new unread emails to GitLab.
1. Choose an existing node that additionally handles email ingestion.
1. Add [full configuration and credentials](../../../administration/incoming_email.md#configuration-examples)
for `incoming_email` and `service_desk_email`.
1. Enable `mail_room` on this node. For example, in `/etc/gitlab/gitlab.rb`:
```ruby
mailroom['enable'] = true
```
1. [Reconfigure GitLab](../../../administration/restart_gitlab.md) on this node for the changes to take effect.
|
https://docs.gitlab.com/user/project/requirements
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/requirements
|
[
"doc",
"user",
"project",
"requirements"
] |
_index.md
|
Plan
|
Product Planning
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Requirements management
|
Acceptance criteria, requirements test reports, and CSV import.
|
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With requirements, you can set criteria to check your products against. They can be based on users,
stakeholders, system, software, or anything else you find important to capture.
A requirement is an artifact in GitLab which describes the specific behavior of your product.
Requirements are long-lived and don't disappear unless manually cleared.
If an industry standard requires that your application has a certain feature or behavior, you can
[create a requirement](#create-a-requirement) to reflect this.
When a feature is no longer necessary, you can [archive the related requirement](#archive-a-requirement).
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Requirements Management](https://www.youtube.com/watch?v=uSS7oUNSEoU).
<!-- Video published on 2020-04-09 -->
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a more in-depth walkthrough see [GitLab Requirements Traceability Walkthrough](https://youtu.be/VIiuTQYFVa0).
<!-- Video published on 2020-02-12 -->

## Create a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
A paginated list of requirements is available in each project, and there you
can create a new requirement.
Prerequisites:
- You must have at least the Planner role.
To create a requirement:
1. In a project, go to **Plan > Requirements**.
1. Select **New requirement**.
1. Enter a title and description and select **New requirement**.

You can see the newly created requirement on the top of the list, with the requirements
list being sorted by creation date, in descending order.
## View a requirement
You can view a requirement from the list by selecting it.

To edit a requirement while viewing it, select the **Edit** icon ({{< icon name="pencil" >}})
next to the requirement title.
## Edit a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/424961) in GitLab 16.11: Authors and assignees can edit requirements even if they don't have the Reporter role.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit a requirement from the requirements list page.
Prerequisites:
- You must have at least the Planner role or be the author or assignee of the requirement.
To edit a requirement:
1. From the requirements list, select the **Edit** icon ({{< icon name="pencil" >}}).
1. Update the title and description in text input field. You can also mark a
requirement as satisfied in the edit form by using the checkbox **Satisfied**.
1. Select **Save changes**.
## Archive a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/424961) in GitLab 16.11: Authors and assignees can archive requirements even if they don't have the Reporter role.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can archive an open requirement while
you're in the **Open** tab.
Prerequisites:
- You must have at least the Planner role or be the author or assignee of the requirement.
To archive a requirement, select **Archive** ({{< icon name="archive" >}}).
As soon as a requirement is archived, it no longer appears in the **Open** tab.
## Reopen a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/424961) in GitLab 16.11: Authors and assignees can re-open requirements even if they don't have the Reporter role.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can view the list of archived requirements in the **Archived** tab.
Prerequisites:
- You must have at least the Planner role or be the author or assignee of the requirement.

To reopen an archived requirement, select **Reopen**.
As soon as a requirement is reopened, it no longer appears in the **Archived** tab.
## Search for a requirement
You can search for a requirement from the requirements list page based on the following criteria:
- Title
- Author's username
- Status (satisfied, failed, or missing)
To search for a requirement:
1. In a project, go to **Plan > Requirements > List**.
1. Select the **Search or filter results** field. A dropdown list appears.
1. Select the requirement author or status from the dropdown list or enter plain text to search by requirement title.
1. Press <kbd>Enter</kbd> on your keyboard to filter the list.
You can also sort the requirements list by:
- Created date
- Updated date
## Allow requirements to be satisfied from a CI job
GitLab supports [requirements test reports](../../../ci/yaml/artifacts_reports.md#artifactsreportsrequirements) now.
You can add a job to your CI pipeline that, when triggered, marks all existing
requirements as Satisfied (you may manually satisfy a requirement in the edit form [edit a requirement](#edit-a-requirement)).
### Add the manual job to CI
To configure your CI to mark requirements as Satisfied when the manual job is
triggered, add the code below to your `.gitlab-ci.yml` file.
```yaml
requirements_confirmation:
when: manual
allow_failure: false
script:
- mkdir tmp
- echo "{\"*\":\"passed\"}" > tmp/requirements.json
artifacts:
reports:
requirements: tmp/requirements.json
```
This definition adds a manually-triggered (`when: manual`) job to the CI
pipeline. It's blocking (`allow_failure: false`), but it's up to you what
conditions you use for triggering the CI job. Also, you can use any existing CI job
to mark all requirements as satisfied, as long as the `requirements.json`
artifact is generated and uploaded by the CI job.
When you manually trigger this job, the `requirements.json` file containing
`{"*":"passed"}` is uploaded as an artifact to the server. On the server side,
the requirement report is checked for the "all passed" record
(`{"*":"passed"}`), and on success, it marks all existing open requirements as
Satisfied.
#### Specifying individual requirements
It is possible to specify individual requirements and their statuses.
If the following requirements exist:
- `REQ-1` (with IID `1`)
- `REQ-2` (with IID `2`)
- `REQ-3` (with IID `3`)
It is possible to specify that the first requirement passed, and the second failed.
Valid values are "passed" and "failed".
By omitting a requirement IID (in this case `REQ-3`'s IID `3`), no result is noted.
```yaml
requirements_confirmation:
when: manual
allow_failure: false
script:
- mkdir tmp
- echo "{\"1\":\"passed\", \"2\":\"failed\"}" > tmp/requirements.json
artifacts:
reports:
requirements: tmp/requirements.json
```
### Add the manual job to CI conditionally
To configure your CI to include the manual job only when there are some open
requirements, add a rule which checks `CI_HAS_OPEN_REQUIREMENTS` CI/CD variable.
```yaml
requirements_confirmation:
rules:
- if: '$CI_HAS_OPEN_REQUIREMENTS == "true"'
when: manual
- when: never
allow_failure: false
script:
- mkdir tmp
- echo "{\"*\":\"passed\"}" > tmp/requirements.json
artifacts:
reports:
requirements: tmp/requirements.json
```
Because requirements and [test cases](../../../ci/test_cases/_index.md) are being
[migrated to work items](https://gitlab.com/groups/gitlab-org/-/epics/5171), if you have enabled work items
in a project, you must replace `requirements` in the previous config with `requirements_v2`:
```yaml
requirements_v2: tmp/requirements.json
```
## Import requirements from a CSV file
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You must have at least the Planner role.
You can import requirements to a project by uploading a [CSV file](https://en.wikipedia.org/wiki/Comma-separated_values)
with the columns `title` and `description`.
After the import, the user uploading the CSV file is set as the author of the imported requirements.
### Import the file
Before you import your file:
- Consider importing a test file containing only a few requirements. There is no way to undo a large
import without using the GitLab API.
- Ensure your CSV file meets the [file format](#imported-csv-file-format) requirements.
To import requirements:
1. In a project, go to **Plan > Requirements**.
- For a project with requirements, in the
upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}),
then select **Import requirements** ({{< icon name="import" >}}).
- For a project without requirements, in the middle of the page, select **Import CSV**.
1. Select the file and select **Import requirements**.
The file is processed in the background and a notification email is sent
to you after the import is complete.
### Imported CSV file format
When importing requirements from a CSV file, it must be formatted in a certain way:
- **Header row**: CSV files must include the following headers:
`title` and `description`. The headers are case-insensitive.
- **Columns**: data from columns other than `title` and `description` is not imported.
- **Separators**: the column separator is automatically detected from the header row.
Supported separator characters are: commas (`,`), semicolons (`;`), and tabs (`\t`).
The row separator can be either `CRLF` or `LF`.
- **Double-quote character**: the double-quote (`"`) character is used to quote fields,
enabling the use of the column separator in a field (see the third line in the
sample CSV data below). To insert a double-quote (`"`) in a quoted
field, use two double-quote characters in succession (`""`).
- **Data rows**: below the header row, succeeding rows must follow the same column
order. The title text is required, while the description is optional and can be left empty.
Sample CSV data:
```plaintext
title,description
My Requirement Title,My Requirement Description
Another Title,"A description, with a comma"
"One More Title","One More Description"
```
### File size
The limit depends on the configuration value of Max Attachment Size for the GitLab instance.
For GitLab.com, it is set to 10 MB.
## Export requirements to a CSV file
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can export GitLab requirements to a
[CSV file](https://en.wikipedia.org/wiki/Comma-separated_values) sent to your default notification
email as an attachment.
By exporting requirements, you and your team can import them into another tool or share them with
your customers. Exporting requirements can aid collaboration with higher-level systems, as well as
audit and regulatory compliance tasks.
Prerequisites:
- You must have at least the Planner role.
To export requirements:
1. In a project, go to **Plan > Requirements**.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}),
then select **Export as CSV** ({{< icon name="export" >}}).
A confirmation modal appears.
1. Under **Advanced export options**, select which fields to export.
All fields are selected by default. To exclude a field from being exported, clear the checkbox next to it.
1. Select **Export requirements**. The exported CSV file is sent to the email address associated with your user.
### Exported CSV file format
<!-- vale gitlab_base.Spelling = NO -->
You can preview the exported CSV file in a spreadsheet editor, such as Microsoft Excel,
OpenOffice Calc, or Google Sheets.
<!-- vale gitlab_base.Spelling = YES -->
The exported CSV file contains the following headers:
- Requirement ID
- Title
- Description
- Author
- Author Username
- Created At (UTC)
- State
- State Updated At (UTC)
|
---
stage: Plan
group: Product Planning
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Requirements management
description: Acceptance criteria, requirements test reports, and CSV import.
breadcrumbs:
- doc
- user
- project
- requirements
---
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With requirements, you can set criteria to check your products against. They can be based on users,
stakeholders, system, software, or anything else you find important to capture.
A requirement is an artifact in GitLab which describes the specific behavior of your product.
Requirements are long-lived and don't disappear unless manually cleared.
If an industry standard requires that your application has a certain feature or behavior, you can
[create a requirement](#create-a-requirement) to reflect this.
When a feature is no longer necessary, you can [archive the related requirement](#archive-a-requirement).
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Requirements Management](https://www.youtube.com/watch?v=uSS7oUNSEoU).
<!-- Video published on 2020-04-09 -->
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a more in-depth walkthrough see [GitLab Requirements Traceability Walkthrough](https://youtu.be/VIiuTQYFVa0).
<!-- Video published on 2020-02-12 -->

## Create a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
A paginated list of requirements is available in each project, and there you
can create a new requirement.
Prerequisites:
- You must have at least the Planner role.
To create a requirement:
1. In a project, go to **Plan > Requirements**.
1. Select **New requirement**.
1. Enter a title and description and select **New requirement**.

You can see the newly created requirement on the top of the list, with the requirements
list being sorted by creation date, in descending order.
## View a requirement
You can view a requirement from the list by selecting it.

To edit a requirement while viewing it, select the **Edit** icon ({{< icon name="pencil" >}})
next to the requirement title.
## Edit a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/424961) in GitLab 16.11: Authors and assignees can edit requirements even if they don't have the Reporter role.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can edit a requirement from the requirements list page.
Prerequisites:
- You must have at least the Planner role or be the author or assignee of the requirement.
To edit a requirement:
1. From the requirements list, select the **Edit** icon ({{< icon name="pencil" >}}).
1. Update the title and description in text input field. You can also mark a
requirement as satisfied in the edit form by using the checkbox **Satisfied**.
1. Select **Save changes**.
## Archive a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/424961) in GitLab 16.11: Authors and assignees can archive requirements even if they don't have the Reporter role.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can archive an open requirement while
you're in the **Open** tab.
Prerequisites:
- You must have at least the Planner role or be the author or assignee of the requirement.
To archive a requirement, select **Archive** ({{< icon name="archive" >}}).
As soon as a requirement is archived, it no longer appears in the **Open** tab.
## Reopen a requirement
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/424961) in GitLab 16.11: Authors and assignees can re-open requirements even if they don't have the Reporter role.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can view the list of archived requirements in the **Archived** tab.
Prerequisites:
- You must have at least the Planner role or be the author or assignee of the requirement.

To reopen an archived requirement, select **Reopen**.
As soon as a requirement is reopened, it no longer appears in the **Archived** tab.
## Search for a requirement
You can search for a requirement from the requirements list page based on the following criteria:
- Title
- Author's username
- Status (satisfied, failed, or missing)
To search for a requirement:
1. In a project, go to **Plan > Requirements > List**.
1. Select the **Search or filter results** field. A dropdown list appears.
1. Select the requirement author or status from the dropdown list or enter plain text to search by requirement title.
1. Press <kbd>Enter</kbd> on your keyboard to filter the list.
You can also sort the requirements list by:
- Created date
- Updated date
## Allow requirements to be satisfied from a CI job
GitLab supports [requirements test reports](../../../ci/yaml/artifacts_reports.md#artifactsreportsrequirements) now.
You can add a job to your CI pipeline that, when triggered, marks all existing
requirements as Satisfied (you may manually satisfy a requirement in the edit form [edit a requirement](#edit-a-requirement)).
### Add the manual job to CI
To configure your CI to mark requirements as Satisfied when the manual job is
triggered, add the code below to your `.gitlab-ci.yml` file.
```yaml
requirements_confirmation:
when: manual
allow_failure: false
script:
- mkdir tmp
- echo "{\"*\":\"passed\"}" > tmp/requirements.json
artifacts:
reports:
requirements: tmp/requirements.json
```
This definition adds a manually-triggered (`when: manual`) job to the CI
pipeline. It's blocking (`allow_failure: false`), but it's up to you what
conditions you use for triggering the CI job. Also, you can use any existing CI job
to mark all requirements as satisfied, as long as the `requirements.json`
artifact is generated and uploaded by the CI job.
When you manually trigger this job, the `requirements.json` file containing
`{"*":"passed"}` is uploaded as an artifact to the server. On the server side,
the requirement report is checked for the "all passed" record
(`{"*":"passed"}`), and on success, it marks all existing open requirements as
Satisfied.
#### Specifying individual requirements
It is possible to specify individual requirements and their statuses.
If the following requirements exist:
- `REQ-1` (with IID `1`)
- `REQ-2` (with IID `2`)
- `REQ-3` (with IID `3`)
It is possible to specify that the first requirement passed, and the second failed.
Valid values are "passed" and "failed".
By omitting a requirement IID (in this case `REQ-3`'s IID `3`), no result is noted.
```yaml
requirements_confirmation:
when: manual
allow_failure: false
script:
- mkdir tmp
- echo "{\"1\":\"passed\", \"2\":\"failed\"}" > tmp/requirements.json
artifacts:
reports:
requirements: tmp/requirements.json
```
### Add the manual job to CI conditionally
To configure your CI to include the manual job only when there are some open
requirements, add a rule which checks `CI_HAS_OPEN_REQUIREMENTS` CI/CD variable.
```yaml
requirements_confirmation:
rules:
- if: '$CI_HAS_OPEN_REQUIREMENTS == "true"'
when: manual
- when: never
allow_failure: false
script:
- mkdir tmp
- echo "{\"*\":\"passed\"}" > tmp/requirements.json
artifacts:
reports:
requirements: tmp/requirements.json
```
Because requirements and [test cases](../../../ci/test_cases/_index.md) are being
[migrated to work items](https://gitlab.com/groups/gitlab-org/-/epics/5171), if you have enabled work items
in a project, you must replace `requirements` in the previous config with `requirements_v2`:
```yaml
requirements_v2: tmp/requirements.json
```
## Import requirements from a CSV file
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You must have at least the Planner role.
You can import requirements to a project by uploading a [CSV file](https://en.wikipedia.org/wiki/Comma-separated_values)
with the columns `title` and `description`.
After the import, the user uploading the CSV file is set as the author of the imported requirements.
### Import the file
Before you import your file:
- Consider importing a test file containing only a few requirements. There is no way to undo a large
import without using the GitLab API.
- Ensure your CSV file meets the [file format](#imported-csv-file-format) requirements.
To import requirements:
1. In a project, go to **Plan > Requirements**.
- For a project with requirements, in the
upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}),
then select **Import requirements** ({{< icon name="import" >}}).
- For a project without requirements, in the middle of the page, select **Import CSV**.
1. Select the file and select **Import requirements**.
The file is processed in the background and a notification email is sent
to you after the import is complete.
### Imported CSV file format
When importing requirements from a CSV file, it must be formatted in a certain way:
- **Header row**: CSV files must include the following headers:
`title` and `description`. The headers are case-insensitive.
- **Columns**: data from columns other than `title` and `description` is not imported.
- **Separators**: the column separator is automatically detected from the header row.
Supported separator characters are: commas (`,`), semicolons (`;`), and tabs (`\t`).
The row separator can be either `CRLF` or `LF`.
- **Double-quote character**: the double-quote (`"`) character is used to quote fields,
enabling the use of the column separator in a field (see the third line in the
sample CSV data below). To insert a double-quote (`"`) in a quoted
field, use two double-quote characters in succession (`""`).
- **Data rows**: below the header row, succeeding rows must follow the same column
order. The title text is required, while the description is optional and can be left empty.
Sample CSV data:
```plaintext
title,description
My Requirement Title,My Requirement Description
Another Title,"A description, with a comma"
"One More Title","One More Description"
```
### File size
The limit depends on the configuration value of Max Attachment Size for the GitLab instance.
For GitLab.com, it is set to 10 MB.
## Export requirements to a CSV file
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can export GitLab requirements to a
[CSV file](https://en.wikipedia.org/wiki/Comma-separated_values) sent to your default notification
email as an attachment.
By exporting requirements, you and your team can import them into another tool or share them with
your customers. Exporting requirements can aid collaboration with higher-level systems, as well as
audit and regulatory compliance tasks.
Prerequisites:
- You must have at least the Planner role.
To export requirements:
1. In a project, go to **Plan > Requirements**.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}),
then select **Export as CSV** ({{< icon name="export" >}}).
A confirmation modal appears.
1. Under **Advanced export options**, select which fields to export.
All fields are selected by default. To exclude a field from being exported, clear the checkbox next to it.
1. Select **Export requirements**. The exported CSV file is sent to the email address associated with your user.
### Exported CSV file format
<!-- vale gitlab_base.Spelling = NO -->
You can preview the exported CSV file in a spreadsheet editor, such as Microsoft Excel,
OpenOffice Calc, or Google Sheets.
<!-- vale gitlab_base.Spelling = YES -->
The exported CSV file contains the following headers:
- Requirement ID
- Title
- Description
- Author
- Author Username
- Created At (UTC)
- State
- State Updated At (UTC)
|
https://docs.gitlab.com/user/project/allow_collaboration
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/allow_collaboration.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
allow_collaboration.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Collaborate on merge requests across forks
|
When you fork a merge request, you can set whether or not members of the upstream repository can contribute to your fork.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you open a merge request from your [fork](../repository/forking_workflow.md), you can allow upstream
members to collaborate with you on your branch.
When you enable this option, members who have permission to merge to the target branch get
permission to write to the merge request's source branch.
The members of the upstream project can then make small fixes or rebase branches
before merging.
This feature is available for merge requests across forked projects that are
[publicly accessible](../../public_access.md).
## Allow commits from upstream members
As the author of a merge request, you can allow commit edits from
upstream members of the project you're contributing to:
1. While creating or editing a merge request, scroll to **Contribution** and
select the **Allow commits from members who can merge to the target branch**
checkbox.
1. Finish creating your merge request.
After you create the merge request, the merge request widget displays the message
**Members who can merge are allowed to add commits**. Upstream members can then:
- Commit directly to your branch.
- Retry the pipelines and jobs of the merge request.
## Prevent commits from upstream members
As the author of a merge request, you can prevent commit edits from
upstream members of the project you're contributing to:
1. While creating or editing a merge request, scroll to **Contribution** and
clear the **Allow commits from members who can merge to the target branch**
checkbox.
1. Finish creating your merge request.
## Push to the fork as the upstream member
You can push directly to the branch of the forked repository if:
- The author of the merge request enabled contributions from upstream members.
- You have at least the Developer role for the upstream project.
To push changes, or add a commit, to the branch of a fork, you can use command line Git.
For more information, see [use Git to push to a fork as an upstream member](../../../topics/git/forks.md#push-to-a-fork-as-an-upstream-member).
## Troubleshooting
### Pipeline status unavailable from MR page of forked project
When a user forks a project, the permissions of the forked copy are not copied
from the original project. The creator of the fork must grant permissions to the
forked copy before members in the upstream project can view or merge the changes
in the merge request.
To see the pipeline status from the merge request page of a forked project
going back to the original project:
1. [Create a group](../../group/_index.md#create-a-group) containing all the upstream members.
1. On the left sidebar, select **Search or go to** and find the forked project.
1. Go to the **Manage > Members** page in the forked project and invite the newly-created
group to the forked project.
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: When you fork a merge request, you can set whether or not members of
the upstream repository can contribute to your fork.
title: Collaborate on merge requests across forks
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you open a merge request from your [fork](../repository/forking_workflow.md), you can allow upstream
members to collaborate with you on your branch.
When you enable this option, members who have permission to merge to the target branch get
permission to write to the merge request's source branch.
The members of the upstream project can then make small fixes or rebase branches
before merging.
This feature is available for merge requests across forked projects that are
[publicly accessible](../../public_access.md).
## Allow commits from upstream members
As the author of a merge request, you can allow commit edits from
upstream members of the project you're contributing to:
1. While creating or editing a merge request, scroll to **Contribution** and
select the **Allow commits from members who can merge to the target branch**
checkbox.
1. Finish creating your merge request.
After you create the merge request, the merge request widget displays the message
**Members who can merge are allowed to add commits**. Upstream members can then:
- Commit directly to your branch.
- Retry the pipelines and jobs of the merge request.
## Prevent commits from upstream members
As the author of a merge request, you can prevent commit edits from
upstream members of the project you're contributing to:
1. While creating or editing a merge request, scroll to **Contribution** and
clear the **Allow commits from members who can merge to the target branch**
checkbox.
1. Finish creating your merge request.
## Push to the fork as the upstream member
You can push directly to the branch of the forked repository if:
- The author of the merge request enabled contributions from upstream members.
- You have at least the Developer role for the upstream project.
To push changes, or add a commit, to the branch of a fork, you can use command line Git.
For more information, see [use Git to push to a fork as an upstream member](../../../topics/git/forks.md#push-to-a-fork-as-an-upstream-member).
## Troubleshooting
### Pipeline status unavailable from MR page of forked project
When a user forks a project, the permissions of the forked copy are not copied
from the original project. The creator of the fork must grant permissions to the
forked copy before members in the upstream project can view or merge the changes
in the merge request.
To see the pipeline status from the merge request page of a forked project
going back to the original project:
1. [Create a group](../../group/_index.md#create-a-group) containing all the upstream members.
1. On the left sidebar, select **Search or go to** and find the forked project.
1. Go to the **Manage > Members** page in the forked project and invite the newly-created
group to the forked project.
|
https://docs.gitlab.com/user/project/versions
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/versions.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
versions.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request diff versions
|
Use diff versions to compare pushes contained in a single merge request.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you create a merge request, you select two branches to compare. The differences
between the two branches are shown as a diff in the merge request. Each time
you push commits to a branch connected to a merge request, GitLab updates the
merge request diff to a new diff version.
{{< alert type="note" >}}
Diff versions are updated on each push, not each commit. If a push contains multiple
commits, only one new diff version is created.
{{< /alert >}}
By default, GitLab compares the latest push in your source branch (`feature`)
against the most recent commit in the target branch, often `main`.
## Compare diff versions
If you've pushed to your branch multiple times, the diff version from each previous push
is available for comparison. When your merge request contains many changes or
sequential changes to the same file, you might want to compare a smaller number of changes.
Prerequisites:
- The merge request branch must contain commits from multiple pushes. Individual commits
in the same push do not generate new diff versions.
To compare diff versions:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select a merge request.
1. To view the current diff version for this merge request, select **Changes**.
1. Next to **Compare** ({{< icon name="file-tree" >}}), select the pushes to compare. This example
compares `main` to the most recent push (latest diff version) of the branch:

This example branch has four commits, but the branch contains only three diff versions
because two commits were pushed at the same time.
## View diff versions from a system note
GitLab adds a system note to a merge request each time you push new changes to
the merge request's branch. In this example, a single push added two commits:

To view the diff for that commit, select the commit SHA.
For more information, see how to [show or filter system notes on a merge request](../system_notes.md#on-a-merge-request).
## Related topics
- [Merge request diff storage for administrators](../../../administration/merge_request_diffs.md)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use diff versions to compare pushes contained in a single merge request.
title: Merge request diff versions
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you create a merge request, you select two branches to compare. The differences
between the two branches are shown as a diff in the merge request. Each time
you push commits to a branch connected to a merge request, GitLab updates the
merge request diff to a new diff version.
{{< alert type="note" >}}
Diff versions are updated on each push, not each commit. If a push contains multiple
commits, only one new diff version is created.
{{< /alert >}}
By default, GitLab compares the latest push in your source branch (`feature`)
against the most recent commit in the target branch, often `main`.
## Compare diff versions
If you've pushed to your branch multiple times, the diff version from each previous push
is available for comparison. When your merge request contains many changes or
sequential changes to the same file, you might want to compare a smaller number of changes.
Prerequisites:
- The merge request branch must contain commits from multiple pushes. Individual commits
in the same push do not generate new diff versions.
To compare diff versions:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select a merge request.
1. To view the current diff version for this merge request, select **Changes**.
1. Next to **Compare** ({{< icon name="file-tree" >}}), select the pushes to compare. This example
compares `main` to the most recent push (latest diff version) of the branch:

This example branch has four commits, but the branch contains only three diff versions
because two commits were pushed at the same time.
## View diff versions from a system note
GitLab adds a system note to a merge request each time you push new changes to
the merge request's branch. In this example, a single push added two commits:

To view the diff for that commit, select the commit SHA.
For more information, see how to [show or filter system notes on a merge request](../system_notes.md#on-a-merge-request).
## Related topics
- [Merge request diff storage for administrators](../../../administration/merge_request_diffs.md)
|
https://docs.gitlab.com/user/project/merge_requests
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
_index.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge requests
|
Code review, collaboration, branch merging, and commits.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Sidebar actions menu [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/373757) to also move actions on issues, incidents, and epics in GitLab 16.0.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127001) in GitLab 16.9. Feature flag `moved_mr_sidebar` removed.
{{< /history >}}
Merge requests provide a central location for your team to review code, have discussions,
and track code changes.
To help describe why a change was made, link a merge request to an issue and
automatically close the issue when the merge request merges.
Merge requests help ensure subject matter experts review your proposed changes and
your organization's security requirements are met.
When you create your merge request early in the development process, your team has time to catch bugs and code quality problems.
When viewing a merge request, you see:
- A description of the request.
- Code changes and inline code reviews.
- Information about CI/CD pipelines.
- Mergeability reports.
- Comments.
- The list of commits.
## Create a merge request
Learn the various ways to [create a merge request](creating_merge_requests.md).
### Use merge request templates
When you create a merge request, GitLab checks for the existence of a
[description template](../description_templates.md) to add data to your merge request.
GitLab checks these locations in order from 1 to 5, and applies the first template
found to your merge request:
| Name | Project UI<br>setting | Group<br>`default.md` | Instance<br>`default.md` | Project<br>`default.md` | No template |
|:-----|:---------------------:|:---------------------:|:------------------------:|:-----------------------:|:-----------:|
| Standard commit message | 1 | 2 | 3 | 4 | 5 |
| Commit message with an [issue closing pattern](../issues/managing_issues.md#closing-issues-automatically) like `Closes #1234` | 1 | 2 | 3 | 4 | 5 \* |
| Branch name [prefixed with an issue ID](../repository/branches/_index.md#prefix-branch-names-with-a-number), like `1234-example` | 1 \* | 2 \* | 3 \* | 4 \* | 5 \* |
{{< alert type="note" >}}
Items marked with an asterisk (\*) also append an [issue closing pattern](../issues/managing_issues.md#closing-issues-automatically).
{{< /alert >}}
## View merge requests
You can view merge requests for your project, group, or yourself.
{{< tabs >}}
{{< tab title="You're participating in" >}}
To view all merge requests on the homepage, use the <kbd>Shift</kbd> + <kbd>m</kbd>
[keyboard shortcut](../../shortcuts.md), or:
1. On the left sidebar, select the **Merge requests** icon.
or:
1. On the left sidebar, select **Search or go to**.
1. From the dropdown list, select **Merge requests**.
{{< /tab >}}
{{< tab title="For a project" >}}
To view all merge requests for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
Or, to use a [keyboard shortcut](../../shortcuts.md), press <kbd>g</kbd> + <kbd>m</kbd>.
{{< /tab >}}
{{< tab title="For all projects in a group" >}}
To view merge requests for all projects in a group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Code > Merge requests**.
If your group contains subgroups, this view also displays merge requests from the subgroup projects.
{{< /tab >}}
{{< tab title="For a file" >}}
When viewing a file in your repository, GitLab shows a badge with the number of open merge requests that target the current branch and modify the file. This helps you identify files that have pending changes.
The availability of this feature is controlled by a feature flag.
For more information, see [View open merge requests for a file](../repository/files/_index.md#view-open-merge-requests-for-a-file).
To view the open merge requests for a file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file you want to view.
1. At the top right of the screen, next to the filename, look for the green badge with the number
of {{< icon name="merge-request-open" >}} **Open** merge requests.
1. Select the badge to see a list of open merge requests created in the past 30 days.
1. Select any merge request in the list to go to that merge request.
{{< /tab >}}
{{< /tabs >}}
## Filter the list of merge requests
{{< history >}}
- Filtering by `source branch` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134555) in GitLab 16.6.
- Filtering by `merged by` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140002) in GitLab 16.9. Available only when the feature flag `mr_merge_user_filter` is enabled.
- Filtering by `merged by` [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142666) in GitLab 17.0. Feature flag `mr_merge_user_filter` removed.
{{< /history >}}
To filter the list of merge requests:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Above the list of merge requests, select **Search or filter results**.
1. From the dropdown list, select the attribute you wish to filter by. Some examples:
- [**By environment or deployment date**](#by-environment-or-deployment-date).
- **ID**: Enter filter `#30` to return only merge request 30.
- User filters: Type (or select from the dropdown list) any of these filters to display a list of users:
- **Approved by**, for merge requests already approved by a user. Premium and Ultimate only.
- **Approver**, for merge requests that this user is eligible to approve.
(For more information, read about [Code owners](../codeowners/_index.md)). Premium and Ultimate only.
- **Merged by**, for merge requests merged by this user.
- **Reviewer**, for merge requests reviewed by this user.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
- `=`: Is
- `!=`: Is not
1. Enter the text to filter the attribute by.
You can filter some attributes by **None** or **Any**.
1. Repeat this process to filter by more attributes, joined by a logical
`AND`.
1. Select a **Sort direction**, either {{< icon name="sort-lowest" >}} for descending order,
or {{< icon name="sort-highest" >}} for ascending order.
### By environment or deployment date
To filter merge requests by deployment data, such as the environment or a date,
you can type (or select from the dropdown list) the following:
- Environment
- Deployed before
- Deployed after
{{< alert type="note" >}}
Projects using a [fast-forward merge method](methods/_index.md#fast-forward-merge)
do not return results, as this method does not create a merge commit.
{{< /alert >}}
When filtering by an environment, a dropdown list presents all environments that
you can choose from.
When filtering by `Deployed before` or `Deployed after`:
- The date refers to when the deployment to an environment (triggered by the
merge commit) completed successfully.
- You must enter the deploy date manually.
- Deploy dates use the format `YYYY-MM-DD`. Wrap them in double quotes (`"`)
if you want to specify both a date and time (`"YYYY-MM-DD HH:MM"`).
## Add changes to a merge request
If you have permission to add changes to a merge request, you can add your changes
to an existing merge request in several ways. These ways depend on the complexity of your
change, and whether you need access to a development environment:
- [Edit changes in the Web IDE](../web_ide/_index.md) in your browser with the
<kbd>.</kbd> [keyboard shortcut](../../shortcuts.md). Use this
browser-based method to edit multiple files, or if you are not comfortable with Git commands.
You cannot run tests from the Web IDE.
- [Edit changes in Gitpod](../../../integration/gitpod.md#launch-gitpod-in-gitlab), if you
need a fully-featured environment to both edit files, and run tests afterward. Gitpod
supports running the [GitLab Development Kit (GDK)](https://gitlab.com/gitlab-org/gitlab-development-kit).
To use Gitpod, you must [enable Gitpod in your user account](../../../integration/gitpod.md#enable-gitpod-in-your-user-preferences).
- [Push changes from the command line](../../../topics/git/commands.md), if you are
familiar with Git and the command line.
## Assign a user to a merge request
To assign the merge request to a user, use the `/assign @user`
[quick action](../quick_actions.md#issues-merge-requests-and-epics) in a text area in
a merge request, or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. On the right sidebar, expand the right sidebar and locate the **Assignees** section.
1. Select **Edit**.
1. Search for the user you want to assign, and select the user. GitLab Free allows one
assignee per merge request, but GitLab Premium and GitLab Ultimate allow multiple assignees:

GitLab adds the merge request to the user's **Assigned merge requests** page.
## Merge a merge request
During the [merge request review process](reviews/_index.md), reviewers provide
feedback on your changes. When a reviewer is satisfied with the changes,
they can enable [auto-merge](auto_merge.md), even if some merge checks are failing.
After all merge checks pass, the merge request is automatically merged, without further action from you.
Default merge permissions:
- The default branch, typically `main`, is protected.
- Only Maintainers and higher roles can merge into the default branch.
- Developers can merge any merge requests targeting non-protected branches.
To determine if you have permission to merge a specific merge request, GitLab checks:
- Your [role in the project](../../permissions.md#roles). For example, Developer, Maintainer, or Owner.
- The [branch protections](../repository/branches/protected.md) of the target branch.
## Close a merge request
If you decide to permanently stop work on a merge request, close it rather than
[deleting it](manage.md#delete-a-merge-request).
Prerequisites:
- You must be the author or assignees of the merge request, or
- You must have the Developer, Maintainer, or Owner [roles](../../permissions.md) in a project.
To close merge requests in the project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Scroll to the comment box at the bottom of the page.
1. Following the comment box, select **Close merge request**.
GitLab closes the merge request, but preserves records of the merge request,
its comments, and any associated pipelines.
### Delete the source branch on merge
You can delete the source branch for a merge request:
- When you create a merge request, by selecting **Delete source branch when merge request accepted**.
- When you merge a merge request, if you have the Maintainer role, by selecting **Delete source branch**.
An administrator can make this option the default in the project's settings.
The delete-branch action is performed by the user who sets auto-merge, or merges the merge request.
If the user lacks the correct role, such as in a forked project, the source branch deletion fails.
### Update merge requests when target branch merges
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Merge requests are often chained together, with one merge request depending on
the code added or changed in another merge request. To support keeping individual
merge requests small, GitLab can update up to four open merge requests when their
target branch merges into `main`. For example:
- Merge request 1: merge `feature-alpha` into `main`.
- Merge request 2: merge `feature-beta` into `feature-alpha`.
If these merge requests are open at the same time, and merge request 1 (`feature-alpha`)
merges into `main`, GitLab updates the destination of merge request 2 from `feature-alpha`
to `main`.
Merge requests with interconnected content updates are usually handled in one of these ways:
- Merge request 1 merges into `main` first. Merge request 2 is then
retargeted to `main`.
- Merge request 2 merges into `feature-alpha`. The updated merge request 1, which
now contains the contents of `feature-alpha` and `feature-beta`, merges into `main`.
This feature works only when a merge request is merged. Selecting **Remove source branch**
after merging does not retarget open merge requests. This improvement is
[proposed as a follow-up](https://gitlab.com/gitlab-org/gitlab/-/issues/321559).
## Merge request workflows
For a software developer working in a team:
1. You check out a new branch, and submit your changes through a merge request.
1. You gather feedback from your team.
1. You work on the implementation optimizing code with [Code Quality reports](../../../ci/testing/code_quality.md).
1. You verify your changes with [Unit test reports](../../../ci/testing/unit_test_reports.md) in GitLab CI/CD.
1. You avoid using dependencies whose license is not compatible with your project with [License approval policies](../../compliance/license_approval_policies.md).
1. You request the [approval](approvals/_index.md) from your manager.
1. Your manager:
1. Pushes a commit with their final review.
1. [Approves the merge request](approvals/_index.md).
1. Sets it to [auto-merge](auto_merge.md) (formerly **Merge when pipeline succeeds**).
1. Your changes get deployed to production with [manual jobs](../../../ci/jobs/job_control.md#create-a-job-that-must-be-run-manually) for GitLab CI/CD.
1. Your implementations were successfully shipped to your customer.
For a web developer writing a webpage for your company's website:
1. You check out a new branch and submit a new page through a merge request.
1. You gather feedback from your reviewers.
1. You preview your changes with [review apps](../../../ci/review_apps/_index.md).
1. You request your web designers for their implementation.
1. You request the [approval](approvals/_index.md) from your manager.
1. After approval, GitLab:
- [Squashes](squash_and_merge.md) the commits.
- Merges the commit.
- [Deployed the changes to staging with GitLab Pages](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/).
1. Your production team [cherry-picks](cherry_pick_changes.md) the merge commit into production.
## Filter activity in a merge request
{{< history >}}
- Feature flag `mr_activity_filters` [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/387070) in GitLab 16.0.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126998) in GitLab 16.3 by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132355) in GitLab 16.5. Feature flag `mr_activity_filters` removed.
- Filtering bot comments [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128473) in GitLab 16.9.
{{< /history >}}
To understand the history of a merge request, filter its activity feed to show you
only the items that are relevant to you.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select a merge request.
1. Scroll to **Activity**.
1. On the right side of the page, select **Activity filter** to show the filter options.
If you've already selected filter options, this field shows a summary of your
choices, like **Activity + 5 more**.
1. Select the types of activity you want to see. Options include:
- Assignees & Reviewers
- Approvals
- Comments (from bots)
- Comments (from users)
- Commits & branches
- Edits
- Labels
- Lock status
- Mentions
- Merge request status
- Tracking
1. Optional. Select **Sort** ({{< icon name="sort-lowest" >}}) to reverse the sort order.
Your selection persists across all merge requests. You can also change the
sort order by clicking the sort button on the right.
## Resolve a thread
When you want to finish a conversation in a merge request,
[resolve a thread](../../discussions/_index.md#resolve-a-thread).
GitLab shows the number of open threads in the top right corner of a
merge request, like this: `7 open threads`.
### Move all open threads in a merge request to an issue
If you have multiple open threads in a merge request, you can
create an issue to resolve them separately:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In the merge request, in the top right, find the **Open threads**
dropdown list, and select **Thread options** ({{< icon name="ellipsis_v" >}}).
1. Select **Resolve all with new issue**.
1. Fill out the fields in the new issue, and select **Create issue**.
GitLab marks all threads as resolved, and adds a link from the merge request to
the newly created issue.
### Move one open thread in a merge request to an issue
If you have one specific open thread in a merge request, you can
create an issue to resolve it separately:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In the merge request, find the thread you want to move.
1. Below the last reply to the thread, next to **Resolve thread**, select
**Create issue to resolve thread** ({{< icon name="issue-new" >}}).
1. Fill out the fields in the new issue, and select **Create issue**.
GitLab marks the thread as resolved, and adds a link from the merge request to
the newly created issue.
### Prevent merge unless all threads are resolved
You can prevent merge requests from merging while threads remain open.
When you enable this setting, the **Open threads** counter in a merge request
is shown in orange while at least one thread remains open.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge checks** section, select the **All threads must be resolved** checkbox.
1. Select **Save changes**.
### Automatically resolve threads in a merge request when they become outdated
You can set merge requests to automatically resolve threads when a new push
changes the lines they describe.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge options** section, select
**Automatically resolve merge request diff threads when they become outdated**.
1. Select **Save changes**.
Threads are now resolved if a push makes a diff section outdated.
Threads on lines that don't change and top-level resolvable threads are not resolved.
## Move notifications and to-dos
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132678) in GitLab 16.5 [with a flag](../../../administration/feature_flags/_index.md) named `notifications_todos_buttons`. Disabled by default.
- [Issues, incidents](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133474), and [epics](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133881) also updated.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../../administration/feature_flags/_index.md) named `notifications_todos_buttons`.
On GitLab.com and GitLab Dedicated, this feature is not available.
{{< /alert >}}
Enabling this feature flag moves the notifications and to-do item buttons to the upper right corner of the page.
- On merge requests, these buttons are shown to the far right of the tabs.
- On issues, incidents, and epics, these buttons are shown at the top of the right sidebar.
## Related topics
- [Create a merge request](creating_merge_requests.md)
- [Review a merge request](reviews/_index.md)
- [Authorization for merge requests](authorization_for_merge_requests.md)
- [Testing and reports](../../../ci/testing/_index.md)
- [GitLab keyboard shortcuts](../../shortcuts.md)
- [Comments and threads](../../discussions/_index.md)
- [Suggest code changes](reviews/suggestions.md)
- [CI/CD pipelines](../../../ci/_index.md)
- [Push options](../../../topics/git/commit.md) for merge requests
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Code review, collaboration, branch merging, and commits.
title: Merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Sidebar actions menu [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/373757) to also move actions on issues, incidents, and epics in GitLab 16.0.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127001) in GitLab 16.9. Feature flag `moved_mr_sidebar` removed.
{{< /history >}}
Merge requests provide a central location for your team to review code, have discussions,
and track code changes.
To help describe why a change was made, link a merge request to an issue and
automatically close the issue when the merge request merges.
Merge requests help ensure subject matter experts review your proposed changes and
your organization's security requirements are met.
When you create your merge request early in the development process, your team has time to catch bugs and code quality problems.
When viewing a merge request, you see:
- A description of the request.
- Code changes and inline code reviews.
- Information about CI/CD pipelines.
- Mergeability reports.
- Comments.
- The list of commits.
## Create a merge request
Learn the various ways to [create a merge request](creating_merge_requests.md).
### Use merge request templates
When you create a merge request, GitLab checks for the existence of a
[description template](../description_templates.md) to add data to your merge request.
GitLab checks these locations in order from 1 to 5, and applies the first template
found to your merge request:
| Name | Project UI<br>setting | Group<br>`default.md` | Instance<br>`default.md` | Project<br>`default.md` | No template |
|:-----|:---------------------:|:---------------------:|:------------------------:|:-----------------------:|:-----------:|
| Standard commit message | 1 | 2 | 3 | 4 | 5 |
| Commit message with an [issue closing pattern](../issues/managing_issues.md#closing-issues-automatically) like `Closes #1234` | 1 | 2 | 3 | 4 | 5 \* |
| Branch name [prefixed with an issue ID](../repository/branches/_index.md#prefix-branch-names-with-a-number), like `1234-example` | 1 \* | 2 \* | 3 \* | 4 \* | 5 \* |
{{< alert type="note" >}}
Items marked with an asterisk (\*) also append an [issue closing pattern](../issues/managing_issues.md#closing-issues-automatically).
{{< /alert >}}
## View merge requests
You can view merge requests for your project, group, or yourself.
{{< tabs >}}
{{< tab title="You're participating in" >}}
To view all merge requests on the homepage, use the <kbd>Shift</kbd> + <kbd>m</kbd>
[keyboard shortcut](../../shortcuts.md), or:
1. On the left sidebar, select the **Merge requests** icon.
or:
1. On the left sidebar, select **Search or go to**.
1. From the dropdown list, select **Merge requests**.
{{< /tab >}}
{{< tab title="For a project" >}}
To view all merge requests for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
Or, to use a [keyboard shortcut](../../shortcuts.md), press <kbd>g</kbd> + <kbd>m</kbd>.
{{< /tab >}}
{{< tab title="For all projects in a group" >}}
To view merge requests for all projects in a group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Code > Merge requests**.
If your group contains subgroups, this view also displays merge requests from the subgroup projects.
{{< /tab >}}
{{< tab title="For a file" >}}
When viewing a file in your repository, GitLab shows a badge with the number of open merge requests that target the current branch and modify the file. This helps you identify files that have pending changes.
The availability of this feature is controlled by a feature flag.
For more information, see [View open merge requests for a file](../repository/files/_index.md#view-open-merge-requests-for-a-file).
To view the open merge requests for a file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file you want to view.
1. At the top right of the screen, next to the filename, look for the green badge with the number
of {{< icon name="merge-request-open" >}} **Open** merge requests.
1. Select the badge to see a list of open merge requests created in the past 30 days.
1. Select any merge request in the list to go to that merge request.
{{< /tab >}}
{{< /tabs >}}
## Filter the list of merge requests
{{< history >}}
- Filtering by `source branch` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134555) in GitLab 16.6.
- Filtering by `merged by` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140002) in GitLab 16.9. Available only when the feature flag `mr_merge_user_filter` is enabled.
- Filtering by `merged by` [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142666) in GitLab 17.0. Feature flag `mr_merge_user_filter` removed.
{{< /history >}}
To filter the list of merge requests:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Above the list of merge requests, select **Search or filter results**.
1. From the dropdown list, select the attribute you wish to filter by. Some examples:
- [**By environment or deployment date**](#by-environment-or-deployment-date).
- **ID**: Enter filter `#30` to return only merge request 30.
- User filters: Type (or select from the dropdown list) any of these filters to display a list of users:
- **Approved by**, for merge requests already approved by a user. Premium and Ultimate only.
- **Approver**, for merge requests that this user is eligible to approve.
(For more information, read about [Code owners](../codeowners/_index.md)). Premium and Ultimate only.
- **Merged by**, for merge requests merged by this user.
- **Reviewer**, for merge requests reviewed by this user.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
- `=`: Is
- `!=`: Is not
1. Enter the text to filter the attribute by.
You can filter some attributes by **None** or **Any**.
1. Repeat this process to filter by more attributes, joined by a logical
`AND`.
1. Select a **Sort direction**, either {{< icon name="sort-lowest" >}} for descending order,
or {{< icon name="sort-highest" >}} for ascending order.
### By environment or deployment date
To filter merge requests by deployment data, such as the environment or a date,
you can type (or select from the dropdown list) the following:
- Environment
- Deployed before
- Deployed after
{{< alert type="note" >}}
Projects using a [fast-forward merge method](methods/_index.md#fast-forward-merge)
do not return results, as this method does not create a merge commit.
{{< /alert >}}
When filtering by an environment, a dropdown list presents all environments that
you can choose from.
When filtering by `Deployed before` or `Deployed after`:
- The date refers to when the deployment to an environment (triggered by the
merge commit) completed successfully.
- You must enter the deploy date manually.
- Deploy dates use the format `YYYY-MM-DD`. Wrap them in double quotes (`"`)
if you want to specify both a date and time (`"YYYY-MM-DD HH:MM"`).
## Add changes to a merge request
If you have permission to add changes to a merge request, you can add your changes
to an existing merge request in several ways. These ways depend on the complexity of your
change, and whether you need access to a development environment:
- [Edit changes in the Web IDE](../web_ide/_index.md) in your browser with the
<kbd>.</kbd> [keyboard shortcut](../../shortcuts.md). Use this
browser-based method to edit multiple files, or if you are not comfortable with Git commands.
You cannot run tests from the Web IDE.
- [Edit changes in Gitpod](../../../integration/gitpod.md#launch-gitpod-in-gitlab), if you
need a fully-featured environment to both edit files, and run tests afterward. Gitpod
supports running the [GitLab Development Kit (GDK)](https://gitlab.com/gitlab-org/gitlab-development-kit).
To use Gitpod, you must [enable Gitpod in your user account](../../../integration/gitpod.md#enable-gitpod-in-your-user-preferences).
- [Push changes from the command line](../../../topics/git/commands.md), if you are
familiar with Git and the command line.
## Assign a user to a merge request
To assign the merge request to a user, use the `/assign @user`
[quick action](../quick_actions.md#issues-merge-requests-and-epics) in a text area in
a merge request, or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. On the right sidebar, expand the right sidebar and locate the **Assignees** section.
1. Select **Edit**.
1. Search for the user you want to assign, and select the user. GitLab Free allows one
assignee per merge request, but GitLab Premium and GitLab Ultimate allow multiple assignees:

GitLab adds the merge request to the user's **Assigned merge requests** page.
## Merge a merge request
During the [merge request review process](reviews/_index.md), reviewers provide
feedback on your changes. When a reviewer is satisfied with the changes,
they can enable [auto-merge](auto_merge.md), even if some merge checks are failing.
After all merge checks pass, the merge request is automatically merged, without further action from you.
Default merge permissions:
- The default branch, typically `main`, is protected.
- Only Maintainers and higher roles can merge into the default branch.
- Developers can merge any merge requests targeting non-protected branches.
To determine if you have permission to merge a specific merge request, GitLab checks:
- Your [role in the project](../../permissions.md#roles). For example, Developer, Maintainer, or Owner.
- The [branch protections](../repository/branches/protected.md) of the target branch.
## Close a merge request
If you decide to permanently stop work on a merge request, close it rather than
[deleting it](manage.md#delete-a-merge-request).
Prerequisites:
- You must be the author or assignees of the merge request, or
- You must have the Developer, Maintainer, or Owner [roles](../../permissions.md) in a project.
To close merge requests in the project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Scroll to the comment box at the bottom of the page.
1. Following the comment box, select **Close merge request**.
GitLab closes the merge request, but preserves records of the merge request,
its comments, and any associated pipelines.
### Delete the source branch on merge
You can delete the source branch for a merge request:
- When you create a merge request, by selecting **Delete source branch when merge request accepted**.
- When you merge a merge request, if you have the Maintainer role, by selecting **Delete source branch**.
An administrator can make this option the default in the project's settings.
The delete-branch action is performed by the user who sets auto-merge, or merges the merge request.
If the user lacks the correct role, such as in a forked project, the source branch deletion fails.
### Update merge requests when target branch merges
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Merge requests are often chained together, with one merge request depending on
the code added or changed in another merge request. To support keeping individual
merge requests small, GitLab can update up to four open merge requests when their
target branch merges into `main`. For example:
- Merge request 1: merge `feature-alpha` into `main`.
- Merge request 2: merge `feature-beta` into `feature-alpha`.
If these merge requests are open at the same time, and merge request 1 (`feature-alpha`)
merges into `main`, GitLab updates the destination of merge request 2 from `feature-alpha`
to `main`.
Merge requests with interconnected content updates are usually handled in one of these ways:
- Merge request 1 merges into `main` first. Merge request 2 is then
retargeted to `main`.
- Merge request 2 merges into `feature-alpha`. The updated merge request 1, which
now contains the contents of `feature-alpha` and `feature-beta`, merges into `main`.
This feature works only when a merge request is merged. Selecting **Remove source branch**
after merging does not retarget open merge requests. This improvement is
[proposed as a follow-up](https://gitlab.com/gitlab-org/gitlab/-/issues/321559).
## Merge request workflows
For a software developer working in a team:
1. You check out a new branch, and submit your changes through a merge request.
1. You gather feedback from your team.
1. You work on the implementation optimizing code with [Code Quality reports](../../../ci/testing/code_quality.md).
1. You verify your changes with [Unit test reports](../../../ci/testing/unit_test_reports.md) in GitLab CI/CD.
1. You avoid using dependencies whose license is not compatible with your project with [License approval policies](../../compliance/license_approval_policies.md).
1. You request the [approval](approvals/_index.md) from your manager.
1. Your manager:
1. Pushes a commit with their final review.
1. [Approves the merge request](approvals/_index.md).
1. Sets it to [auto-merge](auto_merge.md) (formerly **Merge when pipeline succeeds**).
1. Your changes get deployed to production with [manual jobs](../../../ci/jobs/job_control.md#create-a-job-that-must-be-run-manually) for GitLab CI/CD.
1. Your implementations were successfully shipped to your customer.
For a web developer writing a webpage for your company's website:
1. You check out a new branch and submit a new page through a merge request.
1. You gather feedback from your reviewers.
1. You preview your changes with [review apps](../../../ci/review_apps/_index.md).
1. You request your web designers for their implementation.
1. You request the [approval](approvals/_index.md) from your manager.
1. After approval, GitLab:
- [Squashes](squash_and_merge.md) the commits.
- Merges the commit.
- [Deployed the changes to staging with GitLab Pages](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/).
1. Your production team [cherry-picks](cherry_pick_changes.md) the merge commit into production.
## Filter activity in a merge request
{{< history >}}
- Feature flag `mr_activity_filters` [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/387070) in GitLab 16.0.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126998) in GitLab 16.3 by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132355) in GitLab 16.5. Feature flag `mr_activity_filters` removed.
- Filtering bot comments [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128473) in GitLab 16.9.
{{< /history >}}
To understand the history of a merge request, filter its activity feed to show you
only the items that are relevant to you.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select a merge request.
1. Scroll to **Activity**.
1. On the right side of the page, select **Activity filter** to show the filter options.
If you've already selected filter options, this field shows a summary of your
choices, like **Activity + 5 more**.
1. Select the types of activity you want to see. Options include:
- Assignees & Reviewers
- Approvals
- Comments (from bots)
- Comments (from users)
- Commits & branches
- Edits
- Labels
- Lock status
- Mentions
- Merge request status
- Tracking
1. Optional. Select **Sort** ({{< icon name="sort-lowest" >}}) to reverse the sort order.
Your selection persists across all merge requests. You can also change the
sort order by clicking the sort button on the right.
## Resolve a thread
When you want to finish a conversation in a merge request,
[resolve a thread](../../discussions/_index.md#resolve-a-thread).
GitLab shows the number of open threads in the top right corner of a
merge request, like this: `7 open threads`.
### Move all open threads in a merge request to an issue
If you have multiple open threads in a merge request, you can
create an issue to resolve them separately:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In the merge request, in the top right, find the **Open threads**
dropdown list, and select **Thread options** ({{< icon name="ellipsis_v" >}}).
1. Select **Resolve all with new issue**.
1. Fill out the fields in the new issue, and select **Create issue**.
GitLab marks all threads as resolved, and adds a link from the merge request to
the newly created issue.
### Move one open thread in a merge request to an issue
If you have one specific open thread in a merge request, you can
create an issue to resolve it separately:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In the merge request, find the thread you want to move.
1. Below the last reply to the thread, next to **Resolve thread**, select
**Create issue to resolve thread** ({{< icon name="issue-new" >}}).
1. Fill out the fields in the new issue, and select **Create issue**.
GitLab marks the thread as resolved, and adds a link from the merge request to
the newly created issue.
### Prevent merge unless all threads are resolved
You can prevent merge requests from merging while threads remain open.
When you enable this setting, the **Open threads** counter in a merge request
is shown in orange while at least one thread remains open.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge checks** section, select the **All threads must be resolved** checkbox.
1. Select **Save changes**.
### Automatically resolve threads in a merge request when they become outdated
You can set merge requests to automatically resolve threads when a new push
changes the lines they describe.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge options** section, select
**Automatically resolve merge request diff threads when they become outdated**.
1. Select **Save changes**.
Threads are now resolved if a push makes a diff section outdated.
Threads on lines that don't change and top-level resolvable threads are not resolved.
## Move notifications and to-dos
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132678) in GitLab 16.5 [with a flag](../../../administration/feature_flags/_index.md) named `notifications_todos_buttons`. Disabled by default.
- [Issues, incidents](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133474), and [epics](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133881) also updated.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../../administration/feature_flags/_index.md) named `notifications_todos_buttons`.
On GitLab.com and GitLab Dedicated, this feature is not available.
{{< /alert >}}
Enabling this feature flag moves the notifications and to-do item buttons to the upper right corner of the page.
- On merge requests, these buttons are shown to the far right of the tabs.
- On issues, incidents, and epics, these buttons are shown at the top of the right sidebar.
## Related topics
- [Create a merge request](creating_merge_requests.md)
- [Review a merge request](reviews/_index.md)
- [Authorization for merge requests](authorization_for_merge_requests.md)
- [Testing and reports](../../../ci/testing/_index.md)
- [GitLab keyboard shortcuts](../../shortcuts.md)
- [Comments and threads](../../discussions/_index.md)
- [Suggest code changes](reviews/suggestions.md)
- [CI/CD pipelines](../../../ci/_index.md)
- [Push options](../../../topics/git/commit.md) for merge requests
|
https://docs.gitlab.com/user/project/squash_and_merge
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/squash_and_merge.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
squash_and_merge.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Squash and merge
|
Understand and configure the commit squashing options available in GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Squash and merge combines multiple small commits into a single meaningful commit.
This strategy keeps your repository history clean and makes it easier to track or revert changes.
When you work on multiple features at once, squashing separates each feature's changes into distinct, logical units.
- Small commits are joined together, making it simpler to [revert all parts of a change](revert_changes.md).
- When the single commit merges into the target branch, it retains the full commit history.
- Your base branch remains clean, and contains meaningful commit messages.
## Squash and merge workflow
Each time a branch merges into your base branch, up to two commits are added:
- The single commit created by squashing the commits from the branch.
- A merge commit, unless you have enabled [fast-forward merges](methods/_index.md#fast-forward-merge)
in your project. Fast-forward merges disable merge commits.
By default, squashed commits contain the following metadata:
- Message: Description of the squash commit, or a customized message
- Author: User that created the merge request
- Committer: User who initiated the squash
Project owners can [create new default messages](commit_templates.md) for all
squash commits and merge commits.
## Set default squash options for a merge request
Users with permission to create or edit a merge request can set the default squash options
for a merge request.
Prerequisites:
- Your project must be [configured](#configure-squash-options-for-a-project) to allow or
encourage squashing.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select **Edit**.
1. Select or clear the **Squash commits when merge request is accepted** checkbox.
1. Select **Save changes**.
## Squash commits in a merge request
If your project allows you to select squashing options for merge requests, to
squash the commits as part of the merge process:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In the merge request widget, ensure the **Squash commits** checkbox is selected. This checkbox doesn't display
if the project's squashing option is set to either **Do not allow** or **Require**.
1. Optional. To modify either the squash commit message or the merge commit message
(depending on your project configuration), select **Modify commit messages**.
1. When the merge request is ready to merge, select **Merge**.
## Configure squash options for a project
Prerequisites:
- You must have at least the Maintainer role for this project.
To configure the default squashing behavior for all merge requests in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Squash commits when merging** section, select your desired behavior:
- **Do not allow**: Squashing is never performed, and the option is not displayed.
- **Allow**: Squashing is allowed, but cleared by default.
- **Encourage**: Squashing is allowed and selected by default, but can be disabled.
- **Require**: Squashing is always performed. While merge requests display the option
to squash, users cannot change it.
1. Select **Save changes**.
## Related topics
- [Commit message templates](commit_templates.md)
- [Merge methods](methods/_index.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Understand and configure the commit squashing options available in GitLab.
title: Squash and merge
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Squash and merge combines multiple small commits into a single meaningful commit.
This strategy keeps your repository history clean and makes it easier to track or revert changes.
When you work on multiple features at once, squashing separates each feature's changes into distinct, logical units.
- Small commits are joined together, making it simpler to [revert all parts of a change](revert_changes.md).
- When the single commit merges into the target branch, it retains the full commit history.
- Your base branch remains clean, and contains meaningful commit messages.
## Squash and merge workflow
Each time a branch merges into your base branch, up to two commits are added:
- The single commit created by squashing the commits from the branch.
- A merge commit, unless you have enabled [fast-forward merges](methods/_index.md#fast-forward-merge)
in your project. Fast-forward merges disable merge commits.
By default, squashed commits contain the following metadata:
- Message: Description of the squash commit, or a customized message
- Author: User that created the merge request
- Committer: User who initiated the squash
Project owners can [create new default messages](commit_templates.md) for all
squash commits and merge commits.
## Set default squash options for a merge request
Users with permission to create or edit a merge request can set the default squash options
for a merge request.
Prerequisites:
- Your project must be [configured](#configure-squash-options-for-a-project) to allow or
encourage squashing.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select **Edit**.
1. Select or clear the **Squash commits when merge request is accepted** checkbox.
1. Select **Save changes**.
## Squash commits in a merge request
If your project allows you to select squashing options for merge requests, to
squash the commits as part of the merge process:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In the merge request widget, ensure the **Squash commits** checkbox is selected. This checkbox doesn't display
if the project's squashing option is set to either **Do not allow** or **Require**.
1. Optional. To modify either the squash commit message or the merge commit message
(depending on your project configuration), select **Modify commit messages**.
1. When the merge request is ready to merge, select **Merge**.
## Configure squash options for a project
Prerequisites:
- You must have at least the Maintainer role for this project.
To configure the default squashing behavior for all merge requests in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Squash commits when merging** section, select your desired behavior:
- **Do not allow**: Squashing is never performed, and the option is not displayed.
- **Allow**: Squashing is allowed, but cleared by default.
- **Encourage**: Squashing is allowed and selected by default, but can be disabled.
- **Require**: Squashing is always performed. While merge requests display the option
to squash, users cannot change it.
1. Select **Save changes**.
## Related topics
- [Commit message templates](commit_templates.md)
- [Merge methods](methods/_index.md)
|
https://docs.gitlab.com/user/project/confidential
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/confidential.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
confidential.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge requests for confidential issues
|
How to create a merge request for a confidential issue without leaking information publicly.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Merge requests in a public repository are also public, even when you create a
merge request for a [confidential issue](../issues/confidential_issues.md).
To avoid leaking confidential information when working on a confidential issue,
create your merge request from a private fork in the same namespace.
Roles are inherited from parent groups. If you create your private fork in the
same namespace (same group or subgroup) as the original (public) repository,
developers receive the same permissions in your fork. This inheritance ensures:
- Developer users have the needed permissions to view confidential issues and resolve them.
- You do not need grant individual users access to your fork.
To learn more, see [Patch release runbook for GitLab engineers: Preparing security fixes for a patch release](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/engineer.md).
## Create a confidential merge request
Branches are public by default. To protect the confidentiality of your work, you
must create your branches and merge requests in the same namespace, but downstream
in a private fork. If you create your private fork in the same namespace as the
public repository, your fork inherits the permissions of the upstream public repository.
Users with the Developer role for the upstream public repository inherit those upstream
permissions in your downstream private fork without action by you. These users can
immediately push code to branches in your private fork to help fix the confidential issue.
{{< alert type="warning" >}}
Your private fork might expose confidential information if you create it in a different
namespace than the upstream repository. The two namespaces might not contain the same users.
{{< /alert >}}
Prerequisites:
- You have the Owner or Maintainer role for the public repository, as you need one
of these roles to [create a subgroup](../../group/subgroups/_index.md).
- You have [forked](../repository/forking_workflow.md) the public repository.
- Your fork has a **Visibility level** of **Private**.
To create a confidential merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues** and find the issue you want to create a merge request for.
1. Scroll below the issue description, and select **Create confidential merge request**.
1. Select the item that meets your needs:
- To create both a branch and a merge request, select
**Create confidential merge request and branch**. Your merge request will
target the default branch of your fork, not the default branch of the
public upstream project.
- To create only a branch, select **Create branch**.
1. Select a **Project** to use. These projects have merge requests enabled, and
you have the Developer role (or greater) in them.
1. Provide a **Branch name**, and select a **Source (branch or tag)**. GitLab
checks whether these branches are available in your private fork, because both
branches must be available in your selected fork.
1. Select **Create**.
This merge request targets your private fork, not the public upstream project.
Your branch, merge requests, and commits remain in your private fork. This prevents
prematurely revealing confidential information.
Open a merge request
[from your fork to the upstream repository](../repository/forking_workflow.md#merge-changes-back-upstream) when:
- You believe the problem is resolved in your private fork.
- You are ready to make the confidential commits public.
## Related topics
- [Confidential issues](../issues/confidential_issues.md)
- [Make an epic confidential](../../group/epics/manage_epics.md#make-an-epic-confidential)
- [Add an internal note](../../discussions/_index.md#add-an-internal-note)
- [Security practices for confidential merge requests](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/engineer.md#security-releases-critical-non-critical-as-a-developer) at GitLab
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: How to create a merge request for a confidential issue without leaking
information publicly.
title: Merge requests for confidential issues
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Merge requests in a public repository are also public, even when you create a
merge request for a [confidential issue](../issues/confidential_issues.md).
To avoid leaking confidential information when working on a confidential issue,
create your merge request from a private fork in the same namespace.
Roles are inherited from parent groups. If you create your private fork in the
same namespace (same group or subgroup) as the original (public) repository,
developers receive the same permissions in your fork. This inheritance ensures:
- Developer users have the needed permissions to view confidential issues and resolve them.
- You do not need grant individual users access to your fork.
To learn more, see [Patch release runbook for GitLab engineers: Preparing security fixes for a patch release](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/engineer.md).
## Create a confidential merge request
Branches are public by default. To protect the confidentiality of your work, you
must create your branches and merge requests in the same namespace, but downstream
in a private fork. If you create your private fork in the same namespace as the
public repository, your fork inherits the permissions of the upstream public repository.
Users with the Developer role for the upstream public repository inherit those upstream
permissions in your downstream private fork without action by you. These users can
immediately push code to branches in your private fork to help fix the confidential issue.
{{< alert type="warning" >}}
Your private fork might expose confidential information if you create it in a different
namespace than the upstream repository. The two namespaces might not contain the same users.
{{< /alert >}}
Prerequisites:
- You have the Owner or Maintainer role for the public repository, as you need one
of these roles to [create a subgroup](../../group/subgroups/_index.md).
- You have [forked](../repository/forking_workflow.md) the public repository.
- Your fork has a **Visibility level** of **Private**.
To create a confidential merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues** and find the issue you want to create a merge request for.
1. Scroll below the issue description, and select **Create confidential merge request**.
1. Select the item that meets your needs:
- To create both a branch and a merge request, select
**Create confidential merge request and branch**. Your merge request will
target the default branch of your fork, not the default branch of the
public upstream project.
- To create only a branch, select **Create branch**.
1. Select a **Project** to use. These projects have merge requests enabled, and
you have the Developer role (or greater) in them.
1. Provide a **Branch name**, and select a **Source (branch or tag)**. GitLab
checks whether these branches are available in your private fork, because both
branches must be available in your selected fork.
1. Select **Create**.
This merge request targets your private fork, not the public upstream project.
Your branch, merge requests, and commits remain in your private fork. This prevents
prematurely revealing confidential information.
Open a merge request
[from your fork to the upstream repository](../repository/forking_workflow.md#merge-changes-back-upstream) when:
- You believe the problem is resolved in your private fork.
- You are ready to make the confidential commits public.
## Related topics
- [Confidential issues](../issues/confidential_issues.md)
- [Make an epic confidential](../../group/epics/manage_epics.md#make-an-epic-confidential)
- [Add an internal note](../../discussions/_index.md#add-an-internal-note)
- [Security practices for confidential merge requests](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/engineer.md#security-releases-critical-non-critical-as-a-developer) at GitLab
|
https://docs.gitlab.com/user/project/commit_templates
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/commit_templates.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
commit_templates.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Commit message templates
|
Use commit message templates to ensure commits to your GitLab project contain all necessary information and are formatted correctly.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab uses commit templates to create default messages for specific types of
commits. These templates encourage commit messages to follow a particular format,
or contain specific information. Users can override these templates when merging
a merge request.
The commit template syntax is like the syntax for
[review suggestions](reviews/suggestions.md#configure-the-commit-message-for-applied-suggestions).
GitLab Duo can also help you generate [merge commit messages](duo_in_merge_requests.md#generate-a-merge-commit-message)
even if you don't configure templates.
## Configure commit templates
Change the commit templates for your project if the default templates don't
contain the information you need.
Prerequisites:
- You must have at least the Maintainer role for a project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Depending on the template type you want to create, scroll to either
[**Merge commit message template**](#default-template-for-merge-commits) or
[**Squash commit message template**](#default-template-for-squash-commits).
1. For your desired commit type, enter your default message. You can use both static
text and [variables](#supported-variables-in-commit-templates). Each template
is limited to 500 characters, though after replacing the templates
with data, the final message might be longer.
1. Select **Save changes**.
## Default template for merge commits
The default template for merge commit messages is:
```plaintext
Merge branch '%{source_branch}' into '%{target_branch}'
%{title}
%{issues}
See merge request %{reference}
```
## Default template for squash commits
If you have configured your project to [squash commits on merge](squash_and_merge.md),
GitLab creates a squash commit message with this template:
```plaintext
%{title}
```
## Supported variables in commit templates
{{< history >}}
- `local_reference` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/199823) in GitLab 16.1.
- `source_project_id` variables [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128553) in GitLab 16.3.
- `merge_request_author` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152510) in GitLab 17.1.
{{< /history >}}
Commit message templates support these variables:
| Variable | Description | Output example |
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `%{source_branch}` | The name of the branch to merge. | `my-feature-branch` |
| `%{target_branch}` | The name of the branch to apply the changes to. | `main` |
| `%{title}` | Title of the merge request. | `Fix tests and translations` |
| `%{issues}` | String with phrase `Closes <issue numbers>`. Contains all issues mentioned in the merge request description that match [issue closing patterns](../issues/managing_issues.md#closing-issues-automatically). Empty if no issues are mentioned. | `Closes #465, #190 and #400` |
| `%{description}` | Description of the merge request. | `Merge request description.`<br>`Can be multiline.` |
| `%{reference}` | Reference to the merge request. | `group-name/project-name!72359` |
| `%{local_reference}` | Local reference to the merge request. | `!72359` |
| `%{source_project_id}` | ID of the merge request's source project. | `123` |
| `%{first_commit}` | Full message of the first commit in merge request diff. | `Update README.md` |
| `%{first_multiline_commit}` | Full message of the first commit that's not a merge commit and has more than one line in message body. Merge request title if all commits aren't multiline. | `Update README.md`<br><br>`Improved project description in readme file.` |
| `%{first_multiline_commit_description}` | Description (without the first line/title) of the first commit that's not a merge commit and has more than one line in message body. | `Improved project description in readme file.` |
| `%{url}` | Full URL to the merge request. | `https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1` |
| `%{reviewed_by}` | Line-separated list of the merge request reviewers, based on users who submit a review by using batch comments, in a `Reviewed-by` Git commit trailer format. | `Reviewed-by: Sidney Jones <sjones@example.com>` <br> `Reviewed-by: Zhang Wei <zwei@example.com>` |
| `%{approved_by}` | Line-separated list of the merge request approvers in a `Approved-by` Git commit trailer format. | `Approved-by: Sidney Jones <sjones@example.com>` <br> `Approved-by: Zhang Wei <zwei@example.com>` |
| `%{merged_by}` | User who merged the merge request. | `Alex Garcia <agarcia@example.com>` |
| `%{merge_request_author}` | Name and email of the merge request author. | `Zane Doe <zdoe@example.com>` |
| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
| `%{all_commits}` | Messages from all commits in the merge request. Limited to 100 most recent commits. Skips commit bodies exceeding 100 KiB and merge commit messages. | `* Feature introduced` <br><br> `This commit implements feature` <br> `Changelog:added` <br><br> `* Bug fixed` <br><br> `* Documentation improved` <br><br>`This commit introduced better docs.` |
Any line containing only an empty variable is removed. If the removed line is both
preceded and followed by an empty line, the preceding empty line is also removed.
After you edit a commit message on an open merge request, GitLab
automatically updates the commit message again.
To restore the commit message to the project template, reload the page.
## Related topics
- [Squash and merge](squash_and_merge.md).
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use commit message templates to ensure commits to your GitLab project
contain all necessary information and are formatted correctly.
title: Commit message templates
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab uses commit templates to create default messages for specific types of
commits. These templates encourage commit messages to follow a particular format,
or contain specific information. Users can override these templates when merging
a merge request.
The commit template syntax is like the syntax for
[review suggestions](reviews/suggestions.md#configure-the-commit-message-for-applied-suggestions).
GitLab Duo can also help you generate [merge commit messages](duo_in_merge_requests.md#generate-a-merge-commit-message)
even if you don't configure templates.
## Configure commit templates
Change the commit templates for your project if the default templates don't
contain the information you need.
Prerequisites:
- You must have at least the Maintainer role for a project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Depending on the template type you want to create, scroll to either
[**Merge commit message template**](#default-template-for-merge-commits) or
[**Squash commit message template**](#default-template-for-squash-commits).
1. For your desired commit type, enter your default message. You can use both static
text and [variables](#supported-variables-in-commit-templates). Each template
is limited to 500 characters, though after replacing the templates
with data, the final message might be longer.
1. Select **Save changes**.
## Default template for merge commits
The default template for merge commit messages is:
```plaintext
Merge branch '%{source_branch}' into '%{target_branch}'
%{title}
%{issues}
See merge request %{reference}
```
## Default template for squash commits
If you have configured your project to [squash commits on merge](squash_and_merge.md),
GitLab creates a squash commit message with this template:
```plaintext
%{title}
```
## Supported variables in commit templates
{{< history >}}
- `local_reference` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/199823) in GitLab 16.1.
- `source_project_id` variables [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128553) in GitLab 16.3.
- `merge_request_author` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152510) in GitLab 17.1.
{{< /history >}}
Commit message templates support these variables:
| Variable | Description | Output example |
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `%{source_branch}` | The name of the branch to merge. | `my-feature-branch` |
| `%{target_branch}` | The name of the branch to apply the changes to. | `main` |
| `%{title}` | Title of the merge request. | `Fix tests and translations` |
| `%{issues}` | String with phrase `Closes <issue numbers>`. Contains all issues mentioned in the merge request description that match [issue closing patterns](../issues/managing_issues.md#closing-issues-automatically). Empty if no issues are mentioned. | `Closes #465, #190 and #400` |
| `%{description}` | Description of the merge request. | `Merge request description.`<br>`Can be multiline.` |
| `%{reference}` | Reference to the merge request. | `group-name/project-name!72359` |
| `%{local_reference}` | Local reference to the merge request. | `!72359` |
| `%{source_project_id}` | ID of the merge request's source project. | `123` |
| `%{first_commit}` | Full message of the first commit in merge request diff. | `Update README.md` |
| `%{first_multiline_commit}` | Full message of the first commit that's not a merge commit and has more than one line in message body. Merge request title if all commits aren't multiline. | `Update README.md`<br><br>`Improved project description in readme file.` |
| `%{first_multiline_commit_description}` | Description (without the first line/title) of the first commit that's not a merge commit and has more than one line in message body. | `Improved project description in readme file.` |
| `%{url}` | Full URL to the merge request. | `https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1` |
| `%{reviewed_by}` | Line-separated list of the merge request reviewers, based on users who submit a review by using batch comments, in a `Reviewed-by` Git commit trailer format. | `Reviewed-by: Sidney Jones <sjones@example.com>` <br> `Reviewed-by: Zhang Wei <zwei@example.com>` |
| `%{approved_by}` | Line-separated list of the merge request approvers in a `Approved-by` Git commit trailer format. | `Approved-by: Sidney Jones <sjones@example.com>` <br> `Approved-by: Zhang Wei <zwei@example.com>` |
| `%{merged_by}` | User who merged the merge request. | `Alex Garcia <agarcia@example.com>` |
| `%{merge_request_author}` | Name and email of the merge request author. | `Zane Doe <zdoe@example.com>` |
| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
| `%{all_commits}` | Messages from all commits in the merge request. Limited to 100 most recent commits. Skips commit bodies exceeding 100 KiB and merge commit messages. | `* Feature introduced` <br><br> `This commit implements feature` <br> `Changelog:added` <br><br> `* Bug fixed` <br><br> `* Documentation improved` <br><br>`This commit introduced better docs.` |
Any line containing only an empty variable is removed. If the removed line is both
preceded and followed by an empty line, the preceding empty line is also removed.
After you edit a commit message on an open merge request, GitLab
automatically updates the commit message again.
To restore the commit message to the project template, reload the page.
## Related topics
- [Squash and merge](squash_and_merge.md).
|
https://docs.gitlab.com/user/project/cherry_pick_changes
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/cherry_pick_changes.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
cherry_pick_changes.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Cherry-pick changes
|
Cherry-pick a Git commit when you want to add a single commit from one branch to another.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In Git, *cherry-picking* is taking a single commit from one branch and adding it
as the latest commit on another branch. The rest of the commits in the source branch
are not added to the target. Cherry-pick a commit when you need the
contents in a single commit, but not the contents of the entire branch. For example,
when you:
- Backport bug fixes from the default branch to previous release branches.
- Copy changes from a fork to the upstream repository.
Use the GitLab UI to cherry-pick a single commit or the contents of an entire merge request
from a project or a project fork.
In this example, a Git repository has two branches: `develop` and `main`.
Commit `B` is cherry-picked from the `develop` branch after commit `E` in the `main` branch.
Commit `G` is added after the cherry-pick:
```mermaid
gitGraph
commit id: "A"
branch develop
commit id:"B"
checkout main
commit id:"C"
checkout develop
commit id:"D"
checkout main
commit id:"E"
cherry-pick id:"B"
commit id:"G"
checkout develop
commit id:"H"
```
## Cherry-pick all changes from a merge request
After a merge request is merged, you can cherry-pick all changes introduced
by the merge request. The merge request can be in the upstream project or in
a downstream fork.
Prerequisites:
- You must have a role for the project that allows you to edit merge requests, and add
code to the repository.
- Your project must use the [merge method](methods/_index.md#fast-forward-merge) **Merge Commit**,
which is set in the project's **Settings > Merge requests**.
[In GitLab 16.9 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/142152), fast-forwarded
commits can be cherry-picked from the GitLab UI only when they are squashed or when the
merge request contains a single commit.
You can always [cherry-pick individual commits](#cherry-pick-a-single-commit).
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, and find your merge request.
1. Scroll to the merge request reports section, and find the **Merged by** report.
1. In the upper-right corner of the report, select **Cherry-pick**:

1. On the dialog, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
## Cherry-pick a single commit
You can cherry-pick a single commit from multiple locations in your GitLab project.
### From a project's commit list
To cherry-pick a commit from the list of all commits for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Commits**.
1. Select the [title](https://git-scm.com/docs/git-commit#_discussion) of the commit you want to cherry-pick.
1. In the upper-right corner, select **Options > Cherry-pick**.
1. On the cherry-pick dialog, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
### From the file view of a repository
You can cherry-pick from the list of previous commits affecting an individual file
when you view that file in your project's Git repository:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Go to the file changed by the commit. In the last commit block, select **History**.
1. Select the [title](https://git-scm.com/docs/git-commit#_discussion)
of the commit you want to cherry-pick.
1. In the upper-right corner, select **Options > Cherry-pick**.
1. On the cherry-pick dialog, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
## View system notes for cherry-picked commits
When you cherry-pick a merge commit in the GitLab UI or API, GitLab adds a [system note](../system_notes.md)
to the related merge request thread. The format is {{< icon name="cherry-pick-commit" >}}
`[USER]` **picked the changes into the branch** `[BRANCHNAME]` with commit `[SHA]` `[DATE]`:

The system note crosslinks the new commit and the existing merge request.
Each deployment's [list of associated merge requests](../../../api/deployments.md#list-of-merge-requests-associated-with-a-deployment)
includes cherry-picked merge commits.
Commits cherry-picked outside the GitLab UI or API do not add a system note.
## Select a different parent commit
When you cherry-pick a merge commit in the GitLab UI, the mainline is always the
first parent. Use the command line to cherry-pick with a different mainline. For more information, see [Cherry-pick a merge commit with Git](../../../topics/git/cherry_pick.md#cherry-pick-a-merge-commit).
## Related topics
- [Commits API](../../../api/commits.md#cherry-pick-a-commit)
- [Cheery-pick changes with Git](../../../topics/git/cherry_pick.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Cherry-pick a Git commit when you want to add a single commit from one
branch to another.
title: Cherry-pick changes
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In Git, *cherry-picking* is taking a single commit from one branch and adding it
as the latest commit on another branch. The rest of the commits in the source branch
are not added to the target. Cherry-pick a commit when you need the
contents in a single commit, but not the contents of the entire branch. For example,
when you:
- Backport bug fixes from the default branch to previous release branches.
- Copy changes from a fork to the upstream repository.
Use the GitLab UI to cherry-pick a single commit or the contents of an entire merge request
from a project or a project fork.
In this example, a Git repository has two branches: `develop` and `main`.
Commit `B` is cherry-picked from the `develop` branch after commit `E` in the `main` branch.
Commit `G` is added after the cherry-pick:
```mermaid
gitGraph
commit id: "A"
branch develop
commit id:"B"
checkout main
commit id:"C"
checkout develop
commit id:"D"
checkout main
commit id:"E"
cherry-pick id:"B"
commit id:"G"
checkout develop
commit id:"H"
```
## Cherry-pick all changes from a merge request
After a merge request is merged, you can cherry-pick all changes introduced
by the merge request. The merge request can be in the upstream project or in
a downstream fork.
Prerequisites:
- You must have a role for the project that allows you to edit merge requests, and add
code to the repository.
- Your project must use the [merge method](methods/_index.md#fast-forward-merge) **Merge Commit**,
which is set in the project's **Settings > Merge requests**.
[In GitLab 16.9 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/142152), fast-forwarded
commits can be cherry-picked from the GitLab UI only when they are squashed or when the
merge request contains a single commit.
You can always [cherry-pick individual commits](#cherry-pick-a-single-commit).
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, and find your merge request.
1. Scroll to the merge request reports section, and find the **Merged by** report.
1. In the upper-right corner of the report, select **Cherry-pick**:

1. On the dialog, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
## Cherry-pick a single commit
You can cherry-pick a single commit from multiple locations in your GitLab project.
### From a project's commit list
To cherry-pick a commit from the list of all commits for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Commits**.
1. Select the [title](https://git-scm.com/docs/git-commit#_discussion) of the commit you want to cherry-pick.
1. In the upper-right corner, select **Options > Cherry-pick**.
1. On the cherry-pick dialog, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
### From the file view of a repository
You can cherry-pick from the list of previous commits affecting an individual file
when you view that file in your project's Git repository:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Go to the file changed by the commit. In the last commit block, select **History**.
1. Select the [title](https://git-scm.com/docs/git-commit#_discussion)
of the commit you want to cherry-pick.
1. In the upper-right corner, select **Options > Cherry-pick**.
1. On the cherry-pick dialog, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
## View system notes for cherry-picked commits
When you cherry-pick a merge commit in the GitLab UI or API, GitLab adds a [system note](../system_notes.md)
to the related merge request thread. The format is {{< icon name="cherry-pick-commit" >}}
`[USER]` **picked the changes into the branch** `[BRANCHNAME]` with commit `[SHA]` `[DATE]`:

The system note crosslinks the new commit and the existing merge request.
Each deployment's [list of associated merge requests](../../../api/deployments.md#list-of-merge-requests-associated-with-a-deployment)
includes cherry-picked merge commits.
Commits cherry-picked outside the GitLab UI or API do not add a system note.
## Select a different parent commit
When you cherry-pick a merge commit in the GitLab UI, the mainline is always the
first parent. Use the command line to cherry-pick with a different mainline. For more information, see [Cherry-pick a merge commit with Git](../../../topics/git/cherry_pick.md#cherry-pick-a-merge-commit).
## Related topics
- [Commits API](../../../api/commits.md#cherry-pick-a-commit)
- [Cheery-pick changes with Git](../../../topics/git/cherry_pick.md)
|
https://docs.gitlab.com/user/project/changes
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/changes.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
changes.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Changes in merge requests
|
Understand how to read the changes proposed in a merge request.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
A [merge request](_index.md) proposes a set of changes to files in a branch in your repository. GitLab
shows these changes as a _diff_ (difference) between the current state and the proposed
changes. By default, the diff compares your proposed changes (the source branch) with
the target branch. By default, GitLab shows only the changed portions of the files.
This example shows changes to a text file. In the default syntax highlighting theme:
- The _current_ version is shown in red, with a minus (`-`) sign before the line.
- The _proposed_ version is shown in green with a plus (`+`) sign before the line.

The header for each file in the diff contains:
- **Hide file contents** ({{< icon name="chevron-down" >}}) to hide all changes to this file.
- **Path**: The full path to this file. To copy this path, select
**Copy file path** ({{< icon name="copy-to-clipboard" >}}).
- **Lines changed**: The number of lines added and deleted in this file, in the format `+2 -2`.
- **Viewed**: Select this checkbox to [mark the file as viewed](#mark-files-as-viewed)
until it changes again.
- **Comment on this file** ({{< icon name="comment" >}}) to leave a general comment on the file, without
pinning the comment to a specific line.
- **Options**: Select ({{< icon name="ellipsis_v" >}}) to display more file viewing options.
The diff also includes navigation and comment aids to the left of the file, in the gutter:
- Show more context: Select **Previous 20 lines** ({{< icon name="expand-up" >}}) to display
the previous 20 unchanged lines, or **Next 20 lines** ({{< icon name="expand-down" >}}) to
show the next 20 unchanged lines.
- Line numbers are shown in two columns. Previous line numbers are shown on
the left, and proposed line numbers on the right. To interact with a line:
- To show [comment options](#add-a-comment-to-a-merge-request-file), hover over a line number.
- To copy a link to the line, press <kbd>Command</kbd> and select (or right-click)
a line number, then select **Copy link address**.
- To highlight a line, select the line number.
## Show a list of changed files
Use the file browser to view a list of files changed in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Select **Show file browser** ({{< icon name="file-tree" >}}) or press <kbd>F</kbd> to show
the file tree.
- For a tree view that shows nesting, select **Tree view** ({{< icon name="file-tree" >}}).
- For a file list without nesting, select **List view** ({{< icon name="list-bulleted" >}}).
## Show all changes in a merge request
To view the diff of changes included in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. If the merge request changes many files, you can jump directly to a specific file:
1. Select **Show file browser** ({{< icon name="file-tree" >}}) or press <kbd>F</kbd> to show the file tree.
1. Select the file you want to view.
1. To hide the file browser, select **Show file browser** or press <kbd>F</kbd> again.
GitLab collapses files with many changes to improve performance, and displays the message:
**Some changes are not shown**. To view the changes for that file, select **Expand file**.
### Show a linked file first
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/387246) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `pinned_file`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162503) in GitLab 17.4. Feature flag `pinned_file` removed.
{{< /history >}}
When you share a merge request link with a team member, you might want to show a specific file
first in the list of changed files. To copy a merge request link that shows your desired file first:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Find the file you want to show first. Right-click the name of the file to copy the link to it.
1. When you visit that link, your chosen file is shown at the top of the list. The file browser
shows a link icon ({{< icon name="link" >}}) next to the filename:

## Collapse generated files
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140180) in GitLab 16.8 [with a flag](../../../administration/feature_flags/_index.md) named `collapse_generated_diff_files`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145100) in GitLab 16.10.
- `generated_file` [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148478) in GitLab 16.11. Feature flag `collapse_generated_diff_files` removed.
{{< /history >}}
To help reviewers focus on the files needed to perform a code review, GitLab collapses
several common types of generated files. GitLab collapses these files by default, because
they rarely require code reviews:
1. Files with `.nib`, `.xcworkspacedata`, or `.xcurserstate` extensions.
1. Package lock files such as `package-lock.json` or `Gopkg.lock`.
1. Files in the `node_modules` folder.
1. Minified `js` or `css` files.
1. Source map reference files.
1. Generated Go files, including the generated files by protocol buffer compiler.
To mark a file or path as generated, set the `gitlab-generated` attribute for it
in your [`.gitattributes` file](../repository/files/git_attributes.md).
### View a collapsed file
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Find the file you want to view, and select **Expand file**.
### Configure collapse behavior for a file type
To change the default collapse behavior for a file type:
1. If a `.gitattributes` file does not exist in the root directory of your project,
create a blank file with this name.
1. For each file type you want to modify, add a line to the `.gitattributes` file
declaring the file extension and your desired behavior:
```conf
# Collapse all files with a .txt extension
*.txt gitlab-generated
# Collapse all files within the docs directory
docs/** gitlab-generated
# Do not collapse package-lock.json
package-lock.json -gitlab-generated
```
1. Commit, push, and merge your changes into your default branch.
After the changes merge into your [default branch](../repository/branches/default.md),
all files of this type in your project use this behavior in merge requests.
For technical details about how GitLab detects generated files, see the
[`go-enry`](https://github.com/go-enry/go-enry/blob/master/data/generated.go) repository.
## Show one file at a time
For larger merge requests, you can review one file at a time. You can change this
setting in your user preferences, or when you review a merge request. If you change this
setting in a merge request, it updates your user settings as well.
{{< tabs >}}
{{< tab title="In a merge request" >}}
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Select **Preferences** ({{< icon name="preferences" >}}).
1. Select or clear **Show one file at a time**.
{{< /tab >}}
{{< tab title="In your user preferences" >}}
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. Scroll to the **Behavior** section and select the **Show one file at a time on merge request's Changes tab** checkbox.
1. Select **Save changes**.
{{< /tab >}}
{{< /tabs >}}
To select another file to view when this setting is enabled, either:
- Scroll to the end of the file and select either **Prev** or **Next**.
- If [keyboard shortcuts are enabled](../../shortcuts.md#enable-keyboard-shortcuts),
press <kbd>\[</kbd>, <kbd>]</kbd>, <kbd>k</kbd>, or <kbd>j</kbd>.
- Select **Show file browser** ({{< icon name="file-tree" >}}) and select another file to view.
## Compare changes
You can view the changes in a merge request either:
- Inline, which shows the changes vertically. The old version of a line is shown
first, with the new version shown directly below it.
Inline mode is often better for changes to single lines.
- Side-by-side, which shows the old and new versions of lines in separate columns.
Side-by-side mode is often better for changes affecting large numbers of sequential lines.
To change how a merge request shows changed lines:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Select **Preferences** ({{< icon name="preferences" >}}). Select either **Side-by-side** or **Inline**.
This example shows how GitLab renders the same change in both inline and side-by-side mode:
{{< tabs >}}
{{< tab title="Inline changes" >}}

{{< /tab >}}
{{< tab title="Side-by-side changes" >}}

{{< /tab >}}
{{< /tabs >}}
## Explain code in a merge request
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Pro or Enterprise, GitLab Duo with Amazon Q
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM for GitLab Self-Managed, GitLab Dedicated: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM for GitLab.com: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
- LLM for Amazon Q: Amazon Q Developer
{{< /details >}}
{{< history >}}
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) in GitLab 16.8.
- Changed to require GitLab Duo add-on in GitLab 17.6 and later.
{{< /history >}}
If you spend a lot of time trying to understand code that others have created, or
you struggle to understand code written in a language you are not familiar with,
you can ask GitLab Duo to explain the code to you.
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://youtu.be/1izKaLmmaCA?si=O2HDokLLujRro_3O)
<!-- Video published on 2023-11-18 -->
Prerequisites:
- You must belong to at least one group with the
[experiment and beta features setting](../../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
- You must have access to view the project.
To explain the code in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Changes**.
1. On the file you would like explained, select the three dots ({{< icon name="ellipsis_v" >}}) and select **View File @ $SHA**.
A separate browser tab opens and shows the full file with the latest changes.
1. On the new tab, select the lines you want to have explained.
1. On the left side, select the question mark ({{< icon name="question" >}}). You might have to scroll to the first line of your selection to view it.

Duo Chat explains the code. It might take a moment for the explanation to be generated.
If you'd like, you can provide feedback about the quality of the explanation.
We cannot guarantee that the large language model produces results that are correct. Use the explanation with caution.
You can also explain code in:
- A [file](../repository/code_explain.md).
- The [IDE](../../gitlab_duo_chat/examples.md#explain-selected-code).
## Expand or collapse comments
When reviewing code changes, you can hide inline comments:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Scroll to the file that contains the comments you want to hide.
1. Scroll to the line the comment is attached to. In the gutter margin, select **Collapse** ({{< icon name="collapse" >}}):

To expand inline comments and show them again:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Scroll to the file that contains the collapsed comments you want to show.
1. Scroll to the line the comment is attached to. In the gutter margin, select the user avatar:

## Ignore whitespace changes
Whitespace changes can make it more difficult to see the substantive changes in
a merge request. You can choose to hide or show whitespace changes:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Before the list of changed files, select **Preferences** ({{< icon name="preferences" >}}).
1. Select or clear **Show whitespace changes**:

## Mark files as viewed
When reviewing a merge request with many files multiple times, you can ignore files
you've already reviewed. To hide files that haven't changed after your last review:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. In the file's header, select the **Viewed** checkbox.
Files marked as viewed are not shown to you again unless either:
- The contents of the file change.
- You clear the **Viewed** checkbox.
## Show merge request conflicts in diff
To avoid displaying changes already on target branch, we compare the merge request's
source branch with the `HEAD` of the target branch.
When the source and target branch conflict, we show an alert
per conflicted file on the merge request diff:

## Show scanner findings in diff
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can show scanner findings in the diff. For details, see:
- [Code Quality findings](../../../ci/testing/code_quality.md#merge-request-changes-view)
- [Static Analysis findings](../../application_security/sast/_index.md#merge-request-changes-view)
## Download merge request changes
You can download the changes included in a merge request for use outside of GitLab.
### As a diff
To download the changes as a diff:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the merge request.
1. In the upper-right corner, select **Code > Plain diff**.
If you know the URL of the merge request, you can also download the diff from
the command line by appending `.diff` to the URL. This example downloads the diff
for merge request `000000`:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.diff
```
To download and apply the diff in a one-line CLI command:
```shell
curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.diff" | git apply
```
### As a patch file
To download the changes as a patch file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the merge request.
1. In the upper-right corner, select **Code > Patches**.
If you know the URL of the merge request, you can also download the patch from
the command line by appending `.patch` to the URL. This example downloads the patch
file for merge request `000000`:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch
```
To download and apply the patch using [`git am`](https://git-scm.com/docs/git-am):
```shell
# Download and preview the patch
curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch" > changes.patch
git apply --check changes.patch
# Apply the patch
git am changes.patch
```
You can also download and apply the patch in a single command:
```shell
curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch" | git am
```
The `git am` uses the `-p1` option by default. For more information, see [`git-apply`](https://git-scm.com/docs/git-apply).
## Add a comment to a merge request file
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123515) in GitLab 16.1 [with a flag](../../../administration/feature_flags/_index.md) named `comment_on_files`. Enabled by default.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125130) in GitLab 16.2.
{{< /history >}}
You can add comments to a merge request diff file. These comments persist across
rebases and file changes.
To add a comment to a merge request file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select **Changes**.
1. In the header for the file you want to comment on, select **Comment** ({{< icon name="comment" >}}).
## Add a comment to an image
In merge requests and commit detail views, you can add a comment to an image.
This comment can also be a thread.
1. Hover your mouse over the image.
1. Select the location where you want to comment.
GitLab shows an icon and a comment field on the image.
## Related topics
- [Compare branches](../repository/branches/_index.md#compare-branches)
- [Download branch comparisons](../repository/branches/_index.md#download-branch-comparisons)
- [Merge request reviews](reviews/_index.md)
- [Merge request versions](versions.md)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Understand how to read the changes proposed in a merge request.
title: Changes in merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
A [merge request](_index.md) proposes a set of changes to files in a branch in your repository. GitLab
shows these changes as a _diff_ (difference) between the current state and the proposed
changes. By default, the diff compares your proposed changes (the source branch) with
the target branch. By default, GitLab shows only the changed portions of the files.
This example shows changes to a text file. In the default syntax highlighting theme:
- The _current_ version is shown in red, with a minus (`-`) sign before the line.
- The _proposed_ version is shown in green with a plus (`+`) sign before the line.

The header for each file in the diff contains:
- **Hide file contents** ({{< icon name="chevron-down" >}}) to hide all changes to this file.
- **Path**: The full path to this file. To copy this path, select
**Copy file path** ({{< icon name="copy-to-clipboard" >}}).
- **Lines changed**: The number of lines added and deleted in this file, in the format `+2 -2`.
- **Viewed**: Select this checkbox to [mark the file as viewed](#mark-files-as-viewed)
until it changes again.
- **Comment on this file** ({{< icon name="comment" >}}) to leave a general comment on the file, without
pinning the comment to a specific line.
- **Options**: Select ({{< icon name="ellipsis_v" >}}) to display more file viewing options.
The diff also includes navigation and comment aids to the left of the file, in the gutter:
- Show more context: Select **Previous 20 lines** ({{< icon name="expand-up" >}}) to display
the previous 20 unchanged lines, or **Next 20 lines** ({{< icon name="expand-down" >}}) to
show the next 20 unchanged lines.
- Line numbers are shown in two columns. Previous line numbers are shown on
the left, and proposed line numbers on the right. To interact with a line:
- To show [comment options](#add-a-comment-to-a-merge-request-file), hover over a line number.
- To copy a link to the line, press <kbd>Command</kbd> and select (or right-click)
a line number, then select **Copy link address**.
- To highlight a line, select the line number.
## Show a list of changed files
Use the file browser to view a list of files changed in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Select **Show file browser** ({{< icon name="file-tree" >}}) or press <kbd>F</kbd> to show
the file tree.
- For a tree view that shows nesting, select **Tree view** ({{< icon name="file-tree" >}}).
- For a file list without nesting, select **List view** ({{< icon name="list-bulleted" >}}).
## Show all changes in a merge request
To view the diff of changes included in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. If the merge request changes many files, you can jump directly to a specific file:
1. Select **Show file browser** ({{< icon name="file-tree" >}}) or press <kbd>F</kbd> to show the file tree.
1. Select the file you want to view.
1. To hide the file browser, select **Show file browser** or press <kbd>F</kbd> again.
GitLab collapses files with many changes to improve performance, and displays the message:
**Some changes are not shown**. To view the changes for that file, select **Expand file**.
### Show a linked file first
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/387246) in GitLab 16.9 [with a flag](../../../administration/feature_flags/_index.md) named `pinned_file`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162503) in GitLab 17.4. Feature flag `pinned_file` removed.
{{< /history >}}
When you share a merge request link with a team member, you might want to show a specific file
first in the list of changed files. To copy a merge request link that shows your desired file first:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Find the file you want to show first. Right-click the name of the file to copy the link to it.
1. When you visit that link, your chosen file is shown at the top of the list. The file browser
shows a link icon ({{< icon name="link" >}}) next to the filename:

## Collapse generated files
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140180) in GitLab 16.8 [with a flag](../../../administration/feature_flags/_index.md) named `collapse_generated_diff_files`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145100) in GitLab 16.10.
- `generated_file` [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148478) in GitLab 16.11. Feature flag `collapse_generated_diff_files` removed.
{{< /history >}}
To help reviewers focus on the files needed to perform a code review, GitLab collapses
several common types of generated files. GitLab collapses these files by default, because
they rarely require code reviews:
1. Files with `.nib`, `.xcworkspacedata`, or `.xcurserstate` extensions.
1. Package lock files such as `package-lock.json` or `Gopkg.lock`.
1. Files in the `node_modules` folder.
1. Minified `js` or `css` files.
1. Source map reference files.
1. Generated Go files, including the generated files by protocol buffer compiler.
To mark a file or path as generated, set the `gitlab-generated` attribute for it
in your [`.gitattributes` file](../repository/files/git_attributes.md).
### View a collapsed file
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Find the file you want to view, and select **Expand file**.
### Configure collapse behavior for a file type
To change the default collapse behavior for a file type:
1. If a `.gitattributes` file does not exist in the root directory of your project,
create a blank file with this name.
1. For each file type you want to modify, add a line to the `.gitattributes` file
declaring the file extension and your desired behavior:
```conf
# Collapse all files with a .txt extension
*.txt gitlab-generated
# Collapse all files within the docs directory
docs/** gitlab-generated
# Do not collapse package-lock.json
package-lock.json -gitlab-generated
```
1. Commit, push, and merge your changes into your default branch.
After the changes merge into your [default branch](../repository/branches/default.md),
all files of this type in your project use this behavior in merge requests.
For technical details about how GitLab detects generated files, see the
[`go-enry`](https://github.com/go-enry/go-enry/blob/master/data/generated.go) repository.
## Show one file at a time
For larger merge requests, you can review one file at a time. You can change this
setting in your user preferences, or when you review a merge request. If you change this
setting in a merge request, it updates your user settings as well.
{{< tabs >}}
{{< tab title="In a merge request" >}}
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the merge request title, select **Changes**.
1. Select **Preferences** ({{< icon name="preferences" >}}).
1. Select or clear **Show one file at a time**.
{{< /tab >}}
{{< tab title="In your user preferences" >}}
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. Scroll to the **Behavior** section and select the **Show one file at a time on merge request's Changes tab** checkbox.
1. Select **Save changes**.
{{< /tab >}}
{{< /tabs >}}
To select another file to view when this setting is enabled, either:
- Scroll to the end of the file and select either **Prev** or **Next**.
- If [keyboard shortcuts are enabled](../../shortcuts.md#enable-keyboard-shortcuts),
press <kbd>\[</kbd>, <kbd>]</kbd>, <kbd>k</kbd>, or <kbd>j</kbd>.
- Select **Show file browser** ({{< icon name="file-tree" >}}) and select another file to view.
## Compare changes
You can view the changes in a merge request either:
- Inline, which shows the changes vertically. The old version of a line is shown
first, with the new version shown directly below it.
Inline mode is often better for changes to single lines.
- Side-by-side, which shows the old and new versions of lines in separate columns.
Side-by-side mode is often better for changes affecting large numbers of sequential lines.
To change how a merge request shows changed lines:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Select **Preferences** ({{< icon name="preferences" >}}). Select either **Side-by-side** or **Inline**.
This example shows how GitLab renders the same change in both inline and side-by-side mode:
{{< tabs >}}
{{< tab title="Inline changes" >}}

{{< /tab >}}
{{< tab title="Side-by-side changes" >}}

{{< /tab >}}
{{< /tabs >}}
## Explain code in a merge request
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Pro or Enterprise, GitLab Duo with Amazon Q
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM for GitLab Self-Managed, GitLab Dedicated: Anthropic [Claude 3.5 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet)
- LLM for GitLab.com: Anthropic [Claude 3.7 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-7-sonnet)
- LLM for Amazon Q: Amazon Q Developer
{{< /details >}}
{{< history >}}
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) in GitLab 16.8.
- Changed to require GitLab Duo add-on in GitLab 17.6 and later.
{{< /history >}}
If you spend a lot of time trying to understand code that others have created, or
you struggle to understand code written in a language you are not familiar with,
you can ask GitLab Duo to explain the code to you.
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://youtu.be/1izKaLmmaCA?si=O2HDokLLujRro_3O)
<!-- Video published on 2023-11-18 -->
Prerequisites:
- You must belong to at least one group with the
[experiment and beta features setting](../../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
- You must have access to view the project.
To explain the code in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Changes**.
1. On the file you would like explained, select the three dots ({{< icon name="ellipsis_v" >}}) and select **View File @ $SHA**.
A separate browser tab opens and shows the full file with the latest changes.
1. On the new tab, select the lines you want to have explained.
1. On the left side, select the question mark ({{< icon name="question" >}}). You might have to scroll to the first line of your selection to view it.

Duo Chat explains the code. It might take a moment for the explanation to be generated.
If you'd like, you can provide feedback about the quality of the explanation.
We cannot guarantee that the large language model produces results that are correct. Use the explanation with caution.
You can also explain code in:
- A [file](../repository/code_explain.md).
- The [IDE](../../gitlab_duo_chat/examples.md#explain-selected-code).
## Expand or collapse comments
When reviewing code changes, you can hide inline comments:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Scroll to the file that contains the comments you want to hide.
1. Scroll to the line the comment is attached to. In the gutter margin, select **Collapse** ({{< icon name="collapse" >}}):

To expand inline comments and show them again:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Scroll to the file that contains the collapsed comments you want to show.
1. Scroll to the line the comment is attached to. In the gutter margin, select the user avatar:

## Ignore whitespace changes
Whitespace changes can make it more difficult to see the substantive changes in
a merge request. You can choose to hide or show whitespace changes:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. Before the list of changed files, select **Preferences** ({{< icon name="preferences" >}}).
1. Select or clear **Show whitespace changes**:

## Mark files as viewed
When reviewing a merge request with many files multiple times, you can ignore files
you've already reviewed. To hide files that haven't changed after your last review:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Below the title, select **Changes**.
1. In the file's header, select the **Viewed** checkbox.
Files marked as viewed are not shown to you again unless either:
- The contents of the file change.
- You clear the **Viewed** checkbox.
## Show merge request conflicts in diff
To avoid displaying changes already on target branch, we compare the merge request's
source branch with the `HEAD` of the target branch.
When the source and target branch conflict, we show an alert
per conflicted file on the merge request diff:

## Show scanner findings in diff
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can show scanner findings in the diff. For details, see:
- [Code Quality findings](../../../ci/testing/code_quality.md#merge-request-changes-view)
- [Static Analysis findings](../../application_security/sast/_index.md#merge-request-changes-view)
## Download merge request changes
You can download the changes included in a merge request for use outside of GitLab.
### As a diff
To download the changes as a diff:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the merge request.
1. In the upper-right corner, select **Code > Plain diff**.
If you know the URL of the merge request, you can also download the diff from
the command line by appending `.diff` to the URL. This example downloads the diff
for merge request `000000`:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.diff
```
To download and apply the diff in a one-line CLI command:
```shell
curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.diff" | git apply
```
### As a patch file
To download the changes as a patch file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the merge request.
1. In the upper-right corner, select **Code > Patches**.
If you know the URL of the merge request, you can also download the patch from
the command line by appending `.patch` to the URL. This example downloads the patch
file for merge request `000000`:
```plaintext
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch
```
To download and apply the patch using [`git am`](https://git-scm.com/docs/git-am):
```shell
# Download and preview the patch
curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch" > changes.patch
git apply --check changes.patch
# Apply the patch
git am changes.patch
```
You can also download and apply the patch in a single command:
```shell
curl "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/000000.patch" | git am
```
The `git am` uses the `-p1` option by default. For more information, see [`git-apply`](https://git-scm.com/docs/git-apply).
## Add a comment to a merge request file
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123515) in GitLab 16.1 [with a flag](../../../administration/feature_flags/_index.md) named `comment_on_files`. Enabled by default.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125130) in GitLab 16.2.
{{< /history >}}
You can add comments to a merge request diff file. These comments persist across
rebases and file changes.
To add a comment to a merge request file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select **Changes**.
1. In the header for the file you want to comment on, select **Comment** ({{< icon name="comment" >}}).
## Add a comment to an image
In merge requests and commit detail views, you can add a comment to an image.
This comment can also be a thread.
1. Hover your mouse over the image.
1. Select the location where you want to comment.
GitLab shows an icon and a comment field on the image.
## Related topics
- [Compare branches](../repository/branches/_index.md#compare-branches)
- [Download branch comparisons](../repository/branches/_index.md#download-branch-comparisons)
- [Merge request reviews](reviews/_index.md)
- [Merge request versions](versions.md)
|
https://docs.gitlab.com/user/project/stacked_diffs
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/stacked_diffs.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
stacked_diffs.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Stacked diffs
|
Use stacked diffs to create small merge changes that build upon each other to ultimately deliver a feature.
|
{{< details >}}
- Tier: Core, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
{{< /details >}}
{{< history >}}
- Released in [v1.42.0 of the GitLab CLI](https://gitlab.com/gitlab-org/cli/-/releases/v1.42.0) as an [experiment](../../../policy/development_stages_support.md#experiment).
{{< /history >}}
In the [GitLab CLI](https://gitlab.com/gitlab-org/cli), stacked diffs are a way of
creating small changes that build upon each other to ultimately deliver a feature.
Each stack is separate, so you can keep building your feature in one stack
while previous parts of the stack receive reviews and updates.
The base command for this feature in the CLI is
[`stack`](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/stack), which
you then extend with other commands.
<div class="video-fallback">
To learn more, see: <a href="https://www.youtube.com/watch?v=TOQOV8PWYic">Stacked Diffs in the CLI overview</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/TOQOV8PWYic" frameborder="0" allowfullscreen> </iframe>
</figure>
<!-- Video published on 2024-06-18 -->
This feature is an [experiment](../../../policy/development_stages_support.md).
We'd love to hear your feedback in [issue 7473](https://gitlab.com/gitlab-org/cli/-/issues/7473).
## Create a stacked diff
To do create a stacked diff in the GitLab CLI:
1. In your terminal window, create a new stack with `glab stack create`, and give your stack a name.
1. Make your first set of changes.
1. To save your first set of changes, enter `glab stack save`, then a commit message.
1. Continue creating changes, saving them with `glab stack save`. Each time you
save a stack, `glab` creates a new branch.
1. To push your changes up to GitLab, enter `glab stack sync`. GitLab creates a
merge request for each stack.
### Commands that build upon `glab stack`
Use these sub-commands with `glab stack`:
- [`amend`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/amend.md)
- [`create`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/create.md)
- [`first`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/first.md)
- [`last`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/last.md)
- [`move`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/move.md)
- [`next`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/next.md)
- [`prev`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/prev.md)
- [`save`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/save.md)
- [`sync`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/sync.md)
## Add changes to a diff in a stack
To return to a specific point in the stack to add more changes to it:
1. In your terminal window, use the `glab stack move` command. `glab` displays
a list of stacks.
1. Select the stack you want to edit, and make your changes.
1. When you're ready to save your changes, use the `glab stack amend` command.
1. Optional. Change the description of the stack, if desired.
1. Run `glab stack sync` to push your changes back up to GitLab.
When you sync an existing stack, GitLab:
- Updates the existing stack with your new changes.
- Rebases the other merge requests in the stack to bring in your latest changes.
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use stacked diffs to create small merge changes that build upon each
other to ultimately deliver a feature.
title: Stacked diffs
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Core, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
{{< /details >}}
{{< history >}}
- Released in [v1.42.0 of the GitLab CLI](https://gitlab.com/gitlab-org/cli/-/releases/v1.42.0) as an [experiment](../../../policy/development_stages_support.md#experiment).
{{< /history >}}
In the [GitLab CLI](https://gitlab.com/gitlab-org/cli), stacked diffs are a way of
creating small changes that build upon each other to ultimately deliver a feature.
Each stack is separate, so you can keep building your feature in one stack
while previous parts of the stack receive reviews and updates.
The base command for this feature in the CLI is
[`stack`](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/stack), which
you then extend with other commands.
<div class="video-fallback">
To learn more, see: <a href="https://www.youtube.com/watch?v=TOQOV8PWYic">Stacked Diffs in the CLI overview</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/TOQOV8PWYic" frameborder="0" allowfullscreen> </iframe>
</figure>
<!-- Video published on 2024-06-18 -->
This feature is an [experiment](../../../policy/development_stages_support.md).
We'd love to hear your feedback in [issue 7473](https://gitlab.com/gitlab-org/cli/-/issues/7473).
## Create a stacked diff
To do create a stacked diff in the GitLab CLI:
1. In your terminal window, create a new stack with `glab stack create`, and give your stack a name.
1. Make your first set of changes.
1. To save your first set of changes, enter `glab stack save`, then a commit message.
1. Continue creating changes, saving them with `glab stack save`. Each time you
save a stack, `glab` creates a new branch.
1. To push your changes up to GitLab, enter `glab stack sync`. GitLab creates a
merge request for each stack.
### Commands that build upon `glab stack`
Use these sub-commands with `glab stack`:
- [`amend`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/amend.md)
- [`create`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/create.md)
- [`first`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/first.md)
- [`last`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/last.md)
- [`move`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/move.md)
- [`next`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/next.md)
- [`prev`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/prev.md)
- [`save`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/save.md)
- [`sync`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/stack/sync.md)
## Add changes to a diff in a stack
To return to a specific point in the stack to add more changes to it:
1. In your terminal window, use the `glab stack move` command. `glab` displays
a list of stacks.
1. Select the stack you want to edit, and make your changes.
1. When you're ready to save your changes, use the `glab stack amend` command.
1. Optional. Change the description of the stack, if desired.
1. Run `glab stack sync` to push your changes back up to GitLab.
When you sync an existing stack, GitLab:
- Updates the existing stack with your new changes.
- Rebases the other merge requests in the stack to bring in your latest changes.
|
https://docs.gitlab.com/user/project/creating_merge_requests
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/creating_merge_requests.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
creating_merge_requests.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Creating merge requests
|
How to create merge requests in GitLab.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you're ready to create a merge request, use a method that fits your workflow. The GitLab UI
offers several ways to create a merge request, and methods outside of the UI are also available:
- The command line, with the [`glab mr`](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/mr)
command, or [Git commands](../../../topics/git/merge.md) combined with
[push options](../../../topics/git/commit.md#push-options).
- The [Visual Studio Code extension](../../../editor_extensions/visual_studio_code/_index.md).
- [An email](#by-sending-an-email).
- [The merge requests API](../../../api/merge_requests.md).
To streamline the process of connecting a merge request to your branch, follow the
[branch naming patterns](../repository/branches/_index.md#prefix-branch-names-with-a-number) when
naming your branch.
All methods of creating a merge request enforce your project's
[branch naming rules](../repository/branches/_index.md#name-your-branch).
## From the merge request list
You can create a merge request from the list of merge requests.
1. On the left sidebar, select **Search or go to** and find your GitLab project.
1. Select **Code > Merge requests**.
1. In the upper-right corner, select **New merge request**.
1. Select a source and target branch, then select **Compare branches and continue**.
1. Complete the fields on the **New merge request** page, then select **Create merge request**.
Each branch can be associated with only one open merge request. If a merge request
already exists for this branch, a link to the existing merge request is shown.
## From an issue
If your development workflow requires an issue for every merge
request, you can create a branch directly from the issue to speed the process up.
The new branch, and later its merge request, are marked as related to this issue.
After merging the merge request, the issue is closed automatically, unless
[automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing):
To create a branch and a merge request at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues** and find your issue.
1. Go to the bottom of the issue description.
1. Select **Create merge request > Create merge request and branch**.
1. On the dialog, review the suggested branch name. It's based on your project's
[branch name template](../repository/branches/_index.md).
1. Optional. If the branch name is already taken, or you need a different branch name, rename it.
1. Select a source branch or tag.
1. Select **Create merge request**.
## From a task
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/477785) in GitLab 17.8.
{{< /history >}}
If your team breaks issues into [tasks](../../tasks.md), you can create a branch directly from the task to speed the process up.
The new branch, and later its merge request, are marked as related to this task.
After merging the merge request, the task is closed automatically, unless
[automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing):
Prerequisites:
- You must have at least a Developer role for the project containing the task.
To create a branch and a merge request at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the issue list, find your task.
1. Go to the bottom of the task description.
1. Select **Create merge request**.
1. On the dialog, review the suggested branch name.
It's based on your project's [branch name template](../repository/branches/_index.md).
1. Optional. If the branch name is already taken, or you need a different branch name, rename it.
1. Select a source branch or tag.
1. Select **Create merge request**.
If your Git repository is empty, GitLab:
- Creates a default branch.
- Commits a blank `README.md` file to it.
- Creates and redirects you to a new branch based on the issue title.
- If your project is [configured with a deployment service](../integrations/_index.md) like Kubernetes,
GitLab prompts you to set up [auto deploy](../../../topics/autodevops/stages.md#auto-deploy)
by helping you create a `.gitlab-ci.yml` file.
If the name of the branch you create is
[prefixed with the task number](../repository/branches/_index.md#prefix-branch-names-with-a-number),
GitLab cross-links the issue and merge request, and adds the
[closing pattern](../issues/managing_issues.md#closing-issues-automatically)
to the description of the merge request. In most cases, this looks like `Closes #ID`,
where `ID` is the ID of the task. If your project is configured with a
[closing pattern](../issues/managing_issues.md#default-closing-pattern), the task closes
when the merge request merges.
## From the Web Editor
You can create a merge request when you do the following from the Web Editor:
- [Create a file](../repository/web_editor.md#create-a-file).
- [Edit a file](../repository/web_editor.md#edit-a-file).
- [Upload a file](../repository/web_editor.md#upload-a-file).
- [Delete a file](../repository/web_editor.md#delete-a-file).
- [Create a directory](../repository/web_editor.md#create-a-directory).
## When you create a branch
You can create a merge request when you create a branch.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Branches**.
1. Type a branch name and select **New branch**.
1. Above the file list, select **Create merge request**.
A merge request is created. The default branch is the target.
1. Fill out the fields and select **Create merge request**.
## When you work in a fork
You can create a merge request from your fork to contribute back to the main project.
1. On the left sidebar, select **Search or go to** and find your fork.
1. Select **Code > Merge requests**, and select **New merge request**.
1. For **Source branch**, select the branch in your fork that contains your changes.
1. For **Target branch**:
1. Select the upstream repository, and not your fork.
If you contribute changes upstream frequently, consider setting a
[default target](#set-the-default-target-project) for your fork.
1. Select a branch from the upstream repository:

{{< alert type="note" >}}
If your fork's visibility is more restricted than the parent repository, the target branch defaults
to your fork's default branch. This prevents potential exposure of private information in your fork.
{{< /alert >}}
1. Select **Compare branches and continue**.
1. Select **Create merge request**. The merge request is created in the target repository,
not your fork.
1. Add your desired labels, milestones, reviewers, and assignees.
1. Select **Submit merge request**.
If the merge request targets another repository, it uses:
- The target project's approval rules.
- Your fork's CI/CD configuration, resources, and project CI/CD variables.
To run CI/CD pipelines in the upstream project,
[you must be a member of that project](../../../ci/pipelines/merge_request_pipelines.md#use-with-forked-projects).
If you run a merge request pipeline
[in the parent project](../../../ci/pipelines/merge_request_pipelines.md#run-pipelines-in-the-parent-project)
for a merge request from a fork, all variables become available to the pipeline.
After your work merges, [unlink your fork](../repository/forking_workflow.md#unlink-a-fork)
from its upstream repository if you don't intend to make more contributions.
### Set the default target project
By default, merge requests originating from a fork target the upstream repository, not your fork.
You can configure your forked repository to be the default target, rather than the upstream repository.
Prerequisites:
- You're working in a fork.
- You must have at least the Developer role, or be allowed to create merge requests in the project.
- The upstream repository allows merge requests to be created.
- The [visibility settings](../../public_access.md#change-project-visibility) for
the fork must match, or be less strict than, the upstream repository. For example:
this setting isn't shown if your fork is private, but the upstream is public.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Target project** section, select the option you want to use for
your default target project.
1. Select **Save changes**.
## By sending an email
You can create a merge request by sending an email message to GitLab.
The merge request target branch is the repository's default branch.
Prerequisites:
- The merge request must target the current repository, not an upstream repository.
- A GitLab administrator must configure [incoming email](../../../administration/incoming_email.md).
This setting is enabled on GitLab.com.
- A GitLab administrator must configure [Reply by email](../../../administration/reply_by_email.md).
This setting is enabled on GitLab.com.
- You must have at least the Developer role, or be allowed to create merge requests in the project.
To create a merge request by sending an email:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. If the project contains any merge requests, select **Email a new merge request to this project**.
1. In the dialog, copy the email address shown. Keep this address private. Anyone who
has it can create issues or merge requests as if they were you.
1. Open an email and compose a message with the following information:
- The **To** line is the email address you copied.
- The **Subject** is the source branch name.
- The body of the email is the merge request description.
1. To add commits, attach `.patch` files to the message.
1. Send the email.
A merge request is created.
### Add attachments when creating a merge request by email
Add commits to a merge request by adding patches as attachments to the email.
- The combined size of the patches must be 2 MB or less.
- To be considered a patch, the attachment's filename must end in `.patch`.
- Patches are processed in order by name.
- If the source branch from the subject does not exist, it is
created from the repository's `HEAD`, or the default target branch.
To change the target branch manually, use the
[`/target_branch` quick action](../quick_actions.md).
- If the source branch already exists, patches are applied on top of it.
## Troubleshooting
### No option to create a merge request on an issue
The option to **Create merge request** doesn't display on an issue if:
- A branch with the same name already exists.
- A merge request already exists for this branch.
- Your project has an active fork relationship.
- Your project is private and the issue is confidential.
To make this button appear, one possible workaround is to
[remove your project's fork relationship](../repository/forking_workflow.md#unlink-a-fork).
After removal, you can't restore the fork relationship. Your project can no longer
send or receive merge requests to the source project, or other forks of it.
### Email message could not be processed
When sending an email to create a merge request, and you attempt to target an
upstream repository, GitLab responds with this error:
```plaintext
Unfortunately, your email message to GitLab could not be processed.
You are not allowed to perform this action. If you believe this is in error, contact a staff member.
```
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: How to create merge requests in GitLab.
title: Creating merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you're ready to create a merge request, use a method that fits your workflow. The GitLab UI
offers several ways to create a merge request, and methods outside of the UI are also available:
- The command line, with the [`glab mr`](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/mr)
command, or [Git commands](../../../topics/git/merge.md) combined with
[push options](../../../topics/git/commit.md#push-options).
- The [Visual Studio Code extension](../../../editor_extensions/visual_studio_code/_index.md).
- [An email](#by-sending-an-email).
- [The merge requests API](../../../api/merge_requests.md).
To streamline the process of connecting a merge request to your branch, follow the
[branch naming patterns](../repository/branches/_index.md#prefix-branch-names-with-a-number) when
naming your branch.
All methods of creating a merge request enforce your project's
[branch naming rules](../repository/branches/_index.md#name-your-branch).
## From the merge request list
You can create a merge request from the list of merge requests.
1. On the left sidebar, select **Search or go to** and find your GitLab project.
1. Select **Code > Merge requests**.
1. In the upper-right corner, select **New merge request**.
1. Select a source and target branch, then select **Compare branches and continue**.
1. Complete the fields on the **New merge request** page, then select **Create merge request**.
Each branch can be associated with only one open merge request. If a merge request
already exists for this branch, a link to the existing merge request is shown.
## From an issue
If your development workflow requires an issue for every merge
request, you can create a branch directly from the issue to speed the process up.
The new branch, and later its merge request, are marked as related to this issue.
After merging the merge request, the issue is closed automatically, unless
[automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing):
To create a branch and a merge request at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues** and find your issue.
1. Go to the bottom of the issue description.
1. Select **Create merge request > Create merge request and branch**.
1. On the dialog, review the suggested branch name. It's based on your project's
[branch name template](../repository/branches/_index.md).
1. Optional. If the branch name is already taken, or you need a different branch name, rename it.
1. Select a source branch or tag.
1. Select **Create merge request**.
## From a task
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/477785) in GitLab 17.8.
{{< /history >}}
If your team breaks issues into [tasks](../../tasks.md), you can create a branch directly from the task to speed the process up.
The new branch, and later its merge request, are marked as related to this task.
After merging the merge request, the task is closed automatically, unless
[automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing):
Prerequisites:
- You must have at least a Developer role for the project containing the task.
To create a branch and a merge request at the same time:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the issue list, find your task.
1. Go to the bottom of the task description.
1. Select **Create merge request**.
1. On the dialog, review the suggested branch name.
It's based on your project's [branch name template](../repository/branches/_index.md).
1. Optional. If the branch name is already taken, or you need a different branch name, rename it.
1. Select a source branch or tag.
1. Select **Create merge request**.
If your Git repository is empty, GitLab:
- Creates a default branch.
- Commits a blank `README.md` file to it.
- Creates and redirects you to a new branch based on the issue title.
- If your project is [configured with a deployment service](../integrations/_index.md) like Kubernetes,
GitLab prompts you to set up [auto deploy](../../../topics/autodevops/stages.md#auto-deploy)
by helping you create a `.gitlab-ci.yml` file.
If the name of the branch you create is
[prefixed with the task number](../repository/branches/_index.md#prefix-branch-names-with-a-number),
GitLab cross-links the issue and merge request, and adds the
[closing pattern](../issues/managing_issues.md#closing-issues-automatically)
to the description of the merge request. In most cases, this looks like `Closes #ID`,
where `ID` is the ID of the task. If your project is configured with a
[closing pattern](../issues/managing_issues.md#default-closing-pattern), the task closes
when the merge request merges.
## From the Web Editor
You can create a merge request when you do the following from the Web Editor:
- [Create a file](../repository/web_editor.md#create-a-file).
- [Edit a file](../repository/web_editor.md#edit-a-file).
- [Upload a file](../repository/web_editor.md#upload-a-file).
- [Delete a file](../repository/web_editor.md#delete-a-file).
- [Create a directory](../repository/web_editor.md#create-a-directory).
## When you create a branch
You can create a merge request when you create a branch.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Branches**.
1. Type a branch name and select **New branch**.
1. Above the file list, select **Create merge request**.
A merge request is created. The default branch is the target.
1. Fill out the fields and select **Create merge request**.
## When you work in a fork
You can create a merge request from your fork to contribute back to the main project.
1. On the left sidebar, select **Search or go to** and find your fork.
1. Select **Code > Merge requests**, and select **New merge request**.
1. For **Source branch**, select the branch in your fork that contains your changes.
1. For **Target branch**:
1. Select the upstream repository, and not your fork.
If you contribute changes upstream frequently, consider setting a
[default target](#set-the-default-target-project) for your fork.
1. Select a branch from the upstream repository:

{{< alert type="note" >}}
If your fork's visibility is more restricted than the parent repository, the target branch defaults
to your fork's default branch. This prevents potential exposure of private information in your fork.
{{< /alert >}}
1. Select **Compare branches and continue**.
1. Select **Create merge request**. The merge request is created in the target repository,
not your fork.
1. Add your desired labels, milestones, reviewers, and assignees.
1. Select **Submit merge request**.
If the merge request targets another repository, it uses:
- The target project's approval rules.
- Your fork's CI/CD configuration, resources, and project CI/CD variables.
To run CI/CD pipelines in the upstream project,
[you must be a member of that project](../../../ci/pipelines/merge_request_pipelines.md#use-with-forked-projects).
If you run a merge request pipeline
[in the parent project](../../../ci/pipelines/merge_request_pipelines.md#run-pipelines-in-the-parent-project)
for a merge request from a fork, all variables become available to the pipeline.
After your work merges, [unlink your fork](../repository/forking_workflow.md#unlink-a-fork)
from its upstream repository if you don't intend to make more contributions.
### Set the default target project
By default, merge requests originating from a fork target the upstream repository, not your fork.
You can configure your forked repository to be the default target, rather than the upstream repository.
Prerequisites:
- You're working in a fork.
- You must have at least the Developer role, or be allowed to create merge requests in the project.
- The upstream repository allows merge requests to be created.
- The [visibility settings](../../public_access.md#change-project-visibility) for
the fork must match, or be less strict than, the upstream repository. For example:
this setting isn't shown if your fork is private, but the upstream is public.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Target project** section, select the option you want to use for
your default target project.
1. Select **Save changes**.
## By sending an email
You can create a merge request by sending an email message to GitLab.
The merge request target branch is the repository's default branch.
Prerequisites:
- The merge request must target the current repository, not an upstream repository.
- A GitLab administrator must configure [incoming email](../../../administration/incoming_email.md).
This setting is enabled on GitLab.com.
- A GitLab administrator must configure [Reply by email](../../../administration/reply_by_email.md).
This setting is enabled on GitLab.com.
- You must have at least the Developer role, or be allowed to create merge requests in the project.
To create a merge request by sending an email:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. If the project contains any merge requests, select **Email a new merge request to this project**.
1. In the dialog, copy the email address shown. Keep this address private. Anyone who
has it can create issues or merge requests as if they were you.
1. Open an email and compose a message with the following information:
- The **To** line is the email address you copied.
- The **Subject** is the source branch name.
- The body of the email is the merge request description.
1. To add commits, attach `.patch` files to the message.
1. Send the email.
A merge request is created.
### Add attachments when creating a merge request by email
Add commits to a merge request by adding patches as attachments to the email.
- The combined size of the patches must be 2 MB or less.
- To be considered a patch, the attachment's filename must end in `.patch`.
- Patches are processed in order by name.
- If the source branch from the subject does not exist, it is
created from the repository's `HEAD`, or the default target branch.
To change the target branch manually, use the
[`/target_branch` quick action](../quick_actions.md).
- If the source branch already exists, patches are applied on top of it.
## Troubleshooting
### No option to create a merge request on an issue
The option to **Create merge request** doesn't display on an issue if:
- A branch with the same name already exists.
- A merge request already exists for this branch.
- Your project has an active fork relationship.
- Your project is private and the issue is confidential.
To make this button appear, one possible workaround is to
[remove your project's fork relationship](../repository/forking_workflow.md#unlink-a-fork).
After removal, you can't restore the fork relationship. Your project can no longer
send or receive merge requests to the source project, or other forks of it.
### Email message could not be processed
When sending an email to create a merge request, and you attempt to target an
upstream repository, GitLab responds with this error:
```plaintext
Unfortunately, your email message to GitLab could not be processed.
You are not allowed to perform this action. If you believe this is in error, contact a staff member.
```
|
https://docs.gitlab.com/user/project/revert_changes
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/revert_changes.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
revert_changes.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Revert changes
|
How to revert commits or merge requests in a GitLab project.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Mistakes happen in code. Version control makes it possible to fix those mistakes by reverting them.
When you revert a commit, you create a new commit (a revert commit) that reverses the
bad change, rather than erasing the existence of the problem from your project's history. Revert commits
provide a clear audit trail, rather than a gap where the previous commit was. The revert commit
follows your project's access controls and processes, and:
- Removes the lines added in the original commit.
- Restores the lines removed in the original commit.
- Restores the lines modified in the original commit to their previous state.
Reverts are not limited to just commits. If the bad change spans more than one commit, consider
reverting all changes from the merge request, rather than reverting commit by commit. This approach
provides a cleaner audit trail.
## Revert a merge request
After a merge request merges, you can revert all changes in the merge request.
Prerequisites:
- You must have a role for the project that allows you to edit merge requests, and add
code to the repository.
- Your project must use the [merge method](methods/_index.md#fast-forward-merge) **Merge Commit**,
set in your project's **Settings > Merge requests**.
[In GitLab 16.9 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/22236), you can revert
fast-forwarded commits from the GitLab UI if either:
- The commits are squashed, or
- The merge request contains a single commit.
To revert merge request `Example`:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. From the secondary menu, select **Merged**, and select your merge request (here, `Example`).
1. Scroll to the merge request reports area, and find the report showing the
**Merged by** information.
1. Select **Revert**.
1. In **Revert in branch**, select the branch to revert your changes into.
1. To revert immediately, without a merge request:
1. Clear **Start a new merge request**.
1. Select **Revert**, and the revert of `Example` is complete.
1. To review the revert in a new merge request instead of reverting immediately,
select **Start a new merge request**, then:
1. Fill in the fields for your revert merge request, then select **Create merge request**.
1. When the merge request merges, the revert of `Example` is complete.
After you revert the `Example` merge request, the option to **Revert** is no longer shown on it.
## Revert a commit
You can revert any commit in a repository into either:
- The current branch.
- A new merge request.
Prerequisites:
- Your role for the project must allow you to edit merge requests, and add
code to the repository.
- The commit must not have already been reverted, as the **Revert** option is not
shown in this case.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. If you know the merge request that contains the commit:
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Commits**, then select the title of the commit you want to revert.
This displays the commit in the context of your merge request.
1. Below the secondary menu, GitLab shows the message **Viewing commit `00001111`**,
where `00001111` is the hash of the commit. Select the commit hash to show
the commit's page.
1. If you don't know the merge request the commit originated from:
1. Select **Code > Commits**.
1. Select the title of the commit to display full information about the commit.
1. In the upper-right corner, select **Options**, then select **Revert**.
1. In **Revert in branch**, select the branch to revert your changes into.
1. To revert immediately, without a merge request:
1. Clear **Start a new merge request**.
1. Select **Revert**.
1. To review the revert in a new merge request instead of reverting immediately,
select **Start a new merge request**, then:
1. Fill in the fields for your revert merge request, then select **Create merge request**.
1. When the merge request merges, the commit revert is complete.
### Revert a merge commit to a different parent commit
When you revert a merge commit, the branch you merged to (often `main`) is always the
first parent. To revert a merge commit to a different parent, you must revert the commit from
the command line, see [Revert and undo changes with Git](../../../topics/git/undo.md#revert-a-merge-commit-to-a-different-parent).
## Redact text from repository
{{< history >}}
- Introduced in GitLab 17.1 [with a flag](../../../administration/feature_flags/_index.md) named `rewrite_history_ui`. Disabled by default. GitLab team members can view more information in this confidential issue: `https://gitlab.com/gitlab-org/gitlab/-/issues/450701`
- Enabled on GitLab.com in confidential issue `https://gitlab.com/gitlab-org/gitlab/-/issues/462999` in GitLab 17.2.
- Enabled on GitLab Self-Managed and GitLab Dedicated in confidential issue `https://gitlab.com/gitlab-org/gitlab/-/issues/462999` in GitLab 17.3.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/472018) in GitLab 17.9. Feature flag `rewrite_history_ui` removed.
{{< /history >}}
Permanently delete sensitive or confidential information that was accidentally committed, ensuring
it's no longer accessible in your repository's history.
Replaces a list of strings with `***REMOVED***`.
{{< alert type="warning" >}}
This action is irreversible.
After rewriting history and running housekeeping, the changes are permanent.
Be aware of the following impacts when redacting text from your repository:
{{< /alert >}}
- Open merge requests might fail to merge and require manual rebasing.
- This is a destructive operation. Existing local clones are incompatible with the updated repository and must be re-cloned.
- Pipelines referencing old commit SHAs might break and require reconfiguration.
- Historical tags and branches based on the old commit history might not function correctly.
- Commit signatures are dropped during the rewrite process.
- Commit hashes are updated because their content is updated by the redact operation.
While the redact feature in GitLab removes exposed secrets, it also:
- Corrupts the Git history state.
- Requires all developers to re-clone the repository after redaction.
- Breaks features that depend on commit hashes, including:
- Open merge requests.
- Links to previous commits, which results in 404 errors.
For better repository integrity, you should instead:
- Revoke or rotate exposed secrets.
- Implement [the secret detection capabilities of GitLab](../../application_security/secret_detection/_index.md).
This approach:
- Proactively prevents future secret leaks.
- Maintains Git history while ensuring security compliance.
For more information, see [secret push protection](../../application_security/secret_detection/secret_push_protection/_index.md).
Alternatively, to completely delete specific files from a repository, see
[Remove blobs](../repository/repository_size.md#remove-blobs).
Prerequisites:
- You must have the Owner role for the project.
To redact text from your repository:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Repository maintenance**.
1. Select **Redact text**.
1. On the drawer, enter the text to redact.
You can use regex and glob patterns.
1. Select **Redact matching strings**.
1. On the confirmation dialog, enter your project path.
1. Select **Yes, redact matching strings**.
1. On the left sidebar, select **Settings > General**.
1. Expand **Advanced**.
1. Select **Run housekeeping**. Wait at least 30 minutes for the operation to complete.
1. In the same **Settings > General > Advanced** section, select **Prune unreachable objects**.
This operation takes approximately 5-10 minutes to complete.
{{< alert type="note" >}}
If the project containing the sensitive information has been forked, the housekeeping task may not be able to complete this redaction process [to maintain the integrity of the special object pool repository which contains the forked data](../../../administration/housekeeping.md#object-pool-repositories).
For help, contact GitLab Support.
{{< /alert >}}
## Related topics
- [Official `git revert` documentation](https://git-scm.com/docs/git-revert)
- [Undo changes by using Git](../../../topics/git/undo.md)
- [Revert a commit](../../../api/commits.md#revert-a-commit) with the Commits API
- How changelogs [handle reverted commits](../changelogs.md#reverted-commit-handling)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: How to revert commits or merge requests in a GitLab project.
title: Revert changes
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Mistakes happen in code. Version control makes it possible to fix those mistakes by reverting them.
When you revert a commit, you create a new commit (a revert commit) that reverses the
bad change, rather than erasing the existence of the problem from your project's history. Revert commits
provide a clear audit trail, rather than a gap where the previous commit was. The revert commit
follows your project's access controls and processes, and:
- Removes the lines added in the original commit.
- Restores the lines removed in the original commit.
- Restores the lines modified in the original commit to their previous state.
Reverts are not limited to just commits. If the bad change spans more than one commit, consider
reverting all changes from the merge request, rather than reverting commit by commit. This approach
provides a cleaner audit trail.
## Revert a merge request
After a merge request merges, you can revert all changes in the merge request.
Prerequisites:
- You must have a role for the project that allows you to edit merge requests, and add
code to the repository.
- Your project must use the [merge method](methods/_index.md#fast-forward-merge) **Merge Commit**,
set in your project's **Settings > Merge requests**.
[In GitLab 16.9 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/22236), you can revert
fast-forwarded commits from the GitLab UI if either:
- The commits are squashed, or
- The merge request contains a single commit.
To revert merge request `Example`:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. From the secondary menu, select **Merged**, and select your merge request (here, `Example`).
1. Scroll to the merge request reports area, and find the report showing the
**Merged by** information.
1. Select **Revert**.
1. In **Revert in branch**, select the branch to revert your changes into.
1. To revert immediately, without a merge request:
1. Clear **Start a new merge request**.
1. Select **Revert**, and the revert of `Example` is complete.
1. To review the revert in a new merge request instead of reverting immediately,
select **Start a new merge request**, then:
1. Fill in the fields for your revert merge request, then select **Create merge request**.
1. When the merge request merges, the revert of `Example` is complete.
After you revert the `Example` merge request, the option to **Revert** is no longer shown on it.
## Revert a commit
You can revert any commit in a repository into either:
- The current branch.
- A new merge request.
Prerequisites:
- Your role for the project must allow you to edit merge requests, and add
code to the repository.
- The commit must not have already been reverted, as the **Revert** option is not
shown in this case.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. If you know the merge request that contains the commit:
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Commits**, then select the title of the commit you want to revert.
This displays the commit in the context of your merge request.
1. Below the secondary menu, GitLab shows the message **Viewing commit `00001111`**,
where `00001111` is the hash of the commit. Select the commit hash to show
the commit's page.
1. If you don't know the merge request the commit originated from:
1. Select **Code > Commits**.
1. Select the title of the commit to display full information about the commit.
1. In the upper-right corner, select **Options**, then select **Revert**.
1. In **Revert in branch**, select the branch to revert your changes into.
1. To revert immediately, without a merge request:
1. Clear **Start a new merge request**.
1. Select **Revert**.
1. To review the revert in a new merge request instead of reverting immediately,
select **Start a new merge request**, then:
1. Fill in the fields for your revert merge request, then select **Create merge request**.
1. When the merge request merges, the commit revert is complete.
### Revert a merge commit to a different parent commit
When you revert a merge commit, the branch you merged to (often `main`) is always the
first parent. To revert a merge commit to a different parent, you must revert the commit from
the command line, see [Revert and undo changes with Git](../../../topics/git/undo.md#revert-a-merge-commit-to-a-different-parent).
## Redact text from repository
{{< history >}}
- Introduced in GitLab 17.1 [with a flag](../../../administration/feature_flags/_index.md) named `rewrite_history_ui`. Disabled by default. GitLab team members can view more information in this confidential issue: `https://gitlab.com/gitlab-org/gitlab/-/issues/450701`
- Enabled on GitLab.com in confidential issue `https://gitlab.com/gitlab-org/gitlab/-/issues/462999` in GitLab 17.2.
- Enabled on GitLab Self-Managed and GitLab Dedicated in confidential issue `https://gitlab.com/gitlab-org/gitlab/-/issues/462999` in GitLab 17.3.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/472018) in GitLab 17.9. Feature flag `rewrite_history_ui` removed.
{{< /history >}}
Permanently delete sensitive or confidential information that was accidentally committed, ensuring
it's no longer accessible in your repository's history.
Replaces a list of strings with `***REMOVED***`.
{{< alert type="warning" >}}
This action is irreversible.
After rewriting history and running housekeeping, the changes are permanent.
Be aware of the following impacts when redacting text from your repository:
{{< /alert >}}
- Open merge requests might fail to merge and require manual rebasing.
- This is a destructive operation. Existing local clones are incompatible with the updated repository and must be re-cloned.
- Pipelines referencing old commit SHAs might break and require reconfiguration.
- Historical tags and branches based on the old commit history might not function correctly.
- Commit signatures are dropped during the rewrite process.
- Commit hashes are updated because their content is updated by the redact operation.
While the redact feature in GitLab removes exposed secrets, it also:
- Corrupts the Git history state.
- Requires all developers to re-clone the repository after redaction.
- Breaks features that depend on commit hashes, including:
- Open merge requests.
- Links to previous commits, which results in 404 errors.
For better repository integrity, you should instead:
- Revoke or rotate exposed secrets.
- Implement [the secret detection capabilities of GitLab](../../application_security/secret_detection/_index.md).
This approach:
- Proactively prevents future secret leaks.
- Maintains Git history while ensuring security compliance.
For more information, see [secret push protection](../../application_security/secret_detection/secret_push_protection/_index.md).
Alternatively, to completely delete specific files from a repository, see
[Remove blobs](../repository/repository_size.md#remove-blobs).
Prerequisites:
- You must have the Owner role for the project.
To redact text from your repository:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Repository maintenance**.
1. Select **Redact text**.
1. On the drawer, enter the text to redact.
You can use regex and glob patterns.
1. Select **Redact matching strings**.
1. On the confirmation dialog, enter your project path.
1. Select **Yes, redact matching strings**.
1. On the left sidebar, select **Settings > General**.
1. Expand **Advanced**.
1. Select **Run housekeeping**. Wait at least 30 minutes for the operation to complete.
1. In the same **Settings > General > Advanced** section, select **Prune unreachable objects**.
This operation takes approximately 5-10 minutes to complete.
{{< alert type="note" >}}
If the project containing the sensitive information has been forked, the housekeeping task may not be able to complete this redaction process [to maintain the integrity of the special object pool repository which contains the forked data](../../../administration/housekeeping.md#object-pool-repositories).
For help, contact GitLab Support.
{{< /alert >}}
## Related topics
- [Official `git revert` documentation](https://git-scm.com/docs/git-revert)
- [Undo changes by using Git](../../../topics/git/undo.md)
- [Revert a commit](../../../api/commits.md#revert-a-commit) with the Commits API
- How changelogs [handle reverted commits](../changelogs.md#reverted-commit-handling)
|
https://docs.gitlab.com/user/project/homepage
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/homepage.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
homepage.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request homepage
|
Use the merge request homepage to find your work, and work you need to review.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you are the author, assignee, or reviewer of a merge request, it appears on your merge request
homepage. This page sorts your merge requests by **Workflow** or by **Role**. The **Workflow** view
shows you which merge requests need your attention first, regardless of whether it's your work or
the work of someone else. The workflow view groups merge requests by their stage in this review process:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
flowchart LR
accTitle: Merge request review workflow
accDescr: Flow from merge request creation through review, approval, and merge stages with decision points for reviewers and approvals.
A[Your<br>merge request] --> B{Reviewers<br>added?}
B-->|Yes| D[<strong>Review<br>requested</strong>]
B -.->|No| C[<strong>Assigned<br>to you</strong>]
D -->|Approved| E[<strong>Approved<br>by others</strong>]
D -..->|Changes<br>requested| F[<strong>Returned<br>to you</strong>]
F -->|You make<br>changes| D
E -->G{All<br>approvals?}
G -->|Yes| K[Ready to merge]
G -.->|No| J[Remains in<br><strong>Waiting for approvals</strong>]
linkStyle default stroke:red
linkStyle 0 stroke:green
linkStyle 1 stroke:green
linkStyle 3 stroke:green
linkStyle 5 stroke:green
linkStyle 6 stroke:green
linkStyle 7 stroke:green
style K stroke:black,fill:#28a745,color:#fff
```
This review flow assumes reviewers use the **Start a review** and **Submit a review** features.
The **Role** view sorts your merge requests by your role in the merge request.
## See your merge request homepage
{{< history >}}
- Merge request homepage [introduced](https://gitlab.com/groups/gitlab-org/-/epics/13448) in GitLab 17.9 [with a flag](../../../administration/feature_flags/_index.md) named `merge_request_dashboard`. Disabled by default.
- Feature flag `merge_request_dashboard` [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/480854) on GitLab.com in GitLab 17.9.
- Feature flag `mr_dashboard_list_type_toggle` [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/535244) for GitLab.com in GitLab 18.1.
- Feature flag `merge_request_dashboard` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194999) in GitLab 18.2.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
GitLab shows your total **Active** merge requests on the left sidebar on all pages:

This user has:
- 31 open issues ({{< icon name="issue-type-issue" >}})
- 8 active merge requests ({{< icon name="merge-request-open" >}})
- 29 to-do items ({{< icon name="todo-done" >}})
Your merge request homepage shows more information about these merge requests. To see it,
use any of these methods:
- Use the <kbd>Shift</kbd> + <kbd>m</kbd> [keyboard shortcut](../../shortcuts.md).
- On the left sidebar, select **Merge requests** ({{< icon name="merge-request-open">}}).
- On the left sidebar, select **Search or go to**, then from the dropdown list, select **Merge requests**.
To help you focus on what needs your attention right now, GitLab organizes your merge request homepage
into three tabs:

- **Active**: These merge requests need attention from you, or a member of your team.
- **Merged**: These merge requests merged in the last 14 days. They are your work, or contain a review from you.
- **Search**: Search all merge requests, and filter them as needed.

- **Status**: The current status of the merge request.
- **Title**: Important metadata about the issue, including:
- The merge request title.
- The assignee's avatar.
- The number of files and lines added and removed (`+` / `-`).
- Milestone.
- **Author**: The author's avatar.
- **Reviewers**: The reviewers' avatars. Reviewers with a green check mark have approved the merge request.
- **Checks**: A compact assessment of mergeability.
- A warning ({{< icon name="warning-solid">}}) if merge conflicts exist.
- Number of unresolved threads, like `0 of 3`.
- Current required [approval status](approvals/_index.md#in-the-list-of-merge-requests).
- Most recent pipeline status.
- Date of last update.
### Set your display preferences
On the top right of your merge request homepage, select **Display preferences** ({{< icon name="preferences">}}):
- Toggle **Show labels** to show or hide labels for each merge request.
- Sorting preferences: **Workflow** or **Role**.
- **Workflow** groups merge requests by their status. GitLab shows the merge requests
needing your attention first, regardless of whether you are the author or the reviewer.
- **Role** groups merge requests by whether you are the reviewer or the author.
Active merge requests count toward the total shown on the left sidebar. GitLab excludes **Inactive**
merge requests from your review count.
### Workflow view: active statuses
These merge requests need your attention. They count toward the total shown on the left sidebar:
- **Assigned to you**: You're the merge request author or assignee. Add reviewers to start the review process.
Statuses:
- **Draft**: The merge request is a draft.
- **Reviewers needed**: The merge request is not a draft, but has no reviewers.
- **Review requested**: You're a reviewer. Review the merge request. Provide feedback. Optionally,
approve or request changes. Statuses:
- **Changes requested**: A reviewer has requested changes. The change request blocks the merge request,
but [can be bypassed](reviews/_index.md#bypass-a-request-for-changes).
- **Reviewer commented**: A reviewer has left comments but not requested changes.
- **Returned to you**: Reviewers have provided feedback, or requested changes. Address reviewer comments,
and apply suggested changes. Statuses:
- **Changes requested**: A reviewer has requested changes.
- **Reviewer commented**: A reviewer has left comments but not requested changes.
### Workflow view: inactive statuses
GitLab excludes these merge requests from the active count, because no action is required from you right now:
- **Waiting for assignee**: If you're the author, the merge request is awaiting review. If you're
the reviewer, you've requested changes. Statuses:
- **You requested changes**: You've completed your review and requested changes.
- **You commented**: You've commented, but have not completed your review.
- **Waiting for approvals**: Your assigned merge requests that are waiting for approvals, and reviews
you have requested changes for. Statuses:
- **Approvals required**: Number of required approvals remaining.
- **Approved**: Either you have approved, or all required approvals are satisfied.
- **Waiting for approvals**.
- **Approved by you**: Merge requests you've reviewed and approved.
Statuses:
- **Approved**: You've approved, and required approvals are satisfied.
- **Approval required**: You've approved, but not all required approvals are satisfied.
- **Approved by others**: Merge requests that have received approvals from other team members.
Potentially ready to merge, if all requirements are met. Statuses:
- **Approved**: Your merge request has received the necessary approvals.
### Role view
The **Role** view groups merge requests you are an assignee or reviewer for:
- **Reviewer (Active)**: Awaiting review from you.
- **Reviewer (Inactive)**: Already reviewed by you.
- **Your merge requests (Active)**
- **Your merge requests (Inactive)**
Merge requests in the **Active** lists count toward the total shown on the left sidebar.
## Related topics
- [Merge request reviews](reviews/_index.md)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use the merge request homepage to find your work, and work you need to
review.
title: Merge request homepage
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you are the author, assignee, or reviewer of a merge request, it appears on your merge request
homepage. This page sorts your merge requests by **Workflow** or by **Role**. The **Workflow** view
shows you which merge requests need your attention first, regardless of whether it's your work or
the work of someone else. The workflow view groups merge requests by their stage in this review process:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
flowchart LR
accTitle: Merge request review workflow
accDescr: Flow from merge request creation through review, approval, and merge stages with decision points for reviewers and approvals.
A[Your<br>merge request] --> B{Reviewers<br>added?}
B-->|Yes| D[<strong>Review<br>requested</strong>]
B -.->|No| C[<strong>Assigned<br>to you</strong>]
D -->|Approved| E[<strong>Approved<br>by others</strong>]
D -..->|Changes<br>requested| F[<strong>Returned<br>to you</strong>]
F -->|You make<br>changes| D
E -->G{All<br>approvals?}
G -->|Yes| K[Ready to merge]
G -.->|No| J[Remains in<br><strong>Waiting for approvals</strong>]
linkStyle default stroke:red
linkStyle 0 stroke:green
linkStyle 1 stroke:green
linkStyle 3 stroke:green
linkStyle 5 stroke:green
linkStyle 6 stroke:green
linkStyle 7 stroke:green
style K stroke:black,fill:#28a745,color:#fff
```
This review flow assumes reviewers use the **Start a review** and **Submit a review** features.
The **Role** view sorts your merge requests by your role in the merge request.
## See your merge request homepage
{{< history >}}
- Merge request homepage [introduced](https://gitlab.com/groups/gitlab-org/-/epics/13448) in GitLab 17.9 [with a flag](../../../administration/feature_flags/_index.md) named `merge_request_dashboard`. Disabled by default.
- Feature flag `merge_request_dashboard` [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/480854) on GitLab.com in GitLab 17.9.
- Feature flag `mr_dashboard_list_type_toggle` [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/535244) for GitLab.com in GitLab 18.1.
- Feature flag `merge_request_dashboard` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194999) in GitLab 18.2.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
GitLab shows your total **Active** merge requests on the left sidebar on all pages:

This user has:
- 31 open issues ({{< icon name="issue-type-issue" >}})
- 8 active merge requests ({{< icon name="merge-request-open" >}})
- 29 to-do items ({{< icon name="todo-done" >}})
Your merge request homepage shows more information about these merge requests. To see it,
use any of these methods:
- Use the <kbd>Shift</kbd> + <kbd>m</kbd> [keyboard shortcut](../../shortcuts.md).
- On the left sidebar, select **Merge requests** ({{< icon name="merge-request-open">}}).
- On the left sidebar, select **Search or go to**, then from the dropdown list, select **Merge requests**.
To help you focus on what needs your attention right now, GitLab organizes your merge request homepage
into three tabs:

- **Active**: These merge requests need attention from you, or a member of your team.
- **Merged**: These merge requests merged in the last 14 days. They are your work, or contain a review from you.
- **Search**: Search all merge requests, and filter them as needed.

- **Status**: The current status of the merge request.
- **Title**: Important metadata about the issue, including:
- The merge request title.
- The assignee's avatar.
- The number of files and lines added and removed (`+` / `-`).
- Milestone.
- **Author**: The author's avatar.
- **Reviewers**: The reviewers' avatars. Reviewers with a green check mark have approved the merge request.
- **Checks**: A compact assessment of mergeability.
- A warning ({{< icon name="warning-solid">}}) if merge conflicts exist.
- Number of unresolved threads, like `0 of 3`.
- Current required [approval status](approvals/_index.md#in-the-list-of-merge-requests).
- Most recent pipeline status.
- Date of last update.
### Set your display preferences
On the top right of your merge request homepage, select **Display preferences** ({{< icon name="preferences">}}):
- Toggle **Show labels** to show or hide labels for each merge request.
- Sorting preferences: **Workflow** or **Role**.
- **Workflow** groups merge requests by their status. GitLab shows the merge requests
needing your attention first, regardless of whether you are the author or the reviewer.
- **Role** groups merge requests by whether you are the reviewer or the author.
Active merge requests count toward the total shown on the left sidebar. GitLab excludes **Inactive**
merge requests from your review count.
### Workflow view: active statuses
These merge requests need your attention. They count toward the total shown on the left sidebar:
- **Assigned to you**: You're the merge request author or assignee. Add reviewers to start the review process.
Statuses:
- **Draft**: The merge request is a draft.
- **Reviewers needed**: The merge request is not a draft, but has no reviewers.
- **Review requested**: You're a reviewer. Review the merge request. Provide feedback. Optionally,
approve or request changes. Statuses:
- **Changes requested**: A reviewer has requested changes. The change request blocks the merge request,
but [can be bypassed](reviews/_index.md#bypass-a-request-for-changes).
- **Reviewer commented**: A reviewer has left comments but not requested changes.
- **Returned to you**: Reviewers have provided feedback, or requested changes. Address reviewer comments,
and apply suggested changes. Statuses:
- **Changes requested**: A reviewer has requested changes.
- **Reviewer commented**: A reviewer has left comments but not requested changes.
### Workflow view: inactive statuses
GitLab excludes these merge requests from the active count, because no action is required from you right now:
- **Waiting for assignee**: If you're the author, the merge request is awaiting review. If you're
the reviewer, you've requested changes. Statuses:
- **You requested changes**: You've completed your review and requested changes.
- **You commented**: You've commented, but have not completed your review.
- **Waiting for approvals**: Your assigned merge requests that are waiting for approvals, and reviews
you have requested changes for. Statuses:
- **Approvals required**: Number of required approvals remaining.
- **Approved**: Either you have approved, or all required approvals are satisfied.
- **Waiting for approvals**.
- **Approved by you**: Merge requests you've reviewed and approved.
Statuses:
- **Approved**: You've approved, and required approvals are satisfied.
- **Approval required**: You've approved, but not all required approvals are satisfied.
- **Approved by others**: Merge requests that have received approvals from other team members.
Potentially ready to merge, if all requirements are met. Statuses:
- **Approved**: Your merge request has received the necessary approvals.
### Role view
The **Role** view groups merge requests you are an assignee or reviewer for:
- **Reviewer (Active)**: Awaiting review from you.
- **Reviewer (Inactive)**: Already reviewed by you.
- **Your merge requests (Active)**
- **Your merge requests (Inactive)**
Merge requests in the **Active** lists count toward the total shown on the left sidebar.
## Related topics
- [Merge request reviews](reviews/_index.md)
|
https://docs.gitlab.com/user/project/status_checks
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/status_checks.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
status_checks.md
|
Security Risk Management
|
Security Policies
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
External status checks
|
External status checks integrate with third-party tools to display pass or fail statuses in merge requests and can block merges if checks fail.
|
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- `pending` status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/413723) in GitLab 16.5
- Timeout interval of two minutes for `pending` status checks [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388725) in GitLab 16.6.
{{< /history >}}
Status checks are API calls to external systems that request the status of an external requirement.
You can create a status check that sends merge request data to third-party tools.
When users create, change, or close merge requests, GitLab sends a notification. The users or automated workflows
can then update the status of merge requests from outside of GitLab.
With this integration, you can integrate with third-party workflow tools, like
ServiceNow, or the custom tool of your choice. The third-party tool
responds with an associated status. This status is then displayed as a non-blocking
widget within the merge request, which surfaces this status to the merge request author or reviewers
at the merge request level itself.
You can configure merge request status checks for each individual project. These are not shared between projects.
Status checks fail if they stay in the pending state for more than two minutes.
## Access permissions
External status check responses can be viewed by:
- Users with Reporter role or higher permissions in the project
- Any authenticated user who can view the merge request when the project has internal visibility
This means that if you have an internal project, any logged-in user who can access the merge request can view the external status check responses.
For more information about use cases, feature discovery, and development timelines,
see [epic 3869](https://gitlab.com/groups/gitlab-org/-/epics/3869).
## Block merges of merge requests unless all status checks have passed
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/369859) in GitLab 15.5 [with a flag](../../../administration/feature_flags/_index.md) named `only_allow_merge_if_all_status_checks_passed`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/372340) in GitLab 15.8.
- Enabled on GitLab Self-Managed and feature flag [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111492) in GitLab 15.9.
{{< /history >}}
By default, merge requests in projects can be merged even if external status checks fail. To block the merging of merge requests when external checks fail:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Select the **Status checks must succeed** checkbox.
1. Select **Save changes**.
## Lifecycle
External status checks have an **asynchronous** workflow. Merge requests emit a merge request webhook payload to an external service whenever:
- A merge request is updated, closed, reopened, approved, unapproved, or merged.
- Code is pushed to the source branch of the merge request.
```mermaid
sequenceDiagram
Merge request->>+External service: Merge request payload
External service-->>-Merge request: Status check response
Note over External service,Merge request: Response includes SHA at HEAD
```
When the payload is received, the external service can then run any required processes before posting its response back to the merge request [using the REST API](../../../api/status_checks.md#set-status-of-an-external-status-check).
Merge requests return a `409 Conflict` error to any responses that do not refer to the current `HEAD` of the source branch. As a result, it's safe for the external service to process and respond to out-of-date commits.
External status checks have the following states:
- `pending` - The default state. No response has been received by the merge request from the external service.
- `passed` - A response from the external service has been received and approved by it.
- `failed` - A response from the external service has been received and denied by it.
If something changes outside of GitLab, you can [set the status of an external status check](../../../api/status_checks.md#set-status-of-an-external-status-check)
using the API. You don't need to wait for a merge request webhook payload to be sent first.
## View status check services
To view a list of status check services added to a project from the merge request settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Scroll down to **Status checks**. This list shows the service name, API URL, targeted branch,
and HMAC authentication status.

You can also view a list of status check services from the [Branch rules](../repository/branches/branch_rules.md#add-a-status-check-service) settings.
## Add or update a status check service
### Add a status check service
Within the **Status checks** sub-section, select the **Add status check** button.
The **Add status check** form is then shown.

Filling in the form and selecting the **Add status check** button creates a new status check.
The status check is applied to all new merge requests, but does not apply retroactively to existing merge requests.
### Update a status check service
In the **Status checks** sub-section, select **Edit** ({{< icon name="pencil" >}})
next to the status check you want to edit.
The **Update status check** form is then shown.

{{< alert type="note" >}}
You cannot see or modify the value of the HMAC shared secret. To change the shared secret, delete and recreate the external status check with a new value for the shared secret.
{{< /alert >}}
To update the status check, change the values in the form and select **Update status check**.
Status check updates are applied to all new merge requests, but do not apply retroactively to existing merge requests.
### Form values
For common form errors see the [troubleshooting](#troubleshooting) section below.
#### Service name
This name can be any alphanumerical value and **must** be set. The name **must** be unique for
the project.
The name **has** to be unique for the project.
#### API to check
This field requires a URL and **must** use either the HTTP or HTTPS protocols.
We **recommend** using HTTPS to protect your merge request data in transit.
The URL **must** be set and **must** be unique for the project.
#### Target branch
If you want to restrict the status check to a single branch,
you can use this field to set this limit.

The branches list is populated from the projects [protected branches](../repository/branches/protected.md).
You can scroll through the list of branches or use the search box
when there are a lot of branches and the branch you are looking
for doesn't appear immediately. The search box requires
**three** alphanumeric characters to be entered for the search to begin.
If you want the status check to be applied to **all** merge requests,
you can select the **All branches** option.
#### HMAC shared secret
HMAC authentication prevents tampering with requests
and ensures they come from a legitimate source.
## Delete a status check service
Within the **Status checks** sub-section, select **Remove** ({{< icon name="remove" >}})
next to the status check you want to delete.
The **Remove status check?** modal is then shown.

To complete the deletion of the status check you must select the
**Remove status check** button. This **permanently** deletes
the status check and it **is not** recoverable.
## Status checks widget
{{< history >}}
- UI [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91504) in GitLab 15.2.
- Ability to retry failed external status checks [added](https://gitlab.com/gitlab-org/gitlab/-/issues/383200) in GitLab 15.8.
- Widget [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111763) to poll for updates when there are pending status checks in GitLab 15.11.
{{< /history >}}
The status checks widget displays in merge requests and displays the following statuses:
- **pending** ({{< icon name="status-neutral" >}}), while GitLab waits for a response from an external status check.
- **success** ({{< icon name="status-success" >}}) or **failed** ({{< icon name="status-failed" >}}), when GitLab receives a response from an external status check.
When there are pending status checks, the widget polls for updates every few seconds until it receives a **success** or **failed** response.
To retry a failed status check:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Scroll to the merge request reports section, and expand the dropdown list to show the list of external status checks.
1. Select **Retry** ({{< icon name="retry" >}}) on the failed external status check row. The status check is put back into a pending state.
An organization might have a policy that does not allow merging merge requests if
external status checks do not pass. However, the details in the widget are for informational
purposes only.
{{< alert type="note" >}}
GitLab cannot guarantee that the external status checks are properly processed by
the related external service.
{{< /alert >}}
## Troubleshooting
### Duplicate value errors
```plaintext
Name is already taken
---
External API is already in use by another status check
```
On a per project basis, status checks can only use a name or API URL once.
These errors mean that either the status checks name or API URL have already
been used in this projects status checks.
You must either choose a different
value on the current status check or update the value on the existing status check.
### Invalid URL error
```plaintext
Please provide a valid URL
```
The API to check field requires the URL provided to use either the HTTP or HTTPs protocols.
You must update the value of the field to meet this requirement.
### Branch list error during retrieval or search
```plaintext
Unable to fetch branches list, please close the form and try again
```
An unexpected response was received from the branches retrieval API.
As suggested, you should close the form and reopen again or refresh the page. This error should be temporary, although
if it persists, check the [GitLab status page](https://status.gitlab.com/) to see if there is a wider outage.
### Failed to load status checks
```plaintext
Failed to load status checks
```
An unexpected response was received from the external status checks API.
You should:
- Refresh the page in case this error is temporary.
- Check the [GitLab status page](https://status.gitlab.com/) if the problem persists,
to see if there is a wider outage.
## Related topics
- [External status checks API](../../../api/status_checks.md)
|
---
stage: Security Risk Management
group: Security Policies
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: External status checks
description: External status checks integrate with third-party tools to display pass
or fail statuses in merge requests and can block merges if checks fail.
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- `pending` status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/413723) in GitLab 16.5
- Timeout interval of two minutes for `pending` status checks [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388725) in GitLab 16.6.
{{< /history >}}
Status checks are API calls to external systems that request the status of an external requirement.
You can create a status check that sends merge request data to third-party tools.
When users create, change, or close merge requests, GitLab sends a notification. The users or automated workflows
can then update the status of merge requests from outside of GitLab.
With this integration, you can integrate with third-party workflow tools, like
ServiceNow, or the custom tool of your choice. The third-party tool
responds with an associated status. This status is then displayed as a non-blocking
widget within the merge request, which surfaces this status to the merge request author or reviewers
at the merge request level itself.
You can configure merge request status checks for each individual project. These are not shared between projects.
Status checks fail if they stay in the pending state for more than two minutes.
## Access permissions
External status check responses can be viewed by:
- Users with Reporter role or higher permissions in the project
- Any authenticated user who can view the merge request when the project has internal visibility
This means that if you have an internal project, any logged-in user who can access the merge request can view the external status check responses.
For more information about use cases, feature discovery, and development timelines,
see [epic 3869](https://gitlab.com/groups/gitlab-org/-/epics/3869).
## Block merges of merge requests unless all status checks have passed
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/369859) in GitLab 15.5 [with a flag](../../../administration/feature_flags/_index.md) named `only_allow_merge_if_all_status_checks_passed`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/372340) in GitLab 15.8.
- Enabled on GitLab Self-Managed and feature flag [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111492) in GitLab 15.9.
{{< /history >}}
By default, merge requests in projects can be merged even if external status checks fail. To block the merging of merge requests when external checks fail:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Select the **Status checks must succeed** checkbox.
1. Select **Save changes**.
## Lifecycle
External status checks have an **asynchronous** workflow. Merge requests emit a merge request webhook payload to an external service whenever:
- A merge request is updated, closed, reopened, approved, unapproved, or merged.
- Code is pushed to the source branch of the merge request.
```mermaid
sequenceDiagram
Merge request->>+External service: Merge request payload
External service-->>-Merge request: Status check response
Note over External service,Merge request: Response includes SHA at HEAD
```
When the payload is received, the external service can then run any required processes before posting its response back to the merge request [using the REST API](../../../api/status_checks.md#set-status-of-an-external-status-check).
Merge requests return a `409 Conflict` error to any responses that do not refer to the current `HEAD` of the source branch. As a result, it's safe for the external service to process and respond to out-of-date commits.
External status checks have the following states:
- `pending` - The default state. No response has been received by the merge request from the external service.
- `passed` - A response from the external service has been received and approved by it.
- `failed` - A response from the external service has been received and denied by it.
If something changes outside of GitLab, you can [set the status of an external status check](../../../api/status_checks.md#set-status-of-an-external-status-check)
using the API. You don't need to wait for a merge request webhook payload to be sent first.
## View status check services
To view a list of status check services added to a project from the merge request settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Scroll down to **Status checks**. This list shows the service name, API URL, targeted branch,
and HMAC authentication status.

You can also view a list of status check services from the [Branch rules](../repository/branches/branch_rules.md#add-a-status-check-service) settings.
## Add or update a status check service
### Add a status check service
Within the **Status checks** sub-section, select the **Add status check** button.
The **Add status check** form is then shown.

Filling in the form and selecting the **Add status check** button creates a new status check.
The status check is applied to all new merge requests, but does not apply retroactively to existing merge requests.
### Update a status check service
In the **Status checks** sub-section, select **Edit** ({{< icon name="pencil" >}})
next to the status check you want to edit.
The **Update status check** form is then shown.

{{< alert type="note" >}}
You cannot see or modify the value of the HMAC shared secret. To change the shared secret, delete and recreate the external status check with a new value for the shared secret.
{{< /alert >}}
To update the status check, change the values in the form and select **Update status check**.
Status check updates are applied to all new merge requests, but do not apply retroactively to existing merge requests.
### Form values
For common form errors see the [troubleshooting](#troubleshooting) section below.
#### Service name
This name can be any alphanumerical value and **must** be set. The name **must** be unique for
the project.
The name **has** to be unique for the project.
#### API to check
This field requires a URL and **must** use either the HTTP or HTTPS protocols.
We **recommend** using HTTPS to protect your merge request data in transit.
The URL **must** be set and **must** be unique for the project.
#### Target branch
If you want to restrict the status check to a single branch,
you can use this field to set this limit.

The branches list is populated from the projects [protected branches](../repository/branches/protected.md).
You can scroll through the list of branches or use the search box
when there are a lot of branches and the branch you are looking
for doesn't appear immediately. The search box requires
**three** alphanumeric characters to be entered for the search to begin.
If you want the status check to be applied to **all** merge requests,
you can select the **All branches** option.
#### HMAC shared secret
HMAC authentication prevents tampering with requests
and ensures they come from a legitimate source.
## Delete a status check service
Within the **Status checks** sub-section, select **Remove** ({{< icon name="remove" >}})
next to the status check you want to delete.
The **Remove status check?** modal is then shown.

To complete the deletion of the status check you must select the
**Remove status check** button. This **permanently** deletes
the status check and it **is not** recoverable.
## Status checks widget
{{< history >}}
- UI [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91504) in GitLab 15.2.
- Ability to retry failed external status checks [added](https://gitlab.com/gitlab-org/gitlab/-/issues/383200) in GitLab 15.8.
- Widget [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111763) to poll for updates when there are pending status checks in GitLab 15.11.
{{< /history >}}
The status checks widget displays in merge requests and displays the following statuses:
- **pending** ({{< icon name="status-neutral" >}}), while GitLab waits for a response from an external status check.
- **success** ({{< icon name="status-success" >}}) or **failed** ({{< icon name="status-failed" >}}), when GitLab receives a response from an external status check.
When there are pending status checks, the widget polls for updates every few seconds until it receives a **success** or **failed** response.
To retry a failed status check:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Scroll to the merge request reports section, and expand the dropdown list to show the list of external status checks.
1. Select **Retry** ({{< icon name="retry" >}}) on the failed external status check row. The status check is put back into a pending state.
An organization might have a policy that does not allow merging merge requests if
external status checks do not pass. However, the details in the widget are for informational
purposes only.
{{< alert type="note" >}}
GitLab cannot guarantee that the external status checks are properly processed by
the related external service.
{{< /alert >}}
## Troubleshooting
### Duplicate value errors
```plaintext
Name is already taken
---
External API is already in use by another status check
```
On a per project basis, status checks can only use a name or API URL once.
These errors mean that either the status checks name or API URL have already
been used in this projects status checks.
You must either choose a different
value on the current status check or update the value on the existing status check.
### Invalid URL error
```plaintext
Please provide a valid URL
```
The API to check field requires the URL provided to use either the HTTP or HTTPs protocols.
You must update the value of the field to meet this requirement.
### Branch list error during retrieval or search
```plaintext
Unable to fetch branches list, please close the form and try again
```
An unexpected response was received from the branches retrieval API.
As suggested, you should close the form and reopen again or refresh the page. This error should be temporary, although
if it persists, check the [GitLab status page](https://status.gitlab.com/) to see if there is a wider outage.
### Failed to load status checks
```plaintext
Failed to load status checks
```
An unexpected response was received from the external status checks API.
You should:
- Refresh the page in case this error is temporary.
- Check the [GitLab status page](https://status.gitlab.com/) if the problem persists,
to see if there is a wider outage.
## Related topics
- [External status checks API](../../../api/status_checks.md)
|
https://docs.gitlab.com/user/project/commits
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/commits.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
commits.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Commits
|
Understand how to read the display of commits in a merge request.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
A commit records and sends the source code changes to the [repository](../repository/_index.md).
For more information, see [Recording Changes to the Repository](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository).
## Commit changes using the command line
When you use the command line, use [`git commit`](../../../topics/git/commands.md#git-commit).
You can add multiple commits before pushing your changes.
- Commit message:
A commit message identifies what is changed and why. Use descriptive messages to clarify the changes.
In GitLab, you can add keywords to the commit message to perform one of the following actions:
- Trigger a GitLab CI/CD pipeline:
If the project is configured with [GitLab CI/CD](../../../ci/_index.md),
you trigger a pipeline per push, not per commit.
- Skip pipelines:
Add the [`ci skip`](../../../ci/pipelines/_index.md#skip-a-pipeline) keyword to
your commit message to make GitLab CI/CD skip the pipeline.
- Cross-link issues and merge requests:
Use [cross-linking](../issues/crosslinking_issues.md#from-commit-messages)
to keep track of related parts of your workflow.
If you mention an issue or a merge request in a commit message, they are displayed
on their respective thread.
- Cherry-pick a commit:
In GitLab, you can [cherry-pick a commit](cherry_pick_changes.md#cherry-pick-a-single-commit)
from the UI.
- Revert a commit:
[Revert a commit](revert_changes.md#revert-a-commit)
from the UI to a selected branch.
- Sign a commit:
Add extra security by [signing your commits](../repository/signed_commits/_index.md).
For additional information, see [Stage, commit, and push changes](../../../topics/git/commit.md).
## Merge request commits
Each merge request has a history of the commits made to the source branch
after the merge request was created.
These commits are displayed on the merge request's **Commits** tab.
From this tab, you can review commit messages and copy a commit's SHA when you need to
[cherry-pick changes](cherry_pick_changes.md).
### View commits in a merge request
To see the commits included in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. To show a list of the commits in the merge request, newest first, select **Commits** .
To read more about the commit, select **Toggle commit description** ({{< icon name="ellipsis_h" >}})
on any commit.
1. To view the changes in the commit, select the title of the commit link.
1. To view other commits in the merge request, either:
- Select **Prev** or **Next**.
- Use keyboard shortcuts: <kbd>X</kbd> (previous commit) and <kbd>C</kbd> (next commit).
If your merge request builds upon a previous merge request, you might
need to [include more commits for context](#show-commits-from-previous-merge-requests).
### Show commits from previous merge requests
When you review a merge request, you might need information from previous commits
to help understand the commits you're reviewing. You might need more context
if another merge request:
- Changed files your current merge request doesn't modify, so those files aren't shown
in your current merge request's diff.
- Changed files that you're modifying in your current merge request, and you need
to see the progression of work.
To add previously merged commits to a merge request for more context:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Commits**.
1. Scroll to the end of the list of commits, and select **Add previously merged commits**.
1. Select the commits that you want to add.
1. Select **Save changes**.
Previously merged commits are referred to as **Context Commits** in
the [API](../../../api/merge_request_context_commits.md).
### Add a comment to a commit
{{< alert type="warning" >}}
Threads created this way are lost if the commit ID changes after a
force push.
{{< /alert >}}
To add discussion to a specific commit:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Commits**.
1. Below the commits, in the **Comment** field, enter a comment.
1. Save your comment as either a standalone comment, or a thread:
- To add a comment, select **Comment**.
- To start a thread, select the down arrow ({{< icon name="chevron-down" >}}), then select **Start thread**.
### View diffs between commits
To view the changes between previously merged commits:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Changes**.
1. By **Compare** ({{< icon name="file-tree" >}}), select the commits to compare:

If you selected to add previously merged commits for context, those commits are
also shown in the list.
### Find the merge request that introduced a change
When you view the commit details page, GitLab links to one or more merge requests
that contain that commit.
This behavior only applies to commits that are in the most recent version of a merge
request. If the commits were in a merge request and were rebased out of that merge
request, the commits are not linked.
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Understand how to read the display of commits in a merge request.
title: Commits
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
A commit records and sends the source code changes to the [repository](../repository/_index.md).
For more information, see [Recording Changes to the Repository](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository).
## Commit changes using the command line
When you use the command line, use [`git commit`](../../../topics/git/commands.md#git-commit).
You can add multiple commits before pushing your changes.
- Commit message:
A commit message identifies what is changed and why. Use descriptive messages to clarify the changes.
In GitLab, you can add keywords to the commit message to perform one of the following actions:
- Trigger a GitLab CI/CD pipeline:
If the project is configured with [GitLab CI/CD](../../../ci/_index.md),
you trigger a pipeline per push, not per commit.
- Skip pipelines:
Add the [`ci skip`](../../../ci/pipelines/_index.md#skip-a-pipeline) keyword to
your commit message to make GitLab CI/CD skip the pipeline.
- Cross-link issues and merge requests:
Use [cross-linking](../issues/crosslinking_issues.md#from-commit-messages)
to keep track of related parts of your workflow.
If you mention an issue or a merge request in a commit message, they are displayed
on their respective thread.
- Cherry-pick a commit:
In GitLab, you can [cherry-pick a commit](cherry_pick_changes.md#cherry-pick-a-single-commit)
from the UI.
- Revert a commit:
[Revert a commit](revert_changes.md#revert-a-commit)
from the UI to a selected branch.
- Sign a commit:
Add extra security by [signing your commits](../repository/signed_commits/_index.md).
For additional information, see [Stage, commit, and push changes](../../../topics/git/commit.md).
## Merge request commits
Each merge request has a history of the commits made to the source branch
after the merge request was created.
These commits are displayed on the merge request's **Commits** tab.
From this tab, you can review commit messages and copy a commit's SHA when you need to
[cherry-pick changes](cherry_pick_changes.md).
### View commits in a merge request
To see the commits included in a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. To show a list of the commits in the merge request, newest first, select **Commits** .
To read more about the commit, select **Toggle commit description** ({{< icon name="ellipsis_h" >}})
on any commit.
1. To view the changes in the commit, select the title of the commit link.
1. To view other commits in the merge request, either:
- Select **Prev** or **Next**.
- Use keyboard shortcuts: <kbd>X</kbd> (previous commit) and <kbd>C</kbd> (next commit).
If your merge request builds upon a previous merge request, you might
need to [include more commits for context](#show-commits-from-previous-merge-requests).
### Show commits from previous merge requests
When you review a merge request, you might need information from previous commits
to help understand the commits you're reviewing. You might need more context
if another merge request:
- Changed files your current merge request doesn't modify, so those files aren't shown
in your current merge request's diff.
- Changed files that you're modifying in your current merge request, and you need
to see the progression of work.
To add previously merged commits to a merge request for more context:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Commits**.
1. Scroll to the end of the list of commits, and select **Add previously merged commits**.
1. Select the commits that you want to add.
1. Select **Save changes**.
Previously merged commits are referred to as **Context Commits** in
the [API](../../../api/merge_request_context_commits.md).
### Add a comment to a commit
{{< alert type="warning" >}}
Threads created this way are lost if the commit ID changes after a
force push.
{{< /alert >}}
To add discussion to a specific commit:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Commits**.
1. Below the commits, in the **Comment** field, enter a comment.
1. Save your comment as either a standalone comment, or a thread:
- To add a comment, select **Comment**.
- To start a thread, select the down arrow ({{< icon name="chevron-down" >}}), then select **Start thread**.
### View diffs between commits
To view the changes between previously merged commits:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**, then select your merge request.
1. Select **Changes**.
1. By **Compare** ({{< icon name="file-tree" >}}), select the commits to compare:

If you selected to add previously merged commits for context, those commits are
also shown in the list.
### Find the merge request that introduced a change
When you view the commit details page, GitLab links to one or more merge requests
that contain that commit.
This behavior only applies to commits that are in the most recent version of a merge
request. If the commits were in a merge request and were rebased out of that merge
request, the commits are not linked.
|
https://docs.gitlab.com/user/project/drafts
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/drafts.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
drafts.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Draft merge requests
|
Prevent an incomplete merge request from merging until it's ready by setting it as a draft.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If a merge request isn't ready to merge, you can block it from merging until you
[mark it as ready](#mark-merge-requests-as-ready). Merge requests marked as **Draft**
cannot merge until you remove the **Draft** flag, even if they meet all other merge criteria:

## Mark merge requests as drafts
You can flag a merge request as a draft in several ways:
- Viewing a merge request: In the upper-right corner of the merge request,
select **Merge request actions** ({{< icon name="ellipsis_v" >}}), then **Mark as draft**.
- Creating or editing a merge request: Add `[Draft]`, `Draft:` or `(Draft)` to
the beginning of the merge request's title, or select **Mark as draft**
below the **Title** field.
- Commenting in an existing merge request: Add the `/draft`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
in a comment. To mark a merge request as ready, use `/ready`.
- Creating a commit: Add `draft:`, `Draft:`, `fixup!`, or `Fixup!` to the
beginning of a commit message targeting the merge request's source branch. This
method is not a toggle. Adding this text again in a later commit doesn't mark the
merge request as ready.
## Mark merge requests as ready
When a merge request is ready to merge, you can remove the `Draft` flag in several ways:
- Viewing a merge request: In the upper-right corner of the merge request, select **Mark as ready**.
Users with at least the Developer role
can also scroll to the bottom of the merge request description and select **Mark as ready**.
- Editing an existing merge request: Remove `[Draft]`, `Draft:` or `(Draft)`
from the beginning of the title, or clear **Mark as draft**
below the **Title** field.
- Commenting in an existing merge request: Add the `/ready`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
in a comment in the merge request.
When you mark a merge request as ready, GitLab notifies
[merge request participants and watchers](../../profile/notifications.md#notifications-on-issues-merge-requests-and-epics).
## Include or exclude drafts when searching
When you view or search in your project's merge requests list, to include or exclude
draft merge requests:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. To filter by merge request status, select **Open**, **Merged**, **Closed**,
or **All** in the navigation bar.
1. Select the search box to display a list of filters and select **Draft**, or
enter the word `draft`.
1. Select `=`.
1. Select **Yes** to include drafts, or **No** to exclude, and press **Return**
to update the list of merge requests:

## Pipelines for drafts
Draft merge requests run the same pipelines as merge requests marked as ready.
To skip a pipeline for a draft merge request, see [Skip pipelines for draft merge requests](../../../ci/yaml/workflow.md#skip-pipelines-for-draft-merge-requests).
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Prevent an incomplete merge request from merging until it's ready by
setting it as a draft.
title: Draft merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If a merge request isn't ready to merge, you can block it from merging until you
[mark it as ready](#mark-merge-requests-as-ready). Merge requests marked as **Draft**
cannot merge until you remove the **Draft** flag, even if they meet all other merge criteria:

## Mark merge requests as drafts
You can flag a merge request as a draft in several ways:
- Viewing a merge request: In the upper-right corner of the merge request,
select **Merge request actions** ({{< icon name="ellipsis_v" >}}), then **Mark as draft**.
- Creating or editing a merge request: Add `[Draft]`, `Draft:` or `(Draft)` to
the beginning of the merge request's title, or select **Mark as draft**
below the **Title** field.
- Commenting in an existing merge request: Add the `/draft`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
in a comment. To mark a merge request as ready, use `/ready`.
- Creating a commit: Add `draft:`, `Draft:`, `fixup!`, or `Fixup!` to the
beginning of a commit message targeting the merge request's source branch. This
method is not a toggle. Adding this text again in a later commit doesn't mark the
merge request as ready.
## Mark merge requests as ready
When a merge request is ready to merge, you can remove the `Draft` flag in several ways:
- Viewing a merge request: In the upper-right corner of the merge request, select **Mark as ready**.
Users with at least the Developer role
can also scroll to the bottom of the merge request description and select **Mark as ready**.
- Editing an existing merge request: Remove `[Draft]`, `Draft:` or `(Draft)`
from the beginning of the title, or clear **Mark as draft**
below the **Title** field.
- Commenting in an existing merge request: Add the `/ready`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
in a comment in the merge request.
When you mark a merge request as ready, GitLab notifies
[merge request participants and watchers](../../profile/notifications.md#notifications-on-issues-merge-requests-and-epics).
## Include or exclude drafts when searching
When you view or search in your project's merge requests list, to include or exclude
draft merge requests:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. To filter by merge request status, select **Open**, **Merged**, **Closed**,
or **All** in the navigation bar.
1. Select the search box to display a list of filters and select **Draft**, or
enter the word `draft`.
1. Select `=`.
1. Select **Yes** to include drafts, or **No** to exclude, and press **Return**
to update the list of merge requests:

## Pipelines for drafts
Draft merge requests run the same pipelines as merge requests marked as ready.
To skip a pipeline for a draft merge request, see [Skip pipelines for draft merge requests](../../../ci/yaml/workflow.md#skip-pipelines-for-draft-merge-requests).
|
https://docs.gitlab.com/user/project/widgets
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/widgets.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
widgets.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request widgets
|
Merge requests show the results of CI/CD pipelines and mergeability tests in a reports area.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The overview page of a merge request displays status updates from services
that perform actions on your merge request. All subscription levels display a
widgets area, but the content of the area depends on your subscription level
and the services you configure for your project.
## Pipeline information
If you've set up [GitLab CI/CD](../../../ci/_index.md) in your project,
a [merge request](_index.md) displays pipeline information in the widgets area
of the **Overview** tab:
- Both pre-merge and post-merge pipelines, and the environment information, if any.
- Which deployments are in progress.
If an application is successfully deployed to an
[environment](../../../ci/environments/_index.md), the deployed environment and the link to the
[review app](../../../ci/review_apps/_index.md) are both shown.
When the pipeline fails in a merge request but it can still merge,
GitLab shows **Merge** in red.
## Post-merge pipeline status
When you merge a merge request, you can see the post-merge pipeline status of
the branch the merge request merged into. For example, when a merge request
merges into the [default branch](../repository/branches/default.md), and then
triggers a deployment to the staging environment.
GitLab shows ongoing deployments, and the state (deploying or deployed)
for environments. If it's the first deployment of the branch, the link
returns a `404` error until done. During the deployment, GitLab disables the
stop button. If the pipeline fails to deploy, GitLab hides the deployment information.

For more information, [read about pipelines](../../../ci/pipelines/_index.md).
## Set auto-merge
Set a merge request that looks ready to merge to
[merge automatically when CI pipeline succeeds](auto_merge.md).
## Live preview with review apps
Configure [review apps](../../../ci/review_apps/_index.md) for your project
to preview the changes submitted to a feature branch through a merge request
on a per-branch basis. You don't need to check out the branch, install, and preview locally.
All your changes are available to preview by anyone with the review apps link.
With GitLab [Route Maps](../../../ci/review_apps/_index.md#route-maps) set, the
merge request widget takes you directly to the pages changed, making it easier and
faster to preview proposed modifications.
[Read more about review apps](../../../ci/review_apps/_index.md).
## License compliance
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To view a list of licenses that detected for your project's dependencies,
configure [License Compliance](../../compliance/license_scanning_of_cyclonedx_files/_index.md)
for your project.

## External status checks
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you have configured [external status checks](status_checks.md) you can
see the status of these checks in merge requests
[in a specific widget](status_checks.md#status-checks-widget).
## Application security scanning
If you enable any application security scanning tools, GitLab shows the results in the security
scanning widget. For more information, see
[security scanning output in merge request widget](../../application_security/detect/security_scanning_results.md).
{{< alert type="note" >}}
The results of security scans that run in [child pipelines](../../../ci/pipelines/downstream_pipelines.md#parent-child-pipelines)
do not display in the security scanning widget. Support for this is proposed in [epic 18377](https://gitlab.com/groups/gitlab-org/-/epics/18377).
If you want security scan results to display in the widget, run the scanning jobs in the parent pipeline.
{{< /alert >}}
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Merge requests show the results of CI/CD pipelines and mergeability tests
in a reports area.
title: Merge request widgets
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The overview page of a merge request displays status updates from services
that perform actions on your merge request. All subscription levels display a
widgets area, but the content of the area depends on your subscription level
and the services you configure for your project.
## Pipeline information
If you've set up [GitLab CI/CD](../../../ci/_index.md) in your project,
a [merge request](_index.md) displays pipeline information in the widgets area
of the **Overview** tab:
- Both pre-merge and post-merge pipelines, and the environment information, if any.
- Which deployments are in progress.
If an application is successfully deployed to an
[environment](../../../ci/environments/_index.md), the deployed environment and the link to the
[review app](../../../ci/review_apps/_index.md) are both shown.
When the pipeline fails in a merge request but it can still merge,
GitLab shows **Merge** in red.
## Post-merge pipeline status
When you merge a merge request, you can see the post-merge pipeline status of
the branch the merge request merged into. For example, when a merge request
merges into the [default branch](../repository/branches/default.md), and then
triggers a deployment to the staging environment.
GitLab shows ongoing deployments, and the state (deploying or deployed)
for environments. If it's the first deployment of the branch, the link
returns a `404` error until done. During the deployment, GitLab disables the
stop button. If the pipeline fails to deploy, GitLab hides the deployment information.

For more information, [read about pipelines](../../../ci/pipelines/_index.md).
## Set auto-merge
Set a merge request that looks ready to merge to
[merge automatically when CI pipeline succeeds](auto_merge.md).
## Live preview with review apps
Configure [review apps](../../../ci/review_apps/_index.md) for your project
to preview the changes submitted to a feature branch through a merge request
on a per-branch basis. You don't need to check out the branch, install, and preview locally.
All your changes are available to preview by anyone with the review apps link.
With GitLab [Route Maps](../../../ci/review_apps/_index.md#route-maps) set, the
merge request widget takes you directly to the pages changed, making it easier and
faster to preview proposed modifications.
[Read more about review apps](../../../ci/review_apps/_index.md).
## License compliance
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To view a list of licenses that detected for your project's dependencies,
configure [License Compliance](../../compliance/license_scanning_of_cyclonedx_files/_index.md)
for your project.

## External status checks
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you have configured [external status checks](status_checks.md) you can
see the status of these checks in merge requests
[in a specific widget](status_checks.md#status-checks-widget).
## Application security scanning
If you enable any application security scanning tools, GitLab shows the results in the security
scanning widget. For more information, see
[security scanning output in merge request widget](../../application_security/detect/security_scanning_results.md).
{{< alert type="note" >}}
The results of security scans that run in [child pipelines](../../../ci/pipelines/downstream_pipelines.md#parent-child-pipelines)
do not display in the security scanning widget. Support for this is proposed in [epic 18377](https://gitlab.com/groups/gitlab-org/-/epics/18377).
If you want security scan results to display in the widget, run the scanning jobs in the parent pipeline.
{{< /alert >}}
|
https://docs.gitlab.com/user/project/conflicts
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/conflicts.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
conflicts.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge conflicts
|
Understand merge conflicts, and learn how to fix them in Git projects.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Merge conflicts occur when two branches in a merge request, the source and target,
have different changes to the same lines of code. In most cases, GitLab can merge changes together,
but when conflicts arise, you must decide which changes to keep.

To resolve a merge request with conflicts, you must either:
- Create a merge commit.
- Resolve the conflict through a rebase.
GitLab resolves conflicts by creating a merge commit in the source branch without merging it
into the target branch. You can then review and test the merge commit to verify it contains
no unintended changes and doesn't break your build.
## Understand conflict blocks
When Git detects a conflict that requires a decision on your part, it marks the
beginning and end of the conflict block with conflict markers:
- `<<<<<<< HEAD` marks the beginning of the conflict block.
- Your changes are shown.
- `=======` marks the end of your changes.
- The latest changes in the target branch are shown.
- `>>>>>>>` marks the end of the conflict.
To resolve a conflict, delete:
1. The version of the conflicted lines you don't want to keep.
1. The three conflict markers: the beginning, the end, and the `=======` line between
the two versions.
## Conflicts you can resolve in the user interface
You can resolve merge conflicts in the GitLab UI if the conflicting file:
- Is a non binary text file.
- Is less than 200 KB in size with conflict markers added.
- Uses UTF-8 compatible encoding.
- Doesn't contain conflict markers.
- Exists under the same path in both branches.
If a file doesn't meet these criteria, you must resolve the conflict manually.
## Conflict resolution methods
GitLab shows [conflicts available for resolution](#conflicts-you-can-resolve-in-the-user-interface)
in the user interface, and you can also resolve conflicts using the following methods:
- Interactive mode: Best for conflicts where you only need to select which version of a line to keep.
- Inline editor: Suitable for complex conflicts requiring manual edits to blend changes.
- Command line: Provides complete control over complex conflicts. For more information, see [Resolve conflicts from the command line](../../../topics/git/git_rebase.md#resolve-conflicts-from-the-command-line).
### Interactive mode
Interactive mode merges the target branch into the source branch with your chosen changes.
To resolve merge conflicts with interactive mode:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request.
1. Select **Overview**, and scroll to the merge request reports section.
1. Find the merge conflicts message, and select **Resolve conflicts**.
GitLab shows a list of files with merge conflicts. The lines that conflict are
highlighted.
1. For each conflict, select **Use ours** or **Use theirs** to mark the version
of the conflicted lines you want to keep. This decision is known as
"resolving the conflict."
1. When you've resolved all the conflicts, enter a **Commit message**.
1. Select **Commit to source branch**.
### Inline editor
Some merge conflicts are more complex, and you must manually edit lines to
resolve them.
The merge conflict resolution editor helps you resolve these conflicts in GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request.
1. Select **Overview**, and scroll to the merge request reports section.
1. Find the merge conflicts message, and select **Resolve conflicts**.
GitLab shows a list of files with merge conflicts.
1. Find the file to edit manually, and scroll to the conflict block.
1. In the header for that file, select **Edit inline** to open the editor. In this
example, the conflict block begins at line 1350 and ends at line 1356:

1. After you resolve the conflict, enter a **Commit message**.
1. Select **Commit to source branch**.
## Rebase
If your merge request is stuck with a `Checking ability to merge automatically`
message, you can:
- In a comment in the merge request, run the `/rebase` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
- In the merge widget, select **Rebase source branch**.
- [Rebase with Git](../../../topics/git/git_rebase.md#rebase).
To troubleshoot CI/CD pipeline issues, see [Debugging CI/CD pipelines](../../../ci/debugging.md).
### Rebase in the GitLab UI
To trigger a rebase from the GitLab UI, use the `/rebase` [quick action](../quick_actions.md), or the
rebase option in the merge request widget.
Prerequisites:
- No merge conflicts exist.
- You must have at least the [Developer role](../../permissions.md) for the source project.
- If the merge request is in a fork, the fork must allow commits
[from members of the upstream project](allow_collaboration.md).
To rebase a merge request's branch from the GitLab UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request.
1. Either:
- On the **Overview** tab, scroll to the merge request widget and select **Rebase source branch**.
- In a comment, enter `/rebase` and select **Comment**.
GitLab schedules, then runs, a rebase of the branch against the default branch.
GitLab shows the completed rebase as a system note.
{{< alert type="note" >}}
If you have configured commit signing for commits made
through the GitLab UI, web commits lose their commit signatures
[when rebased through the UI](../repository/signed_commits/web_commits.md#web-commits-become-unsigned-after-rebase).
{{< /alert >}}
## Related topics
- [Rebase and resolve conflicts](../../../topics/git/git_rebase.md)
- [Introduction to Git rebase and force-push](../../../topics/git/git_rebase.md)
- [Git applications for visualizing the Git workflow](https://git-scm.com/downloads/guis)
- [Automatic conflict resolution with `git rerere`](https://git-scm.com/book/en/v2/Git-Tools-Rerere)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Understand merge conflicts, and learn how to fix them in Git projects.
title: Merge conflicts
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Merge conflicts occur when two branches in a merge request, the source and target,
have different changes to the same lines of code. In most cases, GitLab can merge changes together,
but when conflicts arise, you must decide which changes to keep.

To resolve a merge request with conflicts, you must either:
- Create a merge commit.
- Resolve the conflict through a rebase.
GitLab resolves conflicts by creating a merge commit in the source branch without merging it
into the target branch. You can then review and test the merge commit to verify it contains
no unintended changes and doesn't break your build.
## Understand conflict blocks
When Git detects a conflict that requires a decision on your part, it marks the
beginning and end of the conflict block with conflict markers:
- `<<<<<<< HEAD` marks the beginning of the conflict block.
- Your changes are shown.
- `=======` marks the end of your changes.
- The latest changes in the target branch are shown.
- `>>>>>>>` marks the end of the conflict.
To resolve a conflict, delete:
1. The version of the conflicted lines you don't want to keep.
1. The three conflict markers: the beginning, the end, and the `=======` line between
the two versions.
## Conflicts you can resolve in the user interface
You can resolve merge conflicts in the GitLab UI if the conflicting file:
- Is a non binary text file.
- Is less than 200 KB in size with conflict markers added.
- Uses UTF-8 compatible encoding.
- Doesn't contain conflict markers.
- Exists under the same path in both branches.
If a file doesn't meet these criteria, you must resolve the conflict manually.
## Conflict resolution methods
GitLab shows [conflicts available for resolution](#conflicts-you-can-resolve-in-the-user-interface)
in the user interface, and you can also resolve conflicts using the following methods:
- Interactive mode: Best for conflicts where you only need to select which version of a line to keep.
- Inline editor: Suitable for complex conflicts requiring manual edits to blend changes.
- Command line: Provides complete control over complex conflicts. For more information, see [Resolve conflicts from the command line](../../../topics/git/git_rebase.md#resolve-conflicts-from-the-command-line).
### Interactive mode
Interactive mode merges the target branch into the source branch with your chosen changes.
To resolve merge conflicts with interactive mode:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request.
1. Select **Overview**, and scroll to the merge request reports section.
1. Find the merge conflicts message, and select **Resolve conflicts**.
GitLab shows a list of files with merge conflicts. The lines that conflict are
highlighted.
1. For each conflict, select **Use ours** or **Use theirs** to mark the version
of the conflicted lines you want to keep. This decision is known as
"resolving the conflict."
1. When you've resolved all the conflicts, enter a **Commit message**.
1. Select **Commit to source branch**.
### Inline editor
Some merge conflicts are more complex, and you must manually edit lines to
resolve them.
The merge conflict resolution editor helps you resolve these conflicts in GitLab:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request.
1. Select **Overview**, and scroll to the merge request reports section.
1. Find the merge conflicts message, and select **Resolve conflicts**.
GitLab shows a list of files with merge conflicts.
1. Find the file to edit manually, and scroll to the conflict block.
1. In the header for that file, select **Edit inline** to open the editor. In this
example, the conflict block begins at line 1350 and ends at line 1356:

1. After you resolve the conflict, enter a **Commit message**.
1. Select **Commit to source branch**.
## Rebase
If your merge request is stuck with a `Checking ability to merge automatically`
message, you can:
- In a comment in the merge request, run the `/rebase` [quick action](../quick_actions.md#issues-merge-requests-and-epics).
- In the merge widget, select **Rebase source branch**.
- [Rebase with Git](../../../topics/git/git_rebase.md#rebase).
To troubleshoot CI/CD pipeline issues, see [Debugging CI/CD pipelines](../../../ci/debugging.md).
### Rebase in the GitLab UI
To trigger a rebase from the GitLab UI, use the `/rebase` [quick action](../quick_actions.md), or the
rebase option in the merge request widget.
Prerequisites:
- No merge conflicts exist.
- You must have at least the [Developer role](../../permissions.md) for the source project.
- If the merge request is in a fork, the fork must allow commits
[from members of the upstream project](allow_collaboration.md).
To rebase a merge request's branch from the GitLab UI:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request.
1. Either:
- On the **Overview** tab, scroll to the merge request widget and select **Rebase source branch**.
- In a comment, enter `/rebase` and select **Comment**.
GitLab schedules, then runs, a rebase of the branch against the default branch.
GitLab shows the completed rebase as a system note.
{{< alert type="note" >}}
If you have configured commit signing for commits made
through the GitLab UI, web commits lose their commit signatures
[when rebased through the UI](../repository/signed_commits/web_commits.md#web-commits-become-unsigned-after-rebase).
{{< /alert >}}
## Related topics
- [Rebase and resolve conflicts](../../../topics/git/git_rebase.md)
- [Introduction to Git rebase and force-push](../../../topics/git/git_rebase.md)
- [Git applications for visualizing the Git workflow](https://git-scm.com/downloads/guis)
- [Automatic conflict resolution with `git rerere`](https://git-scm.com/book/en/v2/Git-Tools-Rerere)
|
https://docs.gitlab.com/user/project/authorization_for_merge_requests
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/authorization_for_merge_requests.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
authorization_for_merge_requests.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request workflows
|
The most common merge request flows in GitLab use forks, protected branches, or both.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab merge requests commonly follow one of these flows:
- Working with [protected branches](../repository/branches/protected.md) in a single repository.
- Working with forks of an authoritative project.
## Protected branch flow
With the protected branch flow, everybody works in the same GitLab project, instead of forks.
The project maintainers get the Maintainer role and the regular developers
get the Developer role.
Maintainers mark the authoritative branches as 'Protected'.
Developers push feature branches to the project and create merge requests
to have their feature branches reviewed and merged into one of the protected
branches.
By default, only users with the Maintainer role can merge changes into a
protected branch.
- Advantages:
- Fewer projects means less clutter.
- Developers need to consider only one remote repository.
- Disadvantages:
- Manual setup of protected branch required for each new project
To set up a protected branch flow:
1. Start with ensuring that your default branch is protected with [default branch protections](../repository/branches/default.md).
1. If your team has multiple branches, and you would like to manage who can merge changes and who
explicitly has the option to push or force push, consider making those branches protected:
- [Manage and Protect Branches](../repository/branches/_index.md#manage-and-protect-branches)
- [Protected Branches](../repository/branches/protected.md)
1. Each change to the code comes through as a commit.
You can specify the format and security measures such as requiring SSH key signing for changes
coming into your codebase with push rules:
- [Push rules](../repository/push_rules.md)
1. To ensure that the code is reviewed and checked by the right people in your team, use:
- [Code Owners](../codeowners/_index.md)
- [Merge request approval rules](approvals/rules.md)
Also available in the Ultimate tier:
- [Status checks](status_checks.md)
- [Security Approvals](approvals/rules.md#security-approvals)
## Forking workflow
With the forking workflow, maintainers get the Maintainer role and regular
developers get the Reporter role on the authoritative repository, which prohibits
them from pushing any changes to it.
Developers create forks of the authoritative project and push their feature
branches to their own forks.
To get their changes into the default branch, they need to create a merge request across
forks.
- Advantages:
- In an appropriately configured GitLab group, new projects automatically get
the required access restrictions for regular developers: fewer manual steps
to configure authorization for new projects.
- Disadvantages:
- The project need to keep their forks up to date, which requires more advanced
Git skills (managing multiple remotes).
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: The most common merge request flows in GitLab use forks, protected branches,
or both.
title: Merge request workflows
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab merge requests commonly follow one of these flows:
- Working with [protected branches](../repository/branches/protected.md) in a single repository.
- Working with forks of an authoritative project.
## Protected branch flow
With the protected branch flow, everybody works in the same GitLab project, instead of forks.
The project maintainers get the Maintainer role and the regular developers
get the Developer role.
Maintainers mark the authoritative branches as 'Protected'.
Developers push feature branches to the project and create merge requests
to have their feature branches reviewed and merged into one of the protected
branches.
By default, only users with the Maintainer role can merge changes into a
protected branch.
- Advantages:
- Fewer projects means less clutter.
- Developers need to consider only one remote repository.
- Disadvantages:
- Manual setup of protected branch required for each new project
To set up a protected branch flow:
1. Start with ensuring that your default branch is protected with [default branch protections](../repository/branches/default.md).
1. If your team has multiple branches, and you would like to manage who can merge changes and who
explicitly has the option to push or force push, consider making those branches protected:
- [Manage and Protect Branches](../repository/branches/_index.md#manage-and-protect-branches)
- [Protected Branches](../repository/branches/protected.md)
1. Each change to the code comes through as a commit.
You can specify the format and security measures such as requiring SSH key signing for changes
coming into your codebase with push rules:
- [Push rules](../repository/push_rules.md)
1. To ensure that the code is reviewed and checked by the right people in your team, use:
- [Code Owners](../codeowners/_index.md)
- [Merge request approval rules](approvals/rules.md)
Also available in the Ultimate tier:
- [Status checks](status_checks.md)
- [Security Approvals](approvals/rules.md#security-approvals)
## Forking workflow
With the forking workflow, maintainers get the Maintainer role and regular
developers get the Reporter role on the authoritative repository, which prohibits
them from pushing any changes to it.
Developers create forks of the authoritative project and push their feature
branches to their own forks.
To get their changes into the default branch, they need to create a merge request across
forks.
- Advantages:
- In an appropriately configured GitLab group, new projects automatically get
the required access restrictions for regular developers: fewer manual steps
to configure authorization for new projects.
- Disadvantages:
- The project need to keep their forks up to date, which requires more advanced
Git skills (managing multiple remotes).
|
https://docs.gitlab.com/user/project/duo_in_merge_requests
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/duo_in_merge_requests.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
duo_in_merge_requests.md
|
Create
|
Code Creation
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo in merge requests
|
Use AI-assisted features for relevant information about a merge request.
|
{{< alert type="disclaimer" />}}
GitLab Duo is designed to provide contextually relevant information during the lifecycle of a merge request.
## Generate a description by summarizing code changes
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com, GitLab Self-Managed
- Status: Beta
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10401) in GitLab 16.2 as an [experiment](../../../policy/development_stages_support.md#experiment).
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/429882) to beta in GitLab 16.10.
- Changed to require GitLab Duo add-on in GitLab 17.6 and later.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186862) to Claude 3.7 Sonnet in GitLab 17.10
- Feature flag `add_ai_summary_for_new_mr` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186108) in GitLab 17.11.
- Changed to include Premium in GitLab 18.0.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193208) to Claude 4.0 Sonnet in GitLab 18.1.
{{< /history >}}
When you create or edit a merge request, use GitLab Duo Merge Request Summary
to create a merge request description.
1. [Create a new merge request](creating_merge_requests.md).
1. In the **Description** field, put your cursor where you want to insert the description.
1. On the toolbar above the text area, select **Summarize code changes** ({{< icon name="tanuki-ai" >}}).

The description is inserted where your cursor was.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=CKjkVsfyFd8&list=PLFGfElNsQthZGazU1ZdfDpegu0HflunXW)
Provide feedback on this feature in [issue 443236](https://gitlab.com/gitlab-org/gitlab/-/issues/443236).
Data usage: The diff of changes between the source branch's head and the target branch is sent to the large language model.
## Have GitLab Duo review your code
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/14825) in GitLab 17.5 as an [experiment](../../../policy/development_stages_support.md#experiment) behind two feature flags named [`ai_review_merge_request`](https://gitlab.com/gitlab-org/gitlab/-/issues/456106) and [`duo_code_review_chat`](https://gitlab.com/gitlab-org/gitlab/-/issues/508632), both disabled by default.
- Feature flags [`ai_review_merge_request`](https://gitlab.com/gitlab-org/gitlab/-/issues/456106) and [`duo_code_review_chat`](https://gitlab.com/gitlab-org/gitlab/-/issues/508632) enabled by default on GitLab.com, GitLab Self-Managed, and GitLab Dedicated in 17.10.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/516234) to beta in GitLab 17.10.
- Changed to include Premium in GitLab 18.0.
- Feature flag `ai_review_merge_request` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/190639) in GitLab 18.1.
- Feature flag `duo_code_review_chat` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/190640) in GitLab 18.1.
- Generally available in GitLab 18.1.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/524929) to be available on GitLab Duo with self-hosted models in beta in GitLab 18.3.
{{< /history >}}
When your merge request is ready to be reviewed, use GitLab Duo Code Review to perform an initial review:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In a comment box, enter the quick action `/assign_reviewer @GitLabDuo`, or assign GitLab Duo as reviewer.
{{< alert type="note" >}}
Provide feedback on this feature in issue [517386](https://gitlab.com/gitlab-org/gitlab/-/issues/517386).
{{< /alert >}}
Data usage: When you use this feature, the following data is sent to the large language model:
- Contents of the changed files
- Filenames
- Merge request title
- Merge request description
### Interact with GitLab Duo in reviews
You can mention `@GitLabDuo` in comments to interact with GitLab Duo on your merge request. You can ask follow-up questions on its review comments, or ask questions on any discussion thread in your merge request.
Interactions with GitLab Duo can help to improve the suggestions and feedback as you work to improve your merge request.
### Automatic reviews from GitLab Duo
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/506537) to a UI setting in GitLab 18.0.
{{< /history >}}
Automatic reviews from GitLab Duo ensure that all merge requests in your project receive an initial review.
After a merge request is created, GitLab Duo reviews it unless:
- It's marked as draft. For GitLab Duo to review the merge request, mark it ready.
- It contains no changes. For GitLab Duo to review the merge request, add changes to it.
Prerequisites:
- You must have at least the [Maintainer role](../../permissions.md) in a project.
To enable `@GitLabDuo` to automatically review merge requests:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **GitLab Duo Code Review** section, select **Enable automatic reviews by GitLab Duo**.
1. Select **Save changes**.
### Customize instructions for GitLab Duo Code Review
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/545136) in GitLab 18.2 as a [beta](../../../policy/development_stages_support.md#beta) [with a flag](../../../administration/feature_flags/_index.md) named `duo_code_review_custom_instructions`. Disabled by default.
- Feature flag `duo_code_review_custom_instructions` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/199802) in GitLab 18.3.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
GitLab Duo Code Review can help ensure consistent code review standards in your project.
Define a glob pattern for files, and create custom instructions for files matching that
pattern. For example, enforce Ruby style conventions only on Ruby files, and Go style
conventions on Go files. GitLab Duo appends your custom instructions to its standard review
criteria.
To configure custom instructions:
1. In the root of your repository, create a `.gitlab/duo` directory if it doesn't already exist.
1. In the `.gitlab/duo` directory, create a file named `mr-review-instructions.yaml`.
1. Add your custom instructions using this format:
```yaml
instructions:
- name: <instruction_group_name>
fileFilters:
- <glob_pattern_1>
- <glob_pattern_2>
- !<exclude_pattern> # Exclude files matching this pattern
instructions: |
<your_custom_review_instructions>
```
For example:
```yaml
instructions:
- name: Ruby Style Guide
fileFilters:
- "*.rb"
- "lib/**/*.rb"
- "!spec/**/*.rb" # Exclude test files
instructions: |
1. Ensure all methods have proper documentation
2. Follow Ruby style guide conventions
3. Prefer symbols over strings for hash keys
- name: TypeScript Source Files
fileFilters:
- "**/*.ts"
- "!**/*.test.ts" # Exclude test files
- "!**/*.spec.ts" # Exclude spec files
instructions: |
1. Ensure proper TypeScript types (avoid 'any')
2. Follow naming conventions
3. Document complex functions
- name: All Files Except Tests
fileFilters:
- "!**/*.test.*" # Exclude all test files
- "!**/*.spec.*" # Exclude all spec files
- "!test/**/*" # Exclude test directories
- "!spec/**/*" # Exclude spec directories
instructions: |
1. Follow consistent code style
2. Add meaningful comments for complex logic
3. Ensure proper error handling
- name: Test Coverage
fileFilters:
- "spec/**/*_spec.rb"
instructions: |
1. Test both happy paths and edge cases
2. Include error scenarios
3. Use shared examples to reduce duplication
```
### Customized code review comments
When GitLab Duo Code Review generates code review comments based on your custom instructions, they follow this format:
```plaintext
According to custom instructions in '[instruction_name]': [specific feedback]
```
For example:
```plaintext
According to custom instructions in 'Ruby Style Guide': This method should have proper documentation explaining its purpose and parameters.
```
The `instruction_name` value corresponds to the `name` property from your `.gitlab/duo/mr-review-instructions.yaml` file. Standard GitLab Duo comments don't use this citation format.
## Summarize a code review
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10466) in GitLab 16.0 as an [experiment](../../../policy/development_stages_support.md#experiment).
- Feature flag `summarize_my_code_review` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/182448) in GitLab 17.10.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183873) to Claude 3.7 Sonnet in GitLab 17.11.
- Changed to include Premium in GitLab 18.0.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193685) to Claude 4.0 Sonnet in GitLab 18.1.
{{< /history >}}
When you've completed your review of a merge request and are ready to [submit your review](reviews/_index.md#submit-a-review), use GitLab Duo Code Review Summary to generate a summary of your comments.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request you want to review.
1. When you are ready to submit your review, select **Finish review**.
1. Select **Add Summary**.
The summary is displayed in the comment box. You can edit and refine the summary before you submit your review.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=Bx6Zajyuy9k)
Provide feedback on this experimental feature in [issue 408991](https://gitlab.com/gitlab-org/gitlab/-/issues/408991).
Data usage: When you use this feature, the following data is sent to the large language model:
- Draft comment's text
## Generate a merge commit message
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise, GitLab Duo with Amazon Q
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- LLM for Amazon Q: Amazon Q Developer
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10453) in GitLab 16.2 as an [experiment](../../../policy/development_stages_support.md#experiment) [with a flag](../../../administration/feature_flags/_index.md) named `generate_commit_message_flag`. Disabled by default.
- Feature flag `generate_commit_message_flag` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158339) in GitLab 17.2.
- Feature flag `generate_commit_message_flag` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173262) in GitLab 17.7.
- Changed to include Premium in GitLab 18.0.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193793) to Claude 4.0 Sonnet in GitLab 18.1.
- Changed to support Amazon Q in GitLab 18.3.
{{< /history >}}
When preparing to merge your merge request, edit the proposed merge commit message
by using GitLab Duo Merge Commit Message Generation.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the **Edit commit message** checkbox on the merge widget.
1. Select **Generate commit message**.
1. Review the commit message provided and choose **Insert** to add it to the commit.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=fUHPNT4uByQ)
Data usage: When you use this feature, the following data is sent to the large language model:
- Contents of the file
- The filename
## Related topics
- [Control GitLab Duo availability](../../gitlab_duo/turn_on_off.md)
- [All GitLab Duo features](../../gitlab_duo/_index.md)
|
---
stage: Create
group: Code Creation
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use AI-assisted features for relevant information about a merge request.
title: GitLab Duo in merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< alert type="disclaimer" />}}
GitLab Duo is designed to provide contextually relevant information during the lifecycle of a merge request.
## Generate a description by summarizing code changes
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com, GitLab Self-Managed
- Status: Beta
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10401) in GitLab 16.2 as an [experiment](../../../policy/development_stages_support.md#experiment).
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/429882) to beta in GitLab 16.10.
- Changed to require GitLab Duo add-on in GitLab 17.6 and later.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186862) to Claude 3.7 Sonnet in GitLab 17.10
- Feature flag `add_ai_summary_for_new_mr` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186108) in GitLab 17.11.
- Changed to include Premium in GitLab 18.0.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193208) to Claude 4.0 Sonnet in GitLab 18.1.
{{< /history >}}
When you create or edit a merge request, use GitLab Duo Merge Request Summary
to create a merge request description.
1. [Create a new merge request](creating_merge_requests.md).
1. In the **Description** field, put your cursor where you want to insert the description.
1. On the toolbar above the text area, select **Summarize code changes** ({{< icon name="tanuki-ai" >}}).

The description is inserted where your cursor was.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=CKjkVsfyFd8&list=PLFGfElNsQthZGazU1ZdfDpegu0HflunXW)
Provide feedback on this feature in [issue 443236](https://gitlab.com/gitlab-org/gitlab/-/issues/443236).
Data usage: The diff of changes between the source branch's head and the target branch is sent to the large language model.
## Have GitLab Duo review your code
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/14825) in GitLab 17.5 as an [experiment](../../../policy/development_stages_support.md#experiment) behind two feature flags named [`ai_review_merge_request`](https://gitlab.com/gitlab-org/gitlab/-/issues/456106) and [`duo_code_review_chat`](https://gitlab.com/gitlab-org/gitlab/-/issues/508632), both disabled by default.
- Feature flags [`ai_review_merge_request`](https://gitlab.com/gitlab-org/gitlab/-/issues/456106) and [`duo_code_review_chat`](https://gitlab.com/gitlab-org/gitlab/-/issues/508632) enabled by default on GitLab.com, GitLab Self-Managed, and GitLab Dedicated in 17.10.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/516234) to beta in GitLab 17.10.
- Changed to include Premium in GitLab 18.0.
- Feature flag `ai_review_merge_request` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/190639) in GitLab 18.1.
- Feature flag `duo_code_review_chat` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/190640) in GitLab 18.1.
- Generally available in GitLab 18.1.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/524929) to be available on GitLab Duo with self-hosted models in beta in GitLab 18.3.
{{< /history >}}
When your merge request is ready to be reviewed, use GitLab Duo Code Review to perform an initial review:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. In a comment box, enter the quick action `/assign_reviewer @GitLabDuo`, or assign GitLab Duo as reviewer.
{{< alert type="note" >}}
Provide feedback on this feature in issue [517386](https://gitlab.com/gitlab-org/gitlab/-/issues/517386).
{{< /alert >}}
Data usage: When you use this feature, the following data is sent to the large language model:
- Contents of the changed files
- Filenames
- Merge request title
- Merge request description
### Interact with GitLab Duo in reviews
You can mention `@GitLabDuo` in comments to interact with GitLab Duo on your merge request. You can ask follow-up questions on its review comments, or ask questions on any discussion thread in your merge request.
Interactions with GitLab Duo can help to improve the suggestions and feedback as you work to improve your merge request.
### Automatic reviews from GitLab Duo
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/506537) to a UI setting in GitLab 18.0.
{{< /history >}}
Automatic reviews from GitLab Duo ensure that all merge requests in your project receive an initial review.
After a merge request is created, GitLab Duo reviews it unless:
- It's marked as draft. For GitLab Duo to review the merge request, mark it ready.
- It contains no changes. For GitLab Duo to review the merge request, add changes to it.
Prerequisites:
- You must have at least the [Maintainer role](../../permissions.md) in a project.
To enable `@GitLabDuo` to automatically review merge requests:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **GitLab Duo Code Review** section, select **Enable automatic reviews by GitLab Duo**.
1. Select **Save changes**.
### Customize instructions for GitLab Duo Code Review
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/545136) in GitLab 18.2 as a [beta](../../../policy/development_stages_support.md#beta) [with a flag](../../../administration/feature_flags/_index.md) named `duo_code_review_custom_instructions`. Disabled by default.
- Feature flag `duo_code_review_custom_instructions` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/199802) in GitLab 18.3.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
GitLab Duo Code Review can help ensure consistent code review standards in your project.
Define a glob pattern for files, and create custom instructions for files matching that
pattern. For example, enforce Ruby style conventions only on Ruby files, and Go style
conventions on Go files. GitLab Duo appends your custom instructions to its standard review
criteria.
To configure custom instructions:
1. In the root of your repository, create a `.gitlab/duo` directory if it doesn't already exist.
1. In the `.gitlab/duo` directory, create a file named `mr-review-instructions.yaml`.
1. Add your custom instructions using this format:
```yaml
instructions:
- name: <instruction_group_name>
fileFilters:
- <glob_pattern_1>
- <glob_pattern_2>
- !<exclude_pattern> # Exclude files matching this pattern
instructions: |
<your_custom_review_instructions>
```
For example:
```yaml
instructions:
- name: Ruby Style Guide
fileFilters:
- "*.rb"
- "lib/**/*.rb"
- "!spec/**/*.rb" # Exclude test files
instructions: |
1. Ensure all methods have proper documentation
2. Follow Ruby style guide conventions
3. Prefer symbols over strings for hash keys
- name: TypeScript Source Files
fileFilters:
- "**/*.ts"
- "!**/*.test.ts" # Exclude test files
- "!**/*.spec.ts" # Exclude spec files
instructions: |
1. Ensure proper TypeScript types (avoid 'any')
2. Follow naming conventions
3. Document complex functions
- name: All Files Except Tests
fileFilters:
- "!**/*.test.*" # Exclude all test files
- "!**/*.spec.*" # Exclude all spec files
- "!test/**/*" # Exclude test directories
- "!spec/**/*" # Exclude spec directories
instructions: |
1. Follow consistent code style
2. Add meaningful comments for complex logic
3. Ensure proper error handling
- name: Test Coverage
fileFilters:
- "spec/**/*_spec.rb"
instructions: |
1. Test both happy paths and edge cases
2. Include error scenarios
3. Use shared examples to reduce duplication
```
### Customized code review comments
When GitLab Duo Code Review generates code review comments based on your custom instructions, they follow this format:
```plaintext
According to custom instructions in '[instruction_name]': [specific feedback]
```
For example:
```plaintext
According to custom instructions in 'Ruby Style Guide': This method should have proper documentation explaining its purpose and parameters.
```
The `instruction_name` value corresponds to the `name` property from your `.gitlab/duo/mr-review-instructions.yaml` file. Standard GitLab Duo comments don't use this citation format.
## Summarize a code review
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10466) in GitLab 16.0 as an [experiment](../../../policy/development_stages_support.md#experiment).
- Feature flag `summarize_my_code_review` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/182448) in GitLab 17.10.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183873) to Claude 3.7 Sonnet in GitLab 17.11.
- Changed to include Premium in GitLab 18.0.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193685) to Claude 4.0 Sonnet in GitLab 18.1.
{{< /history >}}
When you've completed your review of a merge request and are ready to [submit your review](reviews/_index.md#submit-a-review), use GitLab Duo Code Review Summary to generate a summary of your comments.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request you want to review.
1. When you are ready to submit your review, select **Finish review**.
1. Select **Add Summary**.
The summary is displayed in the comment box. You can edit and refine the summary before you submit your review.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=Bx6Zajyuy9k)
Provide feedback on this experimental feature in [issue 408991](https://gitlab.com/gitlab-org/gitlab/-/issues/408991).
Data usage: When you use this feature, the following data is sent to the large language model:
- Draft comment's text
## Generate a merge commit message
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Enterprise, GitLab Duo with Amazon Q
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic [Claude 4.0 Sonnet](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-sonnet-4)
- LLM for Amazon Q: Amazon Q Developer
- Available on [GitLab Duo with self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md): Yes
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10453) in GitLab 16.2 as an [experiment](../../../policy/development_stages_support.md#experiment) [with a flag](../../../administration/feature_flags/_index.md) named `generate_commit_message_flag`. Disabled by default.
- Feature flag `generate_commit_message_flag` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158339) in GitLab 17.2.
- Feature flag `generate_commit_message_flag` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173262) in GitLab 17.7.
- Changed to include Premium in GitLab 18.0.
- LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193793) to Claude 4.0 Sonnet in GitLab 18.1.
- Changed to support Amazon Q in GitLab 18.3.
{{< /history >}}
When preparing to merge your merge request, edit the proposed merge commit message
by using GitLab Duo Merge Commit Message Generation.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the **Edit commit message** checkbox on the merge widget.
1. Select **Generate commit message**.
1. Review the commit message provided and choose **Insert** to add it to the commit.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch an overview](https://www.youtube.com/watch?v=fUHPNT4uByQ)
Data usage: When you use this feature, the following data is sent to the large language model:
- Contents of the file
- The filename
## Related topics
- [Control GitLab Duo availability](../../gitlab_duo/turn_on_off.md)
- [All GitLab Duo features](../../gitlab_duo/_index.md)
|
https://docs.gitlab.com/user/project/dependencies
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/dependencies.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
dependencies.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request dependencies
|
Set a merge request dependency to control the merge order of merge requests with related or dependent content.
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Support for complex merge dependencies [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11393) in GitLab 16.6 [with a flag](../../../administration/feature_flags/_index.md) named `remove_mr_blocking_constraints`. Disabled by default.
- Support for complex merge dependencies [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136775) in GitLab 16.7. Feature flag `remove_mr_blocking_constraints` removed.
{{< /history >}}
A single feature can span several merge requests, spread out across multiple projects,
and the order in which the work merges can be significant. Use merge request dependencies
when it's important to merge work in a specific order. Some examples:
- Ensure changes to a required library merge before changes to a project that
imports the library.
- Prevent a documentation-only merge request from merging before the feature work
is itself merged.
- Require a merge request updating a permissions matrix to merge, before merging work
from someone who doesn't yet have the correct permissions.
If your project `me/myexample` imports a library from `myfriend/library`,
you should update your project when `myfriend/library` releases a new feature.
If you merge your changes to `me/myexample` before `myfriend/library` adds the
new feature, you would break the default branch in your project. A merge request
dependency prevents your work from merging too soon:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph TB
accTitle: Merge request dependencies
accDescr: Shows how a merge request dependency prevents work from merging too soon.
A['me/myexample' project]
B['myfriend/library' project]
C[Merge request #1:<br>Create new version 2.5]
D[Merge request #2:<br>Add version 2.5<br>to build]
A-->|contains| D
B---->|contains| C
D-.->|depends on| C
C-.->|blocks| D
```
It's possible to mark your `me/myexample` merge request as a [draft](drafts.md)
and explain why in the comments. This approach is manual and does not scale, especially
if your merge request relies on several others in different projects. Instead, you should:
- Track the readiness of an individual merge request with **Draft** or **Ready** status.
- Enforce the order merge requests merge with a merge request dependency.
Merge request dependencies are a feature in GitLab Premium, but GitLab enforces this restriction
only for the dependent merge request:
- A GitLab Premium project's merge request can depend on any other merge request, even in a GitLab Free project.
- A GitLab Free project's merge request cannot depend on other merge requests.
## Nested dependencies
GitLab versions 16.7 and later support indirect, nested dependencies. A merge request can have up to 10 blockers,
and in turn it can block up to 10 other merge requests. In this example, `myfriend/library!10`
depends on `herfriend/another-lib!1`, which in turn depends on `mycorp/example!100`:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR;
accTitle: Merge request dependency chain
accDescr: Flowchart that shows how merge request A depends on merge request B, while merge request B depends on merge request C
A[myfriend/library!10]-->|depends on| B[herfriend/another-lib!1]
B-->|depends on| C[mycorp/example!100]
```
Nested dependencies do not display in the GitLab UI, but UI support is
proposed in [epic 5308](https://gitlab.com/groups/gitlab-org/-/epics/5308).
{{< alert type="note" >}}
A merge request cannot depend on itself (self-referential), but it's possible to create circular dependencies.
{{< /alert >}}
## View dependencies for a merge request
If a merge request is dependent on another, the merge request reports section shows
information about the dependency:

To view dependency information on a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and identify your merge request.
1. Scroll to the merge request reports area. Dependent merge requests display information
about the total number of dependencies set, such as
**Depends on 1 merge request being merged**.
1. Select **Expand** to view the title, milestone, assignee, and pipeline status
of each dependency.
Until your merge request's dependencies all merge, your merge request cannot merge. The message
**Merge blocked: you can only merge after the above items are resolved** displays.
### Closed merge requests
Closed merge requests still prevent their dependents from merging, because a merge request can close
without merging its planned work. If a merge request closes and the dependency is no longer relevant,
remove it as a dependency to unblock the dependent merge request.
## Create a new dependent merge request
When you create a new merge request, you can prevent it from merging until after
other specific work merges. This dependency works even if the merge request is in a different project.
Prerequisites:
- You must have at least the Developer role, or have permission to create merge requests in the project.
- The dependent merge request must be in a project in the Premium or Ultimate tier.
To create a new merge request and mark it as dependent on another:
1. [Create a new merge request](creating_merge_requests.md).
1. In **Merge request dependencies**, paste either the reference or the full URL
to the merge requests that should merge before this work merges. References
are in the form of `path/to/project!merge_request_id`.
1. Select **Create merge request**.
## Edit a merge request to add a dependency
You can edit an existing merge request and mark it as dependent on another.
Prerequisites:
- You must have at least the Developer role or have permission to edit merge requests in the project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and identify your merge request.
1. Select **Edit**.
1. In **Merge request dependencies**, paste either the reference or the full URL
to the merge requests that should merge before this work merges. References
are in the form of `path/to/project!merge_request_id`.
## Remove a dependency from a merge request
You can edit a dependent merge request and remove a dependency.
Prerequisites:
- You must have a role for the project that allows you to edit merge requests.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and identify your merge request.
1. Select **Edit**.
1. Scroll to **Merge request dependencies** and select **Remove** next to the reference
for each dependency you want to remove.
{{< alert type="note" >}}
Merge request dependencies you do not have permission to view are shown as
**1 inaccessible merge request**. You can still remove the dependency.
{{< /alert >}}
1. Select **Save changes**.
## Troubleshooting
### Preserve dependencies on project import or export
Dependencies are not preserved when you import or export a project. For more
information, see [issue #12549](https://gitlab.com/gitlab-org/gitlab/-/issues/12549).
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Set a merge request dependency to control the merge order of merge requests
with related or dependent content.
title: Merge request dependencies
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Support for complex merge dependencies [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11393) in GitLab 16.6 [with a flag](../../../administration/feature_flags/_index.md) named `remove_mr_blocking_constraints`. Disabled by default.
- Support for complex merge dependencies [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136775) in GitLab 16.7. Feature flag `remove_mr_blocking_constraints` removed.
{{< /history >}}
A single feature can span several merge requests, spread out across multiple projects,
and the order in which the work merges can be significant. Use merge request dependencies
when it's important to merge work in a specific order. Some examples:
- Ensure changes to a required library merge before changes to a project that
imports the library.
- Prevent a documentation-only merge request from merging before the feature work
is itself merged.
- Require a merge request updating a permissions matrix to merge, before merging work
from someone who doesn't yet have the correct permissions.
If your project `me/myexample` imports a library from `myfriend/library`,
you should update your project when `myfriend/library` releases a new feature.
If you merge your changes to `me/myexample` before `myfriend/library` adds the
new feature, you would break the default branch in your project. A merge request
dependency prevents your work from merging too soon:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph TB
accTitle: Merge request dependencies
accDescr: Shows how a merge request dependency prevents work from merging too soon.
A['me/myexample' project]
B['myfriend/library' project]
C[Merge request #1:<br>Create new version 2.5]
D[Merge request #2:<br>Add version 2.5<br>to build]
A-->|contains| D
B---->|contains| C
D-.->|depends on| C
C-.->|blocks| D
```
It's possible to mark your `me/myexample` merge request as a [draft](drafts.md)
and explain why in the comments. This approach is manual and does not scale, especially
if your merge request relies on several others in different projects. Instead, you should:
- Track the readiness of an individual merge request with **Draft** or **Ready** status.
- Enforce the order merge requests merge with a merge request dependency.
Merge request dependencies are a feature in GitLab Premium, but GitLab enforces this restriction
only for the dependent merge request:
- A GitLab Premium project's merge request can depend on any other merge request, even in a GitLab Free project.
- A GitLab Free project's merge request cannot depend on other merge requests.
## Nested dependencies
GitLab versions 16.7 and later support indirect, nested dependencies. A merge request can have up to 10 blockers,
and in turn it can block up to 10 other merge requests. In this example, `myfriend/library!10`
depends on `herfriend/another-lib!1`, which in turn depends on `mycorp/example!100`:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR;
accTitle: Merge request dependency chain
accDescr: Flowchart that shows how merge request A depends on merge request B, while merge request B depends on merge request C
A[myfriend/library!10]-->|depends on| B[herfriend/another-lib!1]
B-->|depends on| C[mycorp/example!100]
```
Nested dependencies do not display in the GitLab UI, but UI support is
proposed in [epic 5308](https://gitlab.com/groups/gitlab-org/-/epics/5308).
{{< alert type="note" >}}
A merge request cannot depend on itself (self-referential), but it's possible to create circular dependencies.
{{< /alert >}}
## View dependencies for a merge request
If a merge request is dependent on another, the merge request reports section shows
information about the dependency:

To view dependency information on a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and identify your merge request.
1. Scroll to the merge request reports area. Dependent merge requests display information
about the total number of dependencies set, such as
**Depends on 1 merge request being merged**.
1. Select **Expand** to view the title, milestone, assignee, and pipeline status
of each dependency.
Until your merge request's dependencies all merge, your merge request cannot merge. The message
**Merge blocked: you can only merge after the above items are resolved** displays.
### Closed merge requests
Closed merge requests still prevent their dependents from merging, because a merge request can close
without merging its planned work. If a merge request closes and the dependency is no longer relevant,
remove it as a dependency to unblock the dependent merge request.
## Create a new dependent merge request
When you create a new merge request, you can prevent it from merging until after
other specific work merges. This dependency works even if the merge request is in a different project.
Prerequisites:
- You must have at least the Developer role, or have permission to create merge requests in the project.
- The dependent merge request must be in a project in the Premium or Ultimate tier.
To create a new merge request and mark it as dependent on another:
1. [Create a new merge request](creating_merge_requests.md).
1. In **Merge request dependencies**, paste either the reference or the full URL
to the merge requests that should merge before this work merges. References
are in the form of `path/to/project!merge_request_id`.
1. Select **Create merge request**.
## Edit a merge request to add a dependency
You can edit an existing merge request and mark it as dependent on another.
Prerequisites:
- You must have at least the Developer role or have permission to edit merge requests in the project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and identify your merge request.
1. Select **Edit**.
1. In **Merge request dependencies**, paste either the reference or the full URL
to the merge requests that should merge before this work merges. References
are in the form of `path/to/project!merge_request_id`.
## Remove a dependency from a merge request
You can edit a dependent merge request and remove a dependency.
Prerequisites:
- You must have a role for the project that allows you to edit merge requests.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and identify your merge request.
1. Select **Edit**.
1. Scroll to **Merge request dependencies** and select **Remove** next to the reference
for each dependency you want to remove.
{{< alert type="note" >}}
Merge request dependencies you do not have permission to view are shown as
**1 inaccessible merge request**. You can still remove the dependency.
{{< /alert >}}
1. Select **Save changes**.
## Troubleshooting
### Preserve dependencies on project import or export
Dependencies are not preserved when you import or export a project. For more
information, see [issue #12549](https://gitlab.com/gitlab-org/gitlab/-/issues/12549).
|
https://docs.gitlab.com/user/project/manage
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/manage.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
manage.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Manage merge requests
|
Use merge request reviews to discuss and improve code before it is merged into your project.
|
GitLab provides tools for managing merge requests for your project and group.
## Delete a merge request
In most cases you should close, rather than delete, merge requests.
You cannot undo the deletion of a merge request.
Prerequisites:
- You must have the Owner role for the project.
To delete a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request you want to delete.
1. Select **Edit**.
1. Scroll to the bottom of the page, and select **Delete merge request**.
{{< alert type="note" >}}
Deleting a merge request does not completely erase all data.
Some information persists to maintain project history and to support recovery processes.
For more information, see [Handle sensitive information](../../../topics/git/undo.md#handle-sensitive-information).
{{< /alert >}}
## Bulk edit merge requests in a project
These attributes are editable when bulk editing merge requests:
- Status (open/closed)
- Assignee
- Milestone
- Labels
- Subscriptions
Prerequisites:
- You must have at least the Developer role.
To do this:
1. In a project, go to **Code > Merge requests**.
1. Select **Bulk edit**. A sidebar on the right-hand side of your screen appears with
editable fields.
1. Select the checkboxes next to each merge request you want to edit.
1. Select the appropriate fields and their values from the sidebar.
1. Select **Update selected**.
## Bulk edit merge requests in a group
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
These attributes are editable when you bulk edit merge requests for a group:
- Milestone
- Labels
Prerequisites:
- You must have at least the Developer role for the project.
To update multiple group merge requests at the same time:
1. In a group, go to **Code > Merge requests**.
1. Select **Bulk edit**. A sidebar on the right-hand side of your screen appears with
editable fields.
1. Select the checkboxes next to each merge request you want to edit.
1. Select the appropriate fields and their values from the sidebar.
1. Select **Update selected**.
## Related topics
- [Bulk edit issues](../issues/managing_issues.md#bulk-edit-issues-from-a-group)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use merge request reviews to discuss and improve code before it is merged
into your project.
title: Manage merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
GitLab provides tools for managing merge requests for your project and group.
## Delete a merge request
In most cases you should close, rather than delete, merge requests.
You cannot undo the deletion of a merge request.
Prerequisites:
- You must have the Owner role for the project.
To delete a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find the merge request you want to delete.
1. Select **Edit**.
1. Scroll to the bottom of the page, and select **Delete merge request**.
{{< alert type="note" >}}
Deleting a merge request does not completely erase all data.
Some information persists to maintain project history and to support recovery processes.
For more information, see [Handle sensitive information](../../../topics/git/undo.md#handle-sensitive-information).
{{< /alert >}}
## Bulk edit merge requests in a project
These attributes are editable when bulk editing merge requests:
- Status (open/closed)
- Assignee
- Milestone
- Labels
- Subscriptions
Prerequisites:
- You must have at least the Developer role.
To do this:
1. In a project, go to **Code > Merge requests**.
1. Select **Bulk edit**. A sidebar on the right-hand side of your screen appears with
editable fields.
1. Select the checkboxes next to each merge request you want to edit.
1. Select the appropriate fields and their values from the sidebar.
1. Select **Update selected**.
## Bulk edit merge requests in a group
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
These attributes are editable when you bulk edit merge requests for a group:
- Milestone
- Labels
Prerequisites:
- You must have at least the Developer role for the project.
To update multiple group merge requests at the same time:
1. In a group, go to **Code > Merge requests**.
1. Select **Bulk edit**. A sidebar on the right-hand side of your screen appears with
editable fields.
1. Select the checkboxes next to each merge request you want to edit.
1. Select the appropriate fields and their values from the sidebar.
1. Select **Update selected**.
## Related topics
- [Bulk edit issues](../issues/managing_issues.md#bulk-edit-issues-from-a-group)
|
https://docs.gitlab.com/user/project/merge_request_troubleshooting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_request_troubleshooting.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
merge_request_troubleshooting.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting merge requests
|
Troubleshooting help for merge requests.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When working with merge requests, you might encounter the following issues.
## Merge request cannot retrieve the pipeline status
This can occur if Sidekiq doesn't pick up the changes fast enough.
### Sidekiq
Sidekiq didn't process the CI state change fast enough. Wait a few
seconds and the status should update automatically.
### Pipeline status cannot be retrieved
Merge request pipeline statuses can't be retrieved when the following occurs:
1. A merge request is created
1. The merge request is closed
1. Changes are made in the project
1. The merge request is reopened
To enable the pipeline status to be properly retrieved, close and reopen the
merge request again.
## Rebase a merge request from the Rails console
{{< details >}}
- Tier: Free, Premium, Ultimate
{{< /details >}}
In addition to the `/rebase` [quick action](../quick_actions.md#issues-merge-requests-and-epics),
users with access to the [Rails console](../../../administration/operations/rails_console.md)
can rebase a merge request from the Rails console. Replace `<username>`,
`<namespace/project>`, and `<iid>` with appropriate values:
{{< alert type="warning" >}}
Any command that changes data directly could be damaging if not run correctly,
or under the right conditions. We highly recommend running them in a test environment
with a backup of the instance ready to be restored, just in case.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
MergeRequests::RebaseService.new(project: m.target_project, current_user: u).execute(m)
```
## Fix incorrect merge request status
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If a merge request remains **Open** after its changes are merged,
users with access to the [Rails console](../../../administration/operations/rails_console.md)
can correct the merge request's status. Replace `<username>`, `<namespace/project>`,
and `<iid>` with appropriate values:
{{< alert type="warning" >}}
Any command that changes data directly could be damaging if not run correctly,
or under the right conditions. We highly recommend running them in a test environment
with a backup of the instance ready to be restored, just in case.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
MergeRequests::PostMergeService.new(project: p, current_user: u).execute(m)
```
Running this command against a merge request with unmerged changes causes the
merge request to display an incorrect message: `merged into <branch-name>`.
## Close a merge request from the Rails console
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If closing a merge request doesn't work through the UI or API, try closing it in a
[Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session):
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
MergeRequests::CloseService.new(project: p, current_user: u).execute(m)
```
## Delete a merge request from the Rails console
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If deleting a merge request doesn't work through the UI or API, try deleting it in a
[Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session):
{{< alert type="warning" >}}
Any command that changes data directly could be damaging if not run correctly,
or under the right conditions. We highly recommend running them in a test environment
with a backup of the instance ready to be restored, just in case.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
Issuable::DestroyService.new(container: m.project, current_user: u).execute(m)
```
## Merge request pre-receive hook failed
If a merge request times out, you might see messages that indicate a Puma worker
timeout problem:
- In the GitLab UI:
```plaintext
Something went wrong during merge pre-receive hook.
500 Internal Server Error. Try again.
```
- In the `gitlab-rails/api_json.log` log file:
```plaintext
Rack::Timeout::RequestTimeoutException
Request ran for longer than 60000ms
```
This error can happen if your merge request:
- Contains many diffs.
- Is many commits behind the target branch.
- References a Git LFS file that is locked.
Users on GitLab Self-Managed can request an administrator review server logs
to determine the cause of the error. GitLab SaaS users should
[contact Support](https://about.gitlab.com/support/#contact-support) for help.
## Cached merge request count
In a group, the sidebar displays the total count of open merge requests. This value is cached if it's
greater than 1000. The cached value is rounded to thousands (or millions) and updated every 24 hours.
## Check out merge requests locally through the `head` ref
{{< history >}}
- Deleting `head` refs 14 days after a merge request closes or merges [enabled on GitLab Self-Managed and GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130098) in GitLab 16.4.
- Deleting `head` refs 14 days after a merge request closes or merges [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/336070) in GitLab 16.6. Feature flag `merge_request_refs_cleanup` removed.
{{< /history >}}
A merge request contains all the history from a repository, plus the additional
commits added to the branch associated with the merge request. Here's a few
ways to check out a merge request locally.
You can check out a merge request locally even if the source
project is a fork (even a private fork) of the target project.
This relies on the merge request `head` ref (`refs/merge-requests/:iid/head`)
that is available for each merge request. It allows checking out a merge
request by using its ID instead of its branch.
In GitLab 16.6 and later, the merge request `head` ref is deleted 14 days after
a merge request is closed or merged. The merge request is then no longer available
for local checkout from the merge request `head` ref anymore. The merge request
can still be re-opened. If the merge request's branch
exists, you can still check out the branch, as it isn't affected.
### Check out locally using `glab`
```plaintext
glab mr checkout <merge_request_iid>
```
More information on the [GitLab terminal client](../../../editor_extensions/gitlab_cli/_index.md).
### Check out locally by adding a Git alias
Add the following alias to your `~/.gitconfig`:
```plaintext
[alias]
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
```
Now you can check out a particular merge request from any repository and any
remote. For example, to check out the merge request with ID 5 as shown in GitLab
from the `origin` remote, do:
```shell
git mr origin 5
```
This fetches the merge request into a local `mr-origin-5` branch and check
it out.
### Check out locally by modifying `.git/config` for a given repository
Locate the section for your GitLab remote in the `.git/config` file. It looks
like this:
```plaintext
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-foss.git
fetch = +refs/heads/*:refs/remotes/origin/*
```
You can open the file with:
```shell
git config -e
```
Now add the following line to the previous section:
```plaintext
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
In the end, it should look like this:
```plaintext
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-foss.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
Now you can fetch all the merge requests:
```shell
git fetch origin
...
From https://gitlab.com/gitlab-org/gitlab-foss.git
* [new ref] refs/merge-requests/1/head -> origin/merge-requests/1
* [new ref] refs/merge-requests/2/head -> origin/merge-requests/2
...
```
To check out a particular merge request:
```shell
git checkout origin/merge-requests/1
```
These commands can be also be done with the [`git-mr`](https://gitlab.com/glensc/git-mr) script.
## Error: "source branch `<branch_name>` does not exist." when the branch exists
This error can happen if the GitLab cache does not reflect the actual state of the
Git repository. This can happen if the Git data folder is mounted with `noexec` flag.
Prerequisites:
- You must be an administrator.
To force a cache update:
1. Open the GitLab Rails console with this command:
```shell
sudo gitlab-rails console
```
1. In the Rails console, run this script:
```ruby
# Get the project
project = Project.find_by_full_path('affected/project/path')
# Check if the affected branch exists in cache (it may return `false`)
project.repository.branch_names.include?('affected_branch_name')
# Expire the branches cache
project.repository.expire_branches_cache
# Check again if the affected branch exists in cache (this time it should return `true`)
project.repository.branch_names.include?('affected_branch_name')
```
1. Reload the merge request.
## Approvals reset when automation approves a merge request
If you automate the creation of merge requests, or pushing to them, you might want to build automated
approvals for those merge requests. In GitLab Premium and Ultimate, by default, all approvals are removed
[when commits are added to the source branch](approvals/settings.md#remove-all-approvals-when-commits-are-added-to-the-source-branch).
To avoid this problem, add logic to your automation that ensures
[commits are processed before approving](../../../api/merge_request_approvals.md#approvals-for-automated-merge-requests) the merge request.
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Troubleshooting help for merge requests.
title: Troubleshooting merge requests
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When working with merge requests, you might encounter the following issues.
## Merge request cannot retrieve the pipeline status
This can occur if Sidekiq doesn't pick up the changes fast enough.
### Sidekiq
Sidekiq didn't process the CI state change fast enough. Wait a few
seconds and the status should update automatically.
### Pipeline status cannot be retrieved
Merge request pipeline statuses can't be retrieved when the following occurs:
1. A merge request is created
1. The merge request is closed
1. Changes are made in the project
1. The merge request is reopened
To enable the pipeline status to be properly retrieved, close and reopen the
merge request again.
## Rebase a merge request from the Rails console
{{< details >}}
- Tier: Free, Premium, Ultimate
{{< /details >}}
In addition to the `/rebase` [quick action](../quick_actions.md#issues-merge-requests-and-epics),
users with access to the [Rails console](../../../administration/operations/rails_console.md)
can rebase a merge request from the Rails console. Replace `<username>`,
`<namespace/project>`, and `<iid>` with appropriate values:
{{< alert type="warning" >}}
Any command that changes data directly could be damaging if not run correctly,
or under the right conditions. We highly recommend running them in a test environment
with a backup of the instance ready to be restored, just in case.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
MergeRequests::RebaseService.new(project: m.target_project, current_user: u).execute(m)
```
## Fix incorrect merge request status
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If a merge request remains **Open** after its changes are merged,
users with access to the [Rails console](../../../administration/operations/rails_console.md)
can correct the merge request's status. Replace `<username>`, `<namespace/project>`,
and `<iid>` with appropriate values:
{{< alert type="warning" >}}
Any command that changes data directly could be damaging if not run correctly,
or under the right conditions. We highly recommend running them in a test environment
with a backup of the instance ready to be restored, just in case.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
MergeRequests::PostMergeService.new(project: p, current_user: u).execute(m)
```
Running this command against a merge request with unmerged changes causes the
merge request to display an incorrect message: `merged into <branch-name>`.
## Close a merge request from the Rails console
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If closing a merge request doesn't work through the UI or API, try closing it in a
[Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session):
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
MergeRequests::CloseService.new(project: p, current_user: u).execute(m)
```
## Delete a merge request from the Rails console
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If deleting a merge request doesn't work through the UI or API, try deleting it in a
[Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session):
{{< alert type="warning" >}}
Any command that changes data directly could be damaging if not run correctly,
or under the right conditions. We highly recommend running them in a test environment
with a backup of the instance ready to be restored, just in case.
{{< /alert >}}
```ruby
u = User.find_by_username('<username>')
p = Project.find_by_full_path('<namespace/project>')
m = p.merge_requests.find_by(iid: <iid>)
Issuable::DestroyService.new(container: m.project, current_user: u).execute(m)
```
## Merge request pre-receive hook failed
If a merge request times out, you might see messages that indicate a Puma worker
timeout problem:
- In the GitLab UI:
```plaintext
Something went wrong during merge pre-receive hook.
500 Internal Server Error. Try again.
```
- In the `gitlab-rails/api_json.log` log file:
```plaintext
Rack::Timeout::RequestTimeoutException
Request ran for longer than 60000ms
```
This error can happen if your merge request:
- Contains many diffs.
- Is many commits behind the target branch.
- References a Git LFS file that is locked.
Users on GitLab Self-Managed can request an administrator review server logs
to determine the cause of the error. GitLab SaaS users should
[contact Support](https://about.gitlab.com/support/#contact-support) for help.
## Cached merge request count
In a group, the sidebar displays the total count of open merge requests. This value is cached if it's
greater than 1000. The cached value is rounded to thousands (or millions) and updated every 24 hours.
## Check out merge requests locally through the `head` ref
{{< history >}}
- Deleting `head` refs 14 days after a merge request closes or merges [enabled on GitLab Self-Managed and GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130098) in GitLab 16.4.
- Deleting `head` refs 14 days after a merge request closes or merges [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/336070) in GitLab 16.6. Feature flag `merge_request_refs_cleanup` removed.
{{< /history >}}
A merge request contains all the history from a repository, plus the additional
commits added to the branch associated with the merge request. Here's a few
ways to check out a merge request locally.
You can check out a merge request locally even if the source
project is a fork (even a private fork) of the target project.
This relies on the merge request `head` ref (`refs/merge-requests/:iid/head`)
that is available for each merge request. It allows checking out a merge
request by using its ID instead of its branch.
In GitLab 16.6 and later, the merge request `head` ref is deleted 14 days after
a merge request is closed or merged. The merge request is then no longer available
for local checkout from the merge request `head` ref anymore. The merge request
can still be re-opened. If the merge request's branch
exists, you can still check out the branch, as it isn't affected.
### Check out locally using `glab`
```plaintext
glab mr checkout <merge_request_iid>
```
More information on the [GitLab terminal client](../../../editor_extensions/gitlab_cli/_index.md).
### Check out locally by adding a Git alias
Add the following alias to your `~/.gitconfig`:
```plaintext
[alias]
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
```
Now you can check out a particular merge request from any repository and any
remote. For example, to check out the merge request with ID 5 as shown in GitLab
from the `origin` remote, do:
```shell
git mr origin 5
```
This fetches the merge request into a local `mr-origin-5` branch and check
it out.
### Check out locally by modifying `.git/config` for a given repository
Locate the section for your GitLab remote in the `.git/config` file. It looks
like this:
```plaintext
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-foss.git
fetch = +refs/heads/*:refs/remotes/origin/*
```
You can open the file with:
```shell
git config -e
```
Now add the following line to the previous section:
```plaintext
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
In the end, it should look like this:
```plaintext
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-foss.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
Now you can fetch all the merge requests:
```shell
git fetch origin
...
From https://gitlab.com/gitlab-org/gitlab-foss.git
* [new ref] refs/merge-requests/1/head -> origin/merge-requests/1
* [new ref] refs/merge-requests/2/head -> origin/merge-requests/2
...
```
To check out a particular merge request:
```shell
git checkout origin/merge-requests/1
```
These commands can be also be done with the [`git-mr`](https://gitlab.com/glensc/git-mr) script.
## Error: "source branch `<branch_name>` does not exist." when the branch exists
This error can happen if the GitLab cache does not reflect the actual state of the
Git repository. This can happen if the Git data folder is mounted with `noexec` flag.
Prerequisites:
- You must be an administrator.
To force a cache update:
1. Open the GitLab Rails console with this command:
```shell
sudo gitlab-rails console
```
1. In the Rails console, run this script:
```ruby
# Get the project
project = Project.find_by_full_path('affected/project/path')
# Check if the affected branch exists in cache (it may return `false`)
project.repository.branch_names.include?('affected_branch_name')
# Expire the branches cache
project.repository.expire_branches_cache
# Check again if the affected branch exists in cache (this time it should return `true`)
project.repository.branch_names.include?('affected_branch_name')
```
1. Reload the merge request.
## Approvals reset when automation approves a merge request
If you automate the creation of merge requests, or pushing to them, you might want to build automated
approvals for those merge requests. In GitLab Premium and Ultimate, by default, all approvals are removed
[when commits are added to the source branch](approvals/settings.md#remove-all-approvals-when-commits-are-added-to-the-source-branch).
To avoid this problem, add logic to your automation that ensures
[commits are processed before approving](../../../api/merge_request_approvals.md#approvals-for-automated-merge-requests) the merge request.
|
https://docs.gitlab.com/user/project/auto_merge
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/auto_merge.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
auto_merge.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Auto-merge
|
Set auto-merge on a merge request when you have reviewed its content, so it can merge without intervention when all merge checks pass.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- **Merge when pipeline succeeds** and **Add to merge train when pipeline succeeds** [renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409530) to **Auto-merge** in GitLab 16.0 [with a flag](../../../administration/feature_flags/_index.md) named `auto_merge_labels_mr_widget`. Enabled by default.
- Renamed auto-merge feature [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120922) in GitLab 16.0. Feature flag `auto_merge_labels_mr_widget` removed.
- Enhanced auto-merge features [introduced](https://gitlab.com/groups/gitlab-org/-/epics/10874) in GitLab 16.5 [with two flags](../../../administration/feature_flags/_index.md) named `merge_when_checks_pass` and `additional_merge_when_checks_ready`. Disabled by default.
- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/412995) the flags `merge_when_checks_pass` and `additional_merge_when_checks_ready` on GitLab.com in GitLab 17.0.
- [Merged](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154366) the flag `additional_merge_when_checks_ready` with the flag `merge_when_checks_pass` in GitLab 17.1.
- Auto-merge for merge trains [introduced](https://gitlab.com/groups/gitlab-org/-/epics/10874) in GitLab 17.2 [with a flag](../../../administration/feature_flags/_index.md) named `merge_when_checks_pass_merge_train`. Disabled by default.
- Auto-merge for merge trains [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/470667) on GitLab.com in GitLab 17.2.
- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/412995) the flag `merge_when_checks_pass` on GitLab Self-Managed by default in GitLab 17.4.
- Auto-merge for merge trains [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/174357) in GitLab 17.7. Feature flag `merge_when_checks_pass_merge_train` removed.
- Auto-merge [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/412995) in GitLab 17.7. Feature flag `merge_when_checks_pass` removed.
{{< /history >}}
If the content of a merge request is ready to merge,
you can select **Set to auto-merge**. The merge request auto-merges when all required checks complete
successfully, and you don't need to remember to manually merge the merge request.
Merge checks enable you to focus on reviewing a merge request's contents, and use project settings to determine
their mergeability. When you review a merge request, if you approve of the merge request's changes, set it to
auto-merge. GitLab enforces your project settings, and until the merge request satisfies all merge checks
(like required Code Owner and approval rules), it cannot merge. After satisfying all required merge checks,
the merge request merges, with no action required from you.
Merge checks include a passing CI/CD pipeline, and much more:
- All required approvals must be given.
- No other merge requests block this merge request.
- No merge conflicts exist.
- A CI/CD pipeline must complete successfully, regardless of the [project setting](#require-a-successful-pipeline-for-merge).
- All discussions are resolved.
- The merge request is not a **Draft**.
- All external status checks have passed.
- The merge request must be open.
- No denied policies exist.
- If your project
[requires merge requests to reference a Jira issue](../../../integration/jira/issues.md#require-associated-jira-issue-for-merge-requests-to-be-merged),
the merge request title or description contains a Jira issue link.
- If the merge request has a **Merge after** date set, the current time must be after the configured date.
For a full list of checks and their API equivalents, see
[Merge status](../../../api/merge_requests.md#merge-status).

After you set auto-merge, you can't change which issues [auto-close](../issues/managing_issues.md#closing-issues-automatically)
when the merge request merges.
## Auto-merge a merge request
Prerequisites:
- You must have at least the Developer role for the project.
- If your project configuration requires it, all threads in the
merge request [must be resolved](_index.md#resolve-a-thread).
- The merge request must have received all required approvals.
To do this when pushing from the command line, use the `merge_request.merge_when_pipeline_succeeds`
[push option](../../../topics/git/commit.md#push-options).
To do this from the GitLab user interface:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select the merge request to edit.
1. Scroll to the merge request reports section.
1. Optional. Select your desired merge options, such as **Delete source branch**,
**Squash commits**, or **Edit commit message**.
1. Review the contents of the merge request widget. If it contains an
[issue closing pattern](../issues/managing_issues.md#closing-issues-automatically), confirm
that the issue should close when this work merges:

1. Select **Auto-merge**.
Commenting on a merge request after you select **Auto-merge**,
but before the pipeline completes, blocks the merge until you
resolve all existing threads.
## Cancel an auto-merge
You can cancel auto-merge on a merge request.
Prerequisites:
- You must either be the author of the merge request, or a project member with
at least the Developer role.
- The merge request's pipeline must still be in progress.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select the merge request to edit.
1. Scroll to the merge request reports section.
1. Select **Cancel auto-merge**.

## Pipeline success for auto-merge
If the pipeline succeeds, the merge request merges. If the pipeline fails, the author
can either retry any failed jobs, or push new commits to fix the failure:
- If a retried job succeeds on the second try, the merge request merges.
- If you add new commits to the merge request, GitLab cancels the request
to ensure the new changes receive a review before merge.
- If you add new commits to the target branch of the merge request, and your project
allows only fast-forward merge requests, GitLab cancels the request to prevent merge conflicts.
For stricter control on pipeline status, you can also
[require a successful pipeline](#require-a-successful-pipeline-for-merge) before merge.
### Require a successful pipeline for merge
You can configure your project to require a complete and successful pipeline before
merge. This configuration works for both:
- GitLab CI/CD pipelines.
- Pipelines run from an [external CI integration](../integrations/_index.md#available-integrations).
As a result, [disabling GitLab CI/CD pipelines](../../../ci/pipelines/settings.md#disable-gitlab-cicd-pipelines)
does not disable this feature, but you can use pipelines from external
CI providers with it.
Prerequisites:
- Ensure your project's CI/CD configuration runs a pipeline for every merge request.
- You must have at least the Maintainer role for the project.
To enable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Scroll to **Merge checks**, and select **Pipelines must succeed**.
This setting also prevents merge requests from merging if there is no pipeline,
which can [conflict with some rules](#merge-request-cant-merge-despite-no-failed-pipeline).
1. Select **Save**.
If [multiple pipeline types run for the same merge request](#merge-request-can-still-be-merged-despite-a-failed-pipeline),
merge request pipelines take precedence over other pipeline types. For example,
an older but successful merge request pipeline allows a merge request to merge,
despite a newer but failed branch pipeline.
### Allow merge after skipped pipelines
When you set **Pipelines must succeed** for a project,
[skipped pipelines](../../../ci/pipelines/_index.md#skip-a-pipeline) prevent
merge requests from merging.
Prerequisites:
- You must have at least the Maintainer role for the project.
To change this behavior:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Under **Merge checks**:
- Select **Pipelines must succeed**.
- Select **Skipped pipelines are considered successful**.
1. Select **Save**.
## Prevent merge before a specific date
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14380) in GitLab 17.6.
{{< /history >}}
If your merge request should not merge before a specific date and time, set a **Merge after** date.
This value sets when the merge (or merge train) can start. The exact time of merge can vary,
however, depending on the satisfaction of other merge checks or the length of your merge train.
Prerequisites:
- You must have at least the Developer role for the project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select the merge request to edit.
1. Select **Edit**.
1. Find the **Merge after** input and select a date and time.
1. Select **Save changes**.
## Troubleshooting
### Merge request can't merge despite no failed pipeline
In some cases, you can [require a successful pipeline for merge](#require-a-successful-pipeline-for-merge),
but be unable to merge a merge request with no failed pipelines. The setting requires
the existence of a successful pipeline, not the absence of failed pipelines. A merge request
with no pipelines at all is not considered to have a successful pipeline, and cannot merge.
When you enable this setting, use [`rules`](../../../ci/yaml/_index.md#rules)
or [`workflow:rules`](../../../ci/yaml/_index.md#workflowrules) to ensure pipelines
run for every merge request.
### Merge request can still be merged despite a failed pipeline
In some cases, you can [require a successful pipeline for merge](#require-a-successful-pipeline-for-merge),
but still merge a merge request with a failed pipeline.
Merge request pipelines have the highest priority for the **Pipelines must succeed** setting.
If multiple pipeline types run for the same merge request, GitLab checks only the
merge request pipelines for success.
Merge requests can have multiple pipelines if:
- A [`rules`](../../../ci/yaml/_index.md#rules) configuration that causes [duplicate pipelines](../../../ci/jobs/job_rules.md#avoid-duplicate-pipelines):
one merge request pipeline and one branch pipeline. In this case, the status of the
latest merge request pipeline determines if a merge request can merge, not the branch pipeline.
- Pipelines triggered by external tools that target the same branch as the merge request.
In all cases, update your CI/CD configuration to prevent multiple pipeline types for the same merge request.
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Set auto-merge on a merge request when you have reviewed its content,
so it can merge without intervention when all merge checks pass.
title: Auto-merge
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- **Merge when pipeline succeeds** and **Add to merge train when pipeline succeeds** [renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409530) to **Auto-merge** in GitLab 16.0 [with a flag](../../../administration/feature_flags/_index.md) named `auto_merge_labels_mr_widget`. Enabled by default.
- Renamed auto-merge feature [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120922) in GitLab 16.0. Feature flag `auto_merge_labels_mr_widget` removed.
- Enhanced auto-merge features [introduced](https://gitlab.com/groups/gitlab-org/-/epics/10874) in GitLab 16.5 [with two flags](../../../administration/feature_flags/_index.md) named `merge_when_checks_pass` and `additional_merge_when_checks_ready`. Disabled by default.
- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/412995) the flags `merge_when_checks_pass` and `additional_merge_when_checks_ready` on GitLab.com in GitLab 17.0.
- [Merged](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154366) the flag `additional_merge_when_checks_ready` with the flag `merge_when_checks_pass` in GitLab 17.1.
- Auto-merge for merge trains [introduced](https://gitlab.com/groups/gitlab-org/-/epics/10874) in GitLab 17.2 [with a flag](../../../administration/feature_flags/_index.md) named `merge_when_checks_pass_merge_train`. Disabled by default.
- Auto-merge for merge trains [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/470667) on GitLab.com in GitLab 17.2.
- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/412995) the flag `merge_when_checks_pass` on GitLab Self-Managed by default in GitLab 17.4.
- Auto-merge for merge trains [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/174357) in GitLab 17.7. Feature flag `merge_when_checks_pass_merge_train` removed.
- Auto-merge [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/412995) in GitLab 17.7. Feature flag `merge_when_checks_pass` removed.
{{< /history >}}
If the content of a merge request is ready to merge,
you can select **Set to auto-merge**. The merge request auto-merges when all required checks complete
successfully, and you don't need to remember to manually merge the merge request.
Merge checks enable you to focus on reviewing a merge request's contents, and use project settings to determine
their mergeability. When you review a merge request, if you approve of the merge request's changes, set it to
auto-merge. GitLab enforces your project settings, and until the merge request satisfies all merge checks
(like required Code Owner and approval rules), it cannot merge. After satisfying all required merge checks,
the merge request merges, with no action required from you.
Merge checks include a passing CI/CD pipeline, and much more:
- All required approvals must be given.
- No other merge requests block this merge request.
- No merge conflicts exist.
- A CI/CD pipeline must complete successfully, regardless of the [project setting](#require-a-successful-pipeline-for-merge).
- All discussions are resolved.
- The merge request is not a **Draft**.
- All external status checks have passed.
- The merge request must be open.
- No denied policies exist.
- If your project
[requires merge requests to reference a Jira issue](../../../integration/jira/issues.md#require-associated-jira-issue-for-merge-requests-to-be-merged),
the merge request title or description contains a Jira issue link.
- If the merge request has a **Merge after** date set, the current time must be after the configured date.
For a full list of checks and their API equivalents, see
[Merge status](../../../api/merge_requests.md#merge-status).

After you set auto-merge, you can't change which issues [auto-close](../issues/managing_issues.md#closing-issues-automatically)
when the merge request merges.
## Auto-merge a merge request
Prerequisites:
- You must have at least the Developer role for the project.
- If your project configuration requires it, all threads in the
merge request [must be resolved](_index.md#resolve-a-thread).
- The merge request must have received all required approvals.
To do this when pushing from the command line, use the `merge_request.merge_when_pipeline_succeeds`
[push option](../../../topics/git/commit.md#push-options).
To do this from the GitLab user interface:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select the merge request to edit.
1. Scroll to the merge request reports section.
1. Optional. Select your desired merge options, such as **Delete source branch**,
**Squash commits**, or **Edit commit message**.
1. Review the contents of the merge request widget. If it contains an
[issue closing pattern](../issues/managing_issues.md#closing-issues-automatically), confirm
that the issue should close when this work merges:

1. Select **Auto-merge**.
Commenting on a merge request after you select **Auto-merge**,
but before the pipeline completes, blocks the merge until you
resolve all existing threads.
## Cancel an auto-merge
You can cancel auto-merge on a merge request.
Prerequisites:
- You must either be the author of the merge request, or a project member with
at least the Developer role.
- The merge request's pipeline must still be in progress.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select the merge request to edit.
1. Scroll to the merge request reports section.
1. Select **Cancel auto-merge**.

## Pipeline success for auto-merge
If the pipeline succeeds, the merge request merges. If the pipeline fails, the author
can either retry any failed jobs, or push new commits to fix the failure:
- If a retried job succeeds on the second try, the merge request merges.
- If you add new commits to the merge request, GitLab cancels the request
to ensure the new changes receive a review before merge.
- If you add new commits to the target branch of the merge request, and your project
allows only fast-forward merge requests, GitLab cancels the request to prevent merge conflicts.
For stricter control on pipeline status, you can also
[require a successful pipeline](#require-a-successful-pipeline-for-merge) before merge.
### Require a successful pipeline for merge
You can configure your project to require a complete and successful pipeline before
merge. This configuration works for both:
- GitLab CI/CD pipelines.
- Pipelines run from an [external CI integration](../integrations/_index.md#available-integrations).
As a result, [disabling GitLab CI/CD pipelines](../../../ci/pipelines/settings.md#disable-gitlab-cicd-pipelines)
does not disable this feature, but you can use pipelines from external
CI providers with it.
Prerequisites:
- Ensure your project's CI/CD configuration runs a pipeline for every merge request.
- You must have at least the Maintainer role for the project.
To enable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Scroll to **Merge checks**, and select **Pipelines must succeed**.
This setting also prevents merge requests from merging if there is no pipeline,
which can [conflict with some rules](#merge-request-cant-merge-despite-no-failed-pipeline).
1. Select **Save**.
If [multiple pipeline types run for the same merge request](#merge-request-can-still-be-merged-despite-a-failed-pipeline),
merge request pipelines take precedence over other pipeline types. For example,
an older but successful merge request pipeline allows a merge request to merge,
despite a newer but failed branch pipeline.
### Allow merge after skipped pipelines
When you set **Pipelines must succeed** for a project,
[skipped pipelines](../../../ci/pipelines/_index.md#skip-a-pipeline) prevent
merge requests from merging.
Prerequisites:
- You must have at least the Maintainer role for the project.
To change this behavior:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Under **Merge checks**:
- Select **Pipelines must succeed**.
- Select **Skipped pipelines are considered successful**.
1. Select **Save**.
## Prevent merge before a specific date
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14380) in GitLab 17.6.
{{< /history >}}
If your merge request should not merge before a specific date and time, set a **Merge after** date.
This value sets when the merge (or merge train) can start. The exact time of merge can vary,
however, depending on the satisfaction of other merge checks or the length of your merge train.
Prerequisites:
- You must have at least the Developer role for the project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Select the merge request to edit.
1. Select **Edit**.
1. Find the **Merge after** input and select a date and time.
1. Select **Save changes**.
## Troubleshooting
### Merge request can't merge despite no failed pipeline
In some cases, you can [require a successful pipeline for merge](#require-a-successful-pipeline-for-merge),
but be unable to merge a merge request with no failed pipelines. The setting requires
the existence of a successful pipeline, not the absence of failed pipelines. A merge request
with no pipelines at all is not considered to have a successful pipeline, and cannot merge.
When you enable this setting, use [`rules`](../../../ci/yaml/_index.md#rules)
or [`workflow:rules`](../../../ci/yaml/_index.md#workflowrules) to ensure pipelines
run for every merge request.
### Merge request can still be merged despite a failed pipeline
In some cases, you can [require a successful pipeline for merge](#require-a-successful-pipeline-for-merge),
but still merge a merge request with a failed pipeline.
Merge request pipelines have the highest priority for the **Pipelines must succeed** setting.
If multiple pipeline types run for the same merge request, GitLab checks only the
merge request pipelines for success.
Merge requests can have multiple pipelines if:
- A [`rules`](../../../ci/yaml/_index.md#rules) configuration that causes [duplicate pipelines](../../../ci/jobs/job_rules.md#avoid-duplicate-pipelines):
one merge request pipeline and one branch pipeline. In this case, the status of the
latest merge request pipeline determines if a merge request can merge, not the branch pipeline.
- Pipelines triggered by external tools that target the same branch as the merge request.
In all cases, update your CI/CD configuration to prevent multiple pipeline types for the same merge request.
|
https://docs.gitlab.com/user/project/csv_export
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/csv_export.md
|
2025-08-13
|
doc/user/project/merge_requests
|
[
"doc",
"user",
"project",
"merge_requests"
] |
csv_export.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Export merge requests to CSV
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Export all the data collected from a project's merge requests into a comma-separated values (CSV) file.
To export merge requests to a CSV file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Add any searches or filters. This can help you keep the size of the CSV file under the 15 MB limit. The limit ensures
the file can be emailed to a variety of email providers.
1. Select **Actions** ({{< icon name="ellipsis_v" >}}) **> Export as CSV**.
1. Confirm the correct number of merge requests are to be exported.
1. Select **Export merge requests**.
## CSV Output
The following table shows the attributes in the CSV file.
| Column | Description |
|--------------------|--------------------------------------------------------------|
| Title | Merge request title |
| Description | Merge request description |
| MR ID | MR `iid` |
| URL | A link to the merge request on GitLab |
| State | Opened, Closed, Locked, or Merged |
| Source Branch | Source branch |
| Target Branch | Target branch |
| Source Project ID | ID of the source project |
| Target Project ID | ID of the target project |
| Author | Full name of the merge request author |
| Author Username | Username of the author, with the @ symbol omitted |
| Assignees | Full names of the merge request assignees, joined with a `,` |
| Assignee Usernames | Username of the assignees, with the @ symbol omitted |
| Approvers | Full names of the approvers, joined with a `,` |
| Approver Usernames | Username of the approvers, with the @ symbol omitted |
| Merged User | Full name of the merged user |
| Merged Username | Username of the merge user, with the @ symbol omitted |
| Milestone ID | ID of the merge request milestone |
| Created At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Updated At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Export merge requests to CSV
breadcrumbs:
- doc
- user
- project
- merge_requests
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Export all the data collected from a project's merge requests into a comma-separated values (CSV) file.
To export merge requests to a CSV file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests**.
1. Add any searches or filters. This can help you keep the size of the CSV file under the 15 MB limit. The limit ensures
the file can be emailed to a variety of email providers.
1. Select **Actions** ({{< icon name="ellipsis_v" >}}) **> Export as CSV**.
1. Confirm the correct number of merge requests are to be exported.
1. Select **Export merge requests**.
## CSV Output
The following table shows the attributes in the CSV file.
| Column | Description |
|--------------------|--------------------------------------------------------------|
| Title | Merge request title |
| Description | Merge request description |
| MR ID | MR `iid` |
| URL | A link to the merge request on GitLab |
| State | Opened, Closed, Locked, or Merged |
| Source Branch | Source branch |
| Target Branch | Target branch |
| Source Project ID | ID of the source project |
| Target Project ID | ID of the target project |
| Author | Full name of the merge request author |
| Author Username | Username of the author, with the @ symbol omitted |
| Assignees | Full names of the merge request assignees, joined with a `,` |
| Assignee Usernames | Username of the assignees, with the @ symbol omitted |
| Approvers | Full names of the approvers, joined with a `,` |
| Approver Usernames | Username of the approvers, with the @ symbol omitted |
| Merged User | Full name of the merged user |
| Merged Username | Username of the merge user, with the @ symbol omitted |
| Milestone ID | ID of the merge request milestone |
| Created At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
| Updated At (UTC) | Formatted as `YYYY-MM-DD HH:MM:SS` |
|
https://docs.gitlab.com/user/project/merge_requests/reviews
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_requests/_index.md
|
2025-08-13
|
doc/user/project/merge_requests/reviews
|
[
"doc",
"user",
"project",
"merge_requests",
"reviews"
] |
_index.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request reviews
|
Use merge request reviews to discuss and improve code before it merges into your project.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The merge request review process ensures that subject matter experts review your proposed changes
before they are merged. Reviewers add review comments to merge requests, and [suggest changes](suggestions.md)
the author can apply directly from the GitLab UI.
Reviewers can use any of these tools to review a merge request:
- The GitLab interface.
- Visual Studio Code, with the
[GitLab Workflow extension for VS Code](../../../../editor_extensions/visual_studio_code/_index.md).
- A terminal window, with the [GitLab CLI](../../../../editor_extensions/gitlab_cli/_index.md).
Approvals are one of several merge checks that ensure your merge request merges only when it's truly
ready. Depending on your project configuration, reviewers can also block a merge request
from merging by setting **Request changes**.
GitLab Premium and Ultimate provide an **Assign reviewers** drawer with more information to help you
find reviewers [who fulfill approval rules](#find-reviewers-who-fulfill-approval-rules):

By following the [defined review flow](#start-a-review), each reviewer decides whether to accept or reject a merge request.
The right sidebar shows the list of reviewers, and (if they follow the review flow) their review status:

- {{< icon name="dash-circle" >}} Review not yet started.
- {{< icon name="status_running" >}} Review is in progress.
- {{< icon name="check-circle" >}} Reviewed and approved.
- {{< icon name="comment-lines" >}} Reviewed, requested changes, and
[blocked this merge request](#prevent-merge-when-you-request-changes) until changes are made.
This block [can be bypassed](#prevent-merge-when-you-request-changes).
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Merge request review](https://www.youtube.com/watch?v=2MayfXKpU08&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED&index=183).
<!-- Video published on 2023-04-29 -->
## Find merge requests to review
Your [merge request homepage](../homepage.md) shows your merge requests in progress, and merge requests
awaiting review from you. The merge requests you need to review are in the **Review requested** category.
To see all merge requests that need your attention, use one of these methods:
- Press the <kbd>Shift</kbd> + <kbd>m</kbd> [keyboard shortcut](../../../shortcuts.md).
- On the left sidebar, select **Merge requests** ({{< icon name="merge-request">}}).
- On the left sidebar, select **Search or go to** then, from the dropdown list, select **Merge requests I'm working on**.
## View the review status of a merge request
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. Scroll to the [merge request widget](../widgets.md) to see the mergeability and
approval status for the merge request. For example, the lack of required approvals blocks this merge request:

## Request a review
{{< history >}}
- **Assign reviewers** drawer [introduced](https://gitlab.com/groups/gitlab-org/-/epics/12878) in GitLab 17.5 [with a flag](../../../../administration/feature_flags/_index.md) named `reviewer_assign_drawer`.
- Drawer [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/467205) on GitLab.com and GitLab Self-Managed in GitLab 17.5.
- [Feature flag](https://gitlab.com/gitlab-org/gitlab/-/issues/467205) `reviewer_assign_drawer` removed in GitLab 17.8.
{{< /history >}}
When you've finished preparing your changes, it's time to request a review. To assign a reviewer to
your merge request, either use the `/assign_reviewer @user`
[quick action](../../quick_actions.md#issues-merge-requests-and-epics) in any text field, or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. To find a reviewer by name: on the right sidebar, in the **Reviewers** section, select **Edit**.
1. To find a reviewer who fulfills an approval rule in GitLab Premium and Ultimate:
1. On the right sidebar, in the **Reviewers** section, select **Assign** to open the **Assign reviewers** drawer.
1. For each approval rule, select **Edit** to find a reviewer who fulfills that approval rule.
GitLab adds the merge request to the user's review requests.
### Find reviewers who fulfill approval rules
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Premium and Ultimate help you more quickly find the best reviewers for your merge request.
Use the **Assign reviewers** drawer to filter lists of reviewers. See the Code Owners for the files
changed in your merge request, and the users who satisfy your project's approval rules.
In this example, the merge request requires 3 Code Owner approvals, but has none so far:

To assign eligible approvers in a merge request:
1. In the **Reviewers** section, select **Assign**.
1. To see optional approval rules or Code Owners, select **Optional approval rules** ({{< icon name="chevron-lg-up" >}}) to show them.
1. Next to the reviewer type you need, select **Edit**:
- **Code Owners** shows only the Code Owners for that file type.
- **Approval rules** shows only users who fulfill that approval rule.
1. Select your desired reviewer. (GitLab Premium and Ultimate enable you to select more than one reviewer.)
1. Repeat for each required **Code Owner** and **Approval rule** item.
1. When you've selected your reviewers, on the top right, select **Close** ({{< icon name="close" >}})
to hide the **Assign reviewers** drawer.
### Re-request a review
After a reviewer completes their [merge request reviews](../../../discussions/_index.md),
the author of the merge request can request a new review from the reviewer.
To do this, either use the `/request_review @user` quick action in any text field on the merge request, or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. If you have collapsed the right sidebar in the merge request, select the
{{< icon name="chevron-double-lg-left" >}} **Expand Sidebar** to expand it.
1. In the **Reviewers** section, select the **Re-request a review** icon ({{< icon name="redo" >}})
next to the reviewer's name.
GitLab creates a new [to-do item](../../../todos.md) for the reviewer, and sends
them a notification email.
## Start a review
{{< history >}}
- **Assign reviewers** drawer [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/185795) in GitLab 17.11 [with a flag](../../../../administration/feature_flags/_index.md) named `improved_review_experience`. Disabled by default.
- **Assign reviewers** drawer [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/535461) in GitLab 18.1.
{{< /history >}}
When reviewing a merge request, follow the review process instead of leaving individual
comments. When you select **Start a review**, the **Reviewers** section of the right sidebar updates
your status from **Awaiting review** ({{< icon name="dash-circle">}}) to
**Reviewer started review** ({{< icon name="comment-dots">}})
To start your review of a merge request:
1. Either:
- Press <kbd>Shift</kbd> + <kbd>r</kbd> to go to your **Review requests** page.
- On the left sidebar, select **Merge requests** ({{< icon name="merge-request" >}}) **> Review requests**.
1. Find your merge request, and select the title of the merge request to view it.
1. Read the merge request description and comments to learn about the merge request.
1. Select **Changes** to view the diff of the proposed changes. To learn more about
the **Changes** page, see [Changes in merge requests](../changes.md).
1. [Suggest multi-line or single-line changes](suggestions.md) as needed. When ready to save your
first review comment, select **Start a review** to:
- Update your status in the right sidebar to **Reviewer started review** ({{< icon name="comment-dots">}}).
- Save your review comment, but leave it unpublished, like this:

If you select **Add comment now** instead of **Start a review**, GitLab publishes your comment immediately.
1. Continue writing review comments on the **Changes** tab or the **Overview** tab.
Selecting **Add to review** keeps them unpublished until you submit your review:

Next, submit your review.
### Resolve or reopen thread with a comment
Review comments can also resolve or reopen [resolvable threads](../_index.md#resolve-a-thread).
To resolve or reopen a thread when replying to a comment:
1. In the comment text area, write your comment.
1. Select or clear **Resolve thread** or **Reopen thread**.
1. Select **Add comment now** or **Add to review**.
Pending comments display information about delayed actions. GitLab does not perform these actions
until you publish the comment:
- {{< icon name="check-circle-filled" >}} Resolves thread.
- {{< icon name="check-circle" >}} Thread stays open.
## Submit a review
When you submit a review, GitLab does the following:
- Publishes the comments in your review.
- Sends a single email to every notifiable user of the merge request, with your
review comments attached. Replying to this email creates a new comment on the merge request.
- Performs any quick actions you added to your review comments.
- Shows the outcome of your review.
1. On the top right, select **Your review** to show details about your review:

1. Review your pending comments. Edit them as needed.
1. Select the outcome of your review.
- **Approve**: Leave feedback and approve the changes.
- **Comment**: Leave general feedback without an explicit approval or change request.
- **Request changes**: Block the merge request from merging until the author
addresses your feedback.
1. Optional. Write a summary of your review. GitLab Premium and Ultimate users can select
**Add summary** ({{< icon name="tanuki-ai">}}) to create a summary for you. Include any
quick actions you want performed.
You can also use the `/submit_review` [quick action](../../quick_actions.md) in the text of a non-review comment.
### Discard your pending review
When you discard a review, your unpublished comments are deleted and you cannot restore them.
To do this:
1. On the top right, select **Your review** to show details about your review:

1. Select **Discard review**.
### Prevent merge when you request changes
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/430728) in GitLab 16.11 [with a flag](../../../../administration/feature_flags/_index.md) named `mr_reviewer_requests_changes`. Disabled by default.
- Enabled by default [on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/451211) and [GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158226) in GitLab 17.2.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/451211) in GitLab 17.3.
{{< /history >}}
A reviewer [requesting changes](#submit-a-review) blocks a merge request from merging.
When this happens, the merge request reports area shows the message
**Change requests must be approved by the requesting user**. To unblock the merge request,
the reviewer who requested changes should [re-review and approve](#re-request-a-review) the merge request.
### Remove a change request
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/480412) in GitLab 17.8.
{{< /history >}}
If you previously requested changes, you can remove your change request. You might need to do this
if both of the following are true:
- You can no longer approve the merge request.
- You want to cancel your change request, but don't want to submit a new review.
To remove your change request without submitting a new review:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. On the merge request **Overview**, scroll to the merge request reports area.
1. Next to **Change requests must be approved by the requesting user**, select **Remove**:

### Bypass a request for changes
If the user who requested changes is unavailable to re-review or approve,
another user with permission to merge the merge request can override this check:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. On the merge request **Overview**, scroll to the merge request reports area.
1. Next to **Change requests must be approved by the requesting user**, select **Bypass**:

1. The merge reports area shows `Merge with caution: Override added`. To see which check a user
bypassed, select **Expand merge checks** ({{< icon name="chevron-lg-down" >}}) and find the
check that contains a warning ({{< icon name="status_warning" >}}) icon. In this example, the
author bypassed **Change requests must be approved by the requesting user**:

## Download merge request changes
You can download the changes from a merge request as a diff or patch file.
For more information and examples, see
[Download merge request changes](../changes.md#download-merge-request-changes).
## Associated features
Merge requests are related to these features:
- [Cherry-pick changes](../cherry_pick_changes.md):
In the GitLab UI, select **Cherry-pick** in a merged merge request or a commit to cherry-pick it.
- [Compare changes](../changes.md):
View and download the diff of changes included in a merge request.
- [Fast-forward merge requests](../methods/_index.md#fast-forward-merge):
For a linear Git history and a way to accept merge requests without creating merge commits
- [Find the merge request that introduced a change](../versions.md):
When viewing the commit details page, GitLab links to the merge requests containing that commit.
- [Merge requests versions](../versions.md):
Select and compare the different versions of merge request diffs
- [Resolve conflicts](../conflicts.md):
GitLab can provide the option to resolve certain merge request conflicts in the GitLab UI.
- [Revert changes](../revert_changes.md):
Revert changes from any commit from a merge request.
- [Keyboard shortcuts](../../../shortcuts.md#merge-requests):
Access and change specific parts of a merge request with keyboard commands.
- [Value stream analytics](../../../group/value_stream_analytics/_index.md): Track key merge request steps (such as `reviewed` and `approved`) to identify where your team spends the most time in the software development lifecycle. This information helps uncover actionable insights to optimize merge request workflows for groups and projects, and improve developer productivity. Read more about [How we reduced MR review time with value stream analytics](https://about.gitlab.com/blog/2025/02/20/how-we-reduced-mr-review-time-with-value-stream-management/).
## Related topics
- [Compare changes in merge requests](../changes.md)
- [Compare branches](../../repository/branches/_index.md#compare-branches)
- [Merge methods](../methods/_index.md)
- [Draft Notes API](../../../../api/draft_notes.md)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use merge request reviews to discuss and improve code before it merges
into your project.
title: Merge request reviews
breadcrumbs:
- doc
- user
- project
- merge_requests
- reviews
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The merge request review process ensures that subject matter experts review your proposed changes
before they are merged. Reviewers add review comments to merge requests, and [suggest changes](suggestions.md)
the author can apply directly from the GitLab UI.
Reviewers can use any of these tools to review a merge request:
- The GitLab interface.
- Visual Studio Code, with the
[GitLab Workflow extension for VS Code](../../../../editor_extensions/visual_studio_code/_index.md).
- A terminal window, with the [GitLab CLI](../../../../editor_extensions/gitlab_cli/_index.md).
Approvals are one of several merge checks that ensure your merge request merges only when it's truly
ready. Depending on your project configuration, reviewers can also block a merge request
from merging by setting **Request changes**.
GitLab Premium and Ultimate provide an **Assign reviewers** drawer with more information to help you
find reviewers [who fulfill approval rules](#find-reviewers-who-fulfill-approval-rules):

By following the [defined review flow](#start-a-review), each reviewer decides whether to accept or reject a merge request.
The right sidebar shows the list of reviewers, and (if they follow the review flow) their review status:

- {{< icon name="dash-circle" >}} Review not yet started.
- {{< icon name="status_running" >}} Review is in progress.
- {{< icon name="check-circle" >}} Reviewed and approved.
- {{< icon name="comment-lines" >}} Reviewed, requested changes, and
[blocked this merge request](#prevent-merge-when-you-request-changes) until changes are made.
This block [can be bypassed](#prevent-merge-when-you-request-changes).
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Merge request review](https://www.youtube.com/watch?v=2MayfXKpU08&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED&index=183).
<!-- Video published on 2023-04-29 -->
## Find merge requests to review
Your [merge request homepage](../homepage.md) shows your merge requests in progress, and merge requests
awaiting review from you. The merge requests you need to review are in the **Review requested** category.
To see all merge requests that need your attention, use one of these methods:
- Press the <kbd>Shift</kbd> + <kbd>m</kbd> [keyboard shortcut](../../../shortcuts.md).
- On the left sidebar, select **Merge requests** ({{< icon name="merge-request">}}).
- On the left sidebar, select **Search or go to** then, from the dropdown list, select **Merge requests I'm working on**.
## View the review status of a merge request
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. Scroll to the [merge request widget](../widgets.md) to see the mergeability and
approval status for the merge request. For example, the lack of required approvals blocks this merge request:

## Request a review
{{< history >}}
- **Assign reviewers** drawer [introduced](https://gitlab.com/groups/gitlab-org/-/epics/12878) in GitLab 17.5 [with a flag](../../../../administration/feature_flags/_index.md) named `reviewer_assign_drawer`.
- Drawer [enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/467205) on GitLab.com and GitLab Self-Managed in GitLab 17.5.
- [Feature flag](https://gitlab.com/gitlab-org/gitlab/-/issues/467205) `reviewer_assign_drawer` removed in GitLab 17.8.
{{< /history >}}
When you've finished preparing your changes, it's time to request a review. To assign a reviewer to
your merge request, either use the `/assign_reviewer @user`
[quick action](../../quick_actions.md#issues-merge-requests-and-epics) in any text field, or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. To find a reviewer by name: on the right sidebar, in the **Reviewers** section, select **Edit**.
1. To find a reviewer who fulfills an approval rule in GitLab Premium and Ultimate:
1. On the right sidebar, in the **Reviewers** section, select **Assign** to open the **Assign reviewers** drawer.
1. For each approval rule, select **Edit** to find a reviewer who fulfills that approval rule.
GitLab adds the merge request to the user's review requests.
### Find reviewers who fulfill approval rules
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Premium and Ultimate help you more quickly find the best reviewers for your merge request.
Use the **Assign reviewers** drawer to filter lists of reviewers. See the Code Owners for the files
changed in your merge request, and the users who satisfy your project's approval rules.
In this example, the merge request requires 3 Code Owner approvals, but has none so far:

To assign eligible approvers in a merge request:
1. In the **Reviewers** section, select **Assign**.
1. To see optional approval rules or Code Owners, select **Optional approval rules** ({{< icon name="chevron-lg-up" >}}) to show them.
1. Next to the reviewer type you need, select **Edit**:
- **Code Owners** shows only the Code Owners for that file type.
- **Approval rules** shows only users who fulfill that approval rule.
1. Select your desired reviewer. (GitLab Premium and Ultimate enable you to select more than one reviewer.)
1. Repeat for each required **Code Owner** and **Approval rule** item.
1. When you've selected your reviewers, on the top right, select **Close** ({{< icon name="close" >}})
to hide the **Assign reviewers** drawer.
### Re-request a review
After a reviewer completes their [merge request reviews](../../../discussions/_index.md),
the author of the merge request can request a new review from the reviewer.
To do this, either use the `/request_review @user` quick action in any text field on the merge request, or:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. If you have collapsed the right sidebar in the merge request, select the
{{< icon name="chevron-double-lg-left" >}} **Expand Sidebar** to expand it.
1. In the **Reviewers** section, select the **Re-request a review** icon ({{< icon name="redo" >}})
next to the reviewer's name.
GitLab creates a new [to-do item](../../../todos.md) for the reviewer, and sends
them a notification email.
## Start a review
{{< history >}}
- **Assign reviewers** drawer [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/185795) in GitLab 17.11 [with a flag](../../../../administration/feature_flags/_index.md) named `improved_review_experience`. Disabled by default.
- **Assign reviewers** drawer [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/535461) in GitLab 18.1.
{{< /history >}}
When reviewing a merge request, follow the review process instead of leaving individual
comments. When you select **Start a review**, the **Reviewers** section of the right sidebar updates
your status from **Awaiting review** ({{< icon name="dash-circle">}}) to
**Reviewer started review** ({{< icon name="comment-dots">}})
To start your review of a merge request:
1. Either:
- Press <kbd>Shift</kbd> + <kbd>r</kbd> to go to your **Review requests** page.
- On the left sidebar, select **Merge requests** ({{< icon name="merge-request" >}}) **> Review requests**.
1. Find your merge request, and select the title of the merge request to view it.
1. Read the merge request description and comments to learn about the merge request.
1. Select **Changes** to view the diff of the proposed changes. To learn more about
the **Changes** page, see [Changes in merge requests](../changes.md).
1. [Suggest multi-line or single-line changes](suggestions.md) as needed. When ready to save your
first review comment, select **Start a review** to:
- Update your status in the right sidebar to **Reviewer started review** ({{< icon name="comment-dots">}}).
- Save your review comment, but leave it unpublished, like this:

If you select **Add comment now** instead of **Start a review**, GitLab publishes your comment immediately.
1. Continue writing review comments on the **Changes** tab or the **Overview** tab.
Selecting **Add to review** keeps them unpublished until you submit your review:

Next, submit your review.
### Resolve or reopen thread with a comment
Review comments can also resolve or reopen [resolvable threads](../_index.md#resolve-a-thread).
To resolve or reopen a thread when replying to a comment:
1. In the comment text area, write your comment.
1. Select or clear **Resolve thread** or **Reopen thread**.
1. Select **Add comment now** or **Add to review**.
Pending comments display information about delayed actions. GitLab does not perform these actions
until you publish the comment:
- {{< icon name="check-circle-filled" >}} Resolves thread.
- {{< icon name="check-circle" >}} Thread stays open.
## Submit a review
When you submit a review, GitLab does the following:
- Publishes the comments in your review.
- Sends a single email to every notifiable user of the merge request, with your
review comments attached. Replying to this email creates a new comment on the merge request.
- Performs any quick actions you added to your review comments.
- Shows the outcome of your review.
1. On the top right, select **Your review** to show details about your review:

1. Review your pending comments. Edit them as needed.
1. Select the outcome of your review.
- **Approve**: Leave feedback and approve the changes.
- **Comment**: Leave general feedback without an explicit approval or change request.
- **Request changes**: Block the merge request from merging until the author
addresses your feedback.
1. Optional. Write a summary of your review. GitLab Premium and Ultimate users can select
**Add summary** ({{< icon name="tanuki-ai">}}) to create a summary for you. Include any
quick actions you want performed.
You can also use the `/submit_review` [quick action](../../quick_actions.md) in the text of a non-review comment.
### Discard your pending review
When you discard a review, your unpublished comments are deleted and you cannot restore them.
To do this:
1. On the top right, select **Your review** to show details about your review:

1. Select **Discard review**.
### Prevent merge when you request changes
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/430728) in GitLab 16.11 [with a flag](../../../../administration/feature_flags/_index.md) named `mr_reviewer_requests_changes`. Disabled by default.
- Enabled by default [on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/451211) and [GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158226) in GitLab 17.2.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/451211) in GitLab 17.3.
{{< /history >}}
A reviewer [requesting changes](#submit-a-review) blocks a merge request from merging.
When this happens, the merge request reports area shows the message
**Change requests must be approved by the requesting user**. To unblock the merge request,
the reviewer who requested changes should [re-review and approve](#re-request-a-review) the merge request.
### Remove a change request
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/480412) in GitLab 17.8.
{{< /history >}}
If you previously requested changes, you can remove your change request. You might need to do this
if both of the following are true:
- You can no longer approve the merge request.
- You want to cancel your change request, but don't want to submit a new review.
To remove your change request without submitting a new review:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. On the merge request **Overview**, scroll to the merge request reports area.
1. Next to **Change requests must be approved by the requesting user**, select **Remove**:

### Bypass a request for changes
If the user who requested changes is unavailable to re-review or approve,
another user with permission to merge the merge request can override this check:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select the title of the merge request to view it.
1. On the merge request **Overview**, scroll to the merge request reports area.
1. Next to **Change requests must be approved by the requesting user**, select **Bypass**:

1. The merge reports area shows `Merge with caution: Override added`. To see which check a user
bypassed, select **Expand merge checks** ({{< icon name="chevron-lg-down" >}}) and find the
check that contains a warning ({{< icon name="status_warning" >}}) icon. In this example, the
author bypassed **Change requests must be approved by the requesting user**:

## Download merge request changes
You can download the changes from a merge request as a diff or patch file.
For more information and examples, see
[Download merge request changes](../changes.md#download-merge-request-changes).
## Associated features
Merge requests are related to these features:
- [Cherry-pick changes](../cherry_pick_changes.md):
In the GitLab UI, select **Cherry-pick** in a merged merge request or a commit to cherry-pick it.
- [Compare changes](../changes.md):
View and download the diff of changes included in a merge request.
- [Fast-forward merge requests](../methods/_index.md#fast-forward-merge):
For a linear Git history and a way to accept merge requests without creating merge commits
- [Find the merge request that introduced a change](../versions.md):
When viewing the commit details page, GitLab links to the merge requests containing that commit.
- [Merge requests versions](../versions.md):
Select and compare the different versions of merge request diffs
- [Resolve conflicts](../conflicts.md):
GitLab can provide the option to resolve certain merge request conflicts in the GitLab UI.
- [Revert changes](../revert_changes.md):
Revert changes from any commit from a merge request.
- [Keyboard shortcuts](../../../shortcuts.md#merge-requests):
Access and change specific parts of a merge request with keyboard commands.
- [Value stream analytics](../../../group/value_stream_analytics/_index.md): Track key merge request steps (such as `reviewed` and `approved`) to identify where your team spends the most time in the software development lifecycle. This information helps uncover actionable insights to optimize merge request workflows for groups and projects, and improve developer productivity. Read more about [How we reduced MR review time with value stream analytics](https://about.gitlab.com/blog/2025/02/20/how-we-reduced-mr-review-time-with-value-stream-management/).
## Related topics
- [Compare changes in merge requests](../changes.md)
- [Compare branches](../../repository/branches/_index.md#compare-branches)
- [Merge methods](../methods/_index.md)
- [Draft Notes API](../../../../api/draft_notes.md)
|
https://docs.gitlab.com/user/project/merge_requests/suggestions
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_requests/suggestions.md
|
2025-08-13
|
doc/user/project/merge_requests/reviews
|
[
"doc",
"user",
"project",
"merge_requests",
"reviews"
] |
suggestions.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Suggest changes
|
Suggest improvements to the code in a merge request, and commit those improvements to the merge request directly from your browser.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Reviewers can suggest code changes with a Markdown syntax in merge request diff threads.
The merge request author (or other users with the appropriate role) can apply any or
all suggestions from the GitLab UI. Applying suggestions adds a commit to the
merge request, authored by the user who suggested the changes.
## Create suggestions
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. On the secondary menu, select **Changes**.
1. Find the lines of code you want to change.
- To select a single line, hover over the line number and
select **Add a comment to this line** ({{< icon name="comment" >}}).
- To select more lines:
1. Hover over the line number, and select **Add a comment to this line** ({{< icon name="comment" >}}):

1. Select and drag your selection to include all desired lines. To
learn more, see [Multi-line suggestions](#multi-line-suggestions).
1. In the comment toolbar, select **Insert suggestion** ({{< icon name="doc-code" >}}). GitLab
inserts a pre-populated code block into your comment, like this:
````markdown
```suggestion:-0+0
The content of the line you selected is shown here.
```
````
1. Edit the pre-populated code block to add your suggestion.
1. To add your comment immediately, select **Add comment now**, or use the keyboard shortcut:
- macOS: <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Enter</kbd>
- All other OSes: <kbd>Shift</kbd> + <kbd>Control</kbd> + <kbd>Enter</kbd>
1. To leave your comment unpublished until you finish a [review](_index.md), select
**Start a review**, or use the keyboard shortcut:
- macOS: <kbd>Command</kbd> + <kbd>Enter</kbd>
- All other OSes: <kbd>Control</kbd> + <kbd>Enter</kbd>
### Multi-line suggestions
{{< history >}}
- Multi-line suggestions [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/172981/) in GitLab 17.7 to support rendering when the suggestion contains a code block.
{{< /history >}}
When you review a merge request diff, you can propose changes to multiple lines (up to 200)
in a single suggestion, by either:
- Selecting and dragging, as described in [Create suggestions](#create-suggestions).
GitLab creates a suggestion block for you.
- Selecting a single line, then manually editing the range offsets in the suggestion block.
The range offsets in the first line of the suggestion describe line numbers relative
to the line you selected. The offsets specify the lines your suggestion intends to replace.
For example, this suggestion covers 2 lines above and 2 lines below the
commented line:
````markdown
```suggestion:-2+2
## Prevent approval by author
By default, the author of a merge request cannot approve it. To change this setting:
```
````
When applied, the suggestion replaces from 2 lines above to 2 lines below the commented line:

GitLab limits multi-line suggestions to 100 lines above and 100
lines below the commented diff line. This allows for up to 201 changed lines per
suggestion.
Multi-line comments display the comment's line numbers above the body of the comment:

#### Using the rich text editor
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388449) in GitLab 16.1 [with a flag](../../../../administration/feature_flags/_index.md) named `content_editor_on_issues`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/375172) in GitLab 16.2.
- Feature flag `content_editor_on_issues` removed in GitLab 16.5.
{{< /history >}}
When you insert suggestions, use the WYSIWYG [rich text editor](../../../rich_text_editor.md) to move
up and down the source file's line numbers in the UI.
To add or subtract changed lines, next to **From line**, select **+** or **-**.

## Apply suggestions
Prerequisites:
- You must be the author of the merge request, or have at least the Developer role for the project.
To apply suggested changes directly from the merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Find the comment containing the suggestion you want to apply.
- To apply suggestions individually, select **Apply suggestion**.
- To apply multiple suggestions in a single commit, select **Add suggestion to batch**.
1. Optional. Provide a custom commit message to describe your change. If you
don't provide a custom message, it uses the default commit message.
1. Select **Apply**.
After you apply a suggestion, GitLab:
- Marks the suggestion as **Applied**.
- Resolves the comment thread.
- Creates a new commit with the changes.
- (If the user has the Developer role) Pushes the suggested change directly into
the codebase in the merge request's branch.
## Configure the commit message for applied suggestions
GitLab uses a default commit message when applying suggestions, but you can change
it. This message supports placeholders. For example, the default message
`Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)` renders
like this if you apply three suggestions to two different files:
```plaintext
Apply 3 suggestion(s) to 2 file(s)
```
Merge requests created from forks use the template defined in the target project.
To meet your project's needs, customize these messages and include other
placeholder variables.
Prerequisites:
- You must have the Maintainer role.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Scroll to **Merge suggestions**, and alter the text to meet your needs.
See [Supported variables](#supported-variables) for a list of placeholders
you can use in this message.
### Supported variables
The template for commit messages for applied suggestions supports these variables:
| Variable | Description | Output example |
|------------------------|-------------|----------------|
| `%{branch_name}` | The name of the branch to which suggestions were applied. | `my-feature-branch` |
| `%{files_count}` | The number of files to which suggestions were applied.| `2` |
| `%{file_paths}` | The paths of the file to which suggestions were applied. Paths are separated by commas.| `docs/index.md, docs/about.md` |
| `%{project_path}` | The project path. | `my-group/my-project` |
| `%{project_name}` | The human-readable name of the project. | `My Project` |
| `%{suggestions_count}` | The number of suggestions applied.| `3` |
| `%{username}` | The username of the user applying suggestions. | `user_1` |
| `%{user_full_name}` | The full name of the user applying suggestions. | `User 1` |
| `%{co_authored_by}` | Names and emails of suggestion authors in a `Co-authored-by` Git commit trailer format. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
For example, to customize the commit message to output
`Addresses user_1's review`, set the custom text to
`Addresses %{username}'s review`.
## Batch suggestions
Prerequisites:
- You must have a role for the project that allows you to commit to the source branch.
To reduce the number of commits added to your branch, apply multiple
suggestions in a single commit.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. For each suggestion you want to apply, select **Add suggestion to batch**.
1. Optional. To remove a suggestion, select **Remove from batch**.
1. After you add your desired suggestions, select **Apply suggestions**.
{{< alert type="warning" >}}
If you apply a batch of suggestions containing changes from multiple authors,
the resulting commit credits you as the author. If you configure your project
to [prevent approvals from users who add commits](../approvals/settings.md#prevent-approvals-by-users-who-add-commits), you are no longer an eligible
approver for this merge request.
{{< /alert >}}
1. Optional. Provide a custom commit message for [batch suggestions](#batch-suggestions)
to describe your change. If you don't specify one, it uses
the default commit message.
## Related topics
- [Suggestions API](../../../../api/suggestions.md)
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Suggest improvements to the code in a merge request, and commit those
improvements to the merge request directly from your browser.
title: Suggest changes
breadcrumbs:
- doc
- user
- project
- merge_requests
- reviews
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Reviewers can suggest code changes with a Markdown syntax in merge request diff threads.
The merge request author (or other users with the appropriate role) can apply any or
all suggestions from the GitLab UI. Applying suggestions adds a commit to the
merge request, authored by the user who suggested the changes.
## Create suggestions
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. On the secondary menu, select **Changes**.
1. Find the lines of code you want to change.
- To select a single line, hover over the line number and
select **Add a comment to this line** ({{< icon name="comment" >}}).
- To select more lines:
1. Hover over the line number, and select **Add a comment to this line** ({{< icon name="comment" >}}):

1. Select and drag your selection to include all desired lines. To
learn more, see [Multi-line suggestions](#multi-line-suggestions).
1. In the comment toolbar, select **Insert suggestion** ({{< icon name="doc-code" >}}). GitLab
inserts a pre-populated code block into your comment, like this:
````markdown
```suggestion:-0+0
The content of the line you selected is shown here.
```
````
1. Edit the pre-populated code block to add your suggestion.
1. To add your comment immediately, select **Add comment now**, or use the keyboard shortcut:
- macOS: <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Enter</kbd>
- All other OSes: <kbd>Shift</kbd> + <kbd>Control</kbd> + <kbd>Enter</kbd>
1. To leave your comment unpublished until you finish a [review](_index.md), select
**Start a review**, or use the keyboard shortcut:
- macOS: <kbd>Command</kbd> + <kbd>Enter</kbd>
- All other OSes: <kbd>Control</kbd> + <kbd>Enter</kbd>
### Multi-line suggestions
{{< history >}}
- Multi-line suggestions [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/172981/) in GitLab 17.7 to support rendering when the suggestion contains a code block.
{{< /history >}}
When you review a merge request diff, you can propose changes to multiple lines (up to 200)
in a single suggestion, by either:
- Selecting and dragging, as described in [Create suggestions](#create-suggestions).
GitLab creates a suggestion block for you.
- Selecting a single line, then manually editing the range offsets in the suggestion block.
The range offsets in the first line of the suggestion describe line numbers relative
to the line you selected. The offsets specify the lines your suggestion intends to replace.
For example, this suggestion covers 2 lines above and 2 lines below the
commented line:
````markdown
```suggestion:-2+2
## Prevent approval by author
By default, the author of a merge request cannot approve it. To change this setting:
```
````
When applied, the suggestion replaces from 2 lines above to 2 lines below the commented line:

GitLab limits multi-line suggestions to 100 lines above and 100
lines below the commented diff line. This allows for up to 201 changed lines per
suggestion.
Multi-line comments display the comment's line numbers above the body of the comment:

#### Using the rich text editor
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388449) in GitLab 16.1 [with a flag](../../../../administration/feature_flags/_index.md) named `content_editor_on_issues`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/375172) in GitLab 16.2.
- Feature flag `content_editor_on_issues` removed in GitLab 16.5.
{{< /history >}}
When you insert suggestions, use the WYSIWYG [rich text editor](../../../rich_text_editor.md) to move
up and down the source file's line numbers in the UI.
To add or subtract changed lines, next to **From line**, select **+** or **-**.

## Apply suggestions
Prerequisites:
- You must be the author of the merge request, or have at least the Developer role for the project.
To apply suggested changes directly from the merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Find the comment containing the suggestion you want to apply.
- To apply suggestions individually, select **Apply suggestion**.
- To apply multiple suggestions in a single commit, select **Add suggestion to batch**.
1. Optional. Provide a custom commit message to describe your change. If you
don't provide a custom message, it uses the default commit message.
1. Select **Apply**.
After you apply a suggestion, GitLab:
- Marks the suggestion as **Applied**.
- Resolves the comment thread.
- Creates a new commit with the changes.
- (If the user has the Developer role) Pushes the suggested change directly into
the codebase in the merge request's branch.
## Configure the commit message for applied suggestions
GitLab uses a default commit message when applying suggestions, but you can change
it. This message supports placeholders. For example, the default message
`Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)` renders
like this if you apply three suggestions to two different files:
```plaintext
Apply 3 suggestion(s) to 2 file(s)
```
Merge requests created from forks use the template defined in the target project.
To meet your project's needs, customize these messages and include other
placeholder variables.
Prerequisites:
- You must have the Maintainer role.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Scroll to **Merge suggestions**, and alter the text to meet your needs.
See [Supported variables](#supported-variables) for a list of placeholders
you can use in this message.
### Supported variables
The template for commit messages for applied suggestions supports these variables:
| Variable | Description | Output example |
|------------------------|-------------|----------------|
| `%{branch_name}` | The name of the branch to which suggestions were applied. | `my-feature-branch` |
| `%{files_count}` | The number of files to which suggestions were applied.| `2` |
| `%{file_paths}` | The paths of the file to which suggestions were applied. Paths are separated by commas.| `docs/index.md, docs/about.md` |
| `%{project_path}` | The project path. | `my-group/my-project` |
| `%{project_name}` | The human-readable name of the project. | `My Project` |
| `%{suggestions_count}` | The number of suggestions applied.| `3` |
| `%{username}` | The username of the user applying suggestions. | `user_1` |
| `%{user_full_name}` | The full name of the user applying suggestions. | `User 1` |
| `%{co_authored_by}` | Names and emails of suggestion authors in a `Co-authored-by` Git commit trailer format. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
For example, to customize the commit message to output
`Addresses user_1's review`, set the custom text to
`Addresses %{username}'s review`.
## Batch suggestions
Prerequisites:
- You must have a role for the project that allows you to commit to the source branch.
To reduce the number of commits added to your branch, apply multiple
suggestions in a single commit.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. For each suggestion you want to apply, select **Add suggestion to batch**.
1. Optional. To remove a suggestion, select **Remove from batch**.
1. After you add your desired suggestions, select **Apply suggestions**.
{{< alert type="warning" >}}
If you apply a batch of suggestions containing changes from multiple authors,
the resulting commit credits you as the author. If you configure your project
to [prevent approvals from users who add commits](../approvals/settings.md#prevent-approvals-by-users-who-add-commits), you are no longer an eligible
approver for this merge request.
{{< /alert >}}
1. Optional. Provide a custom commit message for [batch suggestions](#batch-suggestions)
to describe your change. If you don't specify one, it uses
the default commit message.
## Related topics
- [Suggestions API](../../../../api/suggestions.md)
|
https://docs.gitlab.com/user/project/merge_requests/approvals
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_requests/_index.md
|
2025-08-13
|
doc/user/project/merge_requests/approvals
|
[
"doc",
"user",
"project",
"merge_requests",
"approvals"
] |
_index.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request approvals
|
To ensure all changes are reviewed, configure optional or required approvals for merge requests in your project.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To set up a review process for changes in your project, configure merge request approvals.
They help to ensure that changes are reviewed before they're merged into your project.
You can configure approvals to be optional or required, depending on your project's needs and GitLab tier.
- [GitLab Free](https://about.gitlab.com/pricing/) allows
all users with at least the Developer [role](../../../permissions.md) to
approve merge requests. These approvals are optional and don't prevent merging without approval.
- [GitLab Premium](https://about.gitlab.com/pricing/) and
[GitLab Ultimate](https://about.gitlab.com/pricing/) provide you with more
flexibility to:
- Create required [rules](rules.md) about the number and type of required approvals.
- Create a list of [Code Owners](../../codeowners/_index.md) for specific files.
- Configure approvals
[for the entire instance](../../../../administration/merge_requests_approvals.md).
- Configure [group merge request approval settings](../../../group/manage.md#group-merge-request-approval-settings).
{{< alert type="note" >}}
Support for group merge request approval settings is tracked in
[epic 4367](https://gitlab.com/groups/gitlab-org/-/epics/4367).
{{< /alert >}}
## Configure approval rules
Prerequisites:
- You must have at least the Developer role for the project.
To configure approval rules:
1. Go to your project's **Settings > Merge requests**.
1. Go to the **Merge request approvals** section.
1. Set up your desired rules.
You can also configure:
- More [merge request approval settings](settings.md) for more control of the
level of oversight and security your project needs.
- Merge request approval rules with the
[Merge request approvals API](../../../../api/merge_request_approvals.md).
For more information on configuring rules, see [Approval rules](rules.md).
### Required approvals
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Required approvals enforce code reviews by specified users. Without these approvals, merging is not possible.
Use cases include:
- Enforce review of all code that gets merged into a repository.
- Specify reviewers and a minimum number of approvals.
- Specify categories of reviewers, such as backend, frontend, quality assurance, database, or documentation.
- Use the [Code Owners](../../codeowners/_index.md) files to determine reviewers.
- Require approval for [declining test coverage](../../../../ci/testing/code_coverage/_index.md#add-a-coverage-check-approval-rule).
- GitLab Ultimate: [Require security team approval](../../../application_security/policies/merge_request_approval_policies.md) for potential vulnerabilities.
## View approval status
{{< history >}}
- More granular approver display [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183058) in GitLab 17.10. Feature flag `mr_approvers_filter_hidden_users` removed.
{{< /history >}}
To view the approval status of a merge request, check the merge request itself, or the list of
merge requests for your project or group.
### For a single merge request
[Eligible approvers](rules.md#eligible-approvers) can view the approval status on a single merge request.
To view the approval status:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to **Code > Merge requests** and find your merge request.
1. To view the merge request, select its title.
1. Go to the merge request widget to see the approval status. In this example, you can approve the merge request:

The widget displays one of these statuses:
- **Approve**: The merge request needs more approvals.
- **Approve additionally**: The merge request has the required approvals.
- **Revoke approval**: You have already approved the merge request.
To check if your approval satisfies Code Owner requirements, select **Expand eligible approvers** ({{< icon name="chevron-lg-down" >}}).
Approver visibility depends on your project membership, and group privacy:
- Project members see all approvers.
- Project non-members see:
- All approvers, if the approvers are all from public groups.
- No information about approvers, if any of the approvers are from private groups.
### In the list of merge requests
The list of merge requests for [your project or group](../_index.md#view-merge-requests)
shows the approval status for each merge request:
| Example | Description |
| :-----: | :---------- |
|  | Required approvals are missing. ({{< icon name="approval" >}}) |
|  | Approvals are satisfied. ({{< icon name="check" >}}) |
|  | Approvals are satisfied, and you are one of the approvers. ({{< icon name="approval-solid" >}}) |
### Individual reviewer status
To see the review and approval status for each reviewer:
1. Open the merge request.
1. Check the right sidebar.
Each reviewer's status is shown next to their name.
- {{< icon name="dash-circle" >}} Awaiting review
- {{< icon name="status_running" >}} Review in progress
- {{< icon name="check-circle" >}} Approved
- {{< icon name="comment-lines" >}} Reviewer commented
- {{< icon name="status_warning" >}} Reviewer requested changes

To [re-request a review](../reviews/_index.md#re-request-a-review), select the **Re-request a review** icon ({{< icon name="redo" >}}) next to the user.
## Approve a merge request
Eligible approvers can approve merge requests in two ways:
1. Select **Approve** in the merge request widget.
1. Use the `/approve` [quick action](../../quick_actions.md) in a comment.
Approved merge requests display a green check mark ({{< icon name="check-circle-filled" >}}) next to the user's name in the reviewer list.
After a merge request receives the required approvals, it is ready to merge, unless it's blocked due to:
- [Merge conflicts](../conflicts.md)
- [Open threads](../_index.md#prevent-merge-unless-all-threads-are-resolved)
- [Failed CI/CD pipeline](../auto_merge.md)
### Prevent author approval
To prevent merge request authors from approving their own work, enable the [Prevent approval by author](settings.md#prevent-approval-by-author) setting.
### Approval rule changes
If you enable [approval rule overrides](settings.md#prevent-editing-approval-rules-in-merge-requests), changes to default approval rules
don't affect existing merge requests, except for [target branch](rules.md#approvals-for-protected-branches) changes.
## Invalid rules
{{< history >}}
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/405023) in GitLab 16.2. Feature flag `invalid_scan_result_policy_prevents_merge` removed.
{{< /history >}}
GitLab marks approval rules as **Auto approved** when they're impossible to satisfy, such as when:
- The only eligible approver is the merge request author.
- No eligible approvers are assigned to the rule.
- The required approvals exceed the number of eligible approvers.
These rules are automatically approved to unblock merge requests, unless you created rules through a
[merge request approval policy](../../../application_security/policies/merge_request_approval_policies.md).
Invalid policy-created rules:
- Display as **Action required**.
- Are not automatically approved.
- Block affected merge requests.
## Related topics
- [Merge request approvals API](../../../../api/merge_request_approvals.md)
- [Instance approval rules](../../../../administration/merge_requests_approvals.md) for GitLab Self-Managed instances
- [Enable approval permissions for users with the Reporter role](rules.md#enable-approval-permissions-for-users-with-the-reporter-role)
- [Edit or override merge request approval rules](rules.md#edit-or-override-merge-request-approval-rules)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: To ensure all changes are reviewed, configure optional or required approvals
for merge requests in your project.
title: Merge request approvals
breadcrumbs:
- doc
- user
- project
- merge_requests
- approvals
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To set up a review process for changes in your project, configure merge request approvals.
They help to ensure that changes are reviewed before they're merged into your project.
You can configure approvals to be optional or required, depending on your project's needs and GitLab tier.
- [GitLab Free](https://about.gitlab.com/pricing/) allows
all users with at least the Developer [role](../../../permissions.md) to
approve merge requests. These approvals are optional and don't prevent merging without approval.
- [GitLab Premium](https://about.gitlab.com/pricing/) and
[GitLab Ultimate](https://about.gitlab.com/pricing/) provide you with more
flexibility to:
- Create required [rules](rules.md) about the number and type of required approvals.
- Create a list of [Code Owners](../../codeowners/_index.md) for specific files.
- Configure approvals
[for the entire instance](../../../../administration/merge_requests_approvals.md).
- Configure [group merge request approval settings](../../../group/manage.md#group-merge-request-approval-settings).
{{< alert type="note" >}}
Support for group merge request approval settings is tracked in
[epic 4367](https://gitlab.com/groups/gitlab-org/-/epics/4367).
{{< /alert >}}
## Configure approval rules
Prerequisites:
- You must have at least the Developer role for the project.
To configure approval rules:
1. Go to your project's **Settings > Merge requests**.
1. Go to the **Merge request approvals** section.
1. Set up your desired rules.
You can also configure:
- More [merge request approval settings](settings.md) for more control of the
level of oversight and security your project needs.
- Merge request approval rules with the
[Merge request approvals API](../../../../api/merge_request_approvals.md).
For more information on configuring rules, see [Approval rules](rules.md).
### Required approvals
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Required approvals enforce code reviews by specified users. Without these approvals, merging is not possible.
Use cases include:
- Enforce review of all code that gets merged into a repository.
- Specify reviewers and a minimum number of approvals.
- Specify categories of reviewers, such as backend, frontend, quality assurance, database, or documentation.
- Use the [Code Owners](../../codeowners/_index.md) files to determine reviewers.
- Require approval for [declining test coverage](../../../../ci/testing/code_coverage/_index.md#add-a-coverage-check-approval-rule).
- GitLab Ultimate: [Require security team approval](../../../application_security/policies/merge_request_approval_policies.md) for potential vulnerabilities.
## View approval status
{{< history >}}
- More granular approver display [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183058) in GitLab 17.10. Feature flag `mr_approvers_filter_hidden_users` removed.
{{< /history >}}
To view the approval status of a merge request, check the merge request itself, or the list of
merge requests for your project or group.
### For a single merge request
[Eligible approvers](rules.md#eligible-approvers) can view the approval status on a single merge request.
To view the approval status:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to **Code > Merge requests** and find your merge request.
1. To view the merge request, select its title.
1. Go to the merge request widget to see the approval status. In this example, you can approve the merge request:

The widget displays one of these statuses:
- **Approve**: The merge request needs more approvals.
- **Approve additionally**: The merge request has the required approvals.
- **Revoke approval**: You have already approved the merge request.
To check if your approval satisfies Code Owner requirements, select **Expand eligible approvers** ({{< icon name="chevron-lg-down" >}}).
Approver visibility depends on your project membership, and group privacy:
- Project members see all approvers.
- Project non-members see:
- All approvers, if the approvers are all from public groups.
- No information about approvers, if any of the approvers are from private groups.
### In the list of merge requests
The list of merge requests for [your project or group](../_index.md#view-merge-requests)
shows the approval status for each merge request:
| Example | Description |
| :-----: | :---------- |
|  | Required approvals are missing. ({{< icon name="approval" >}}) |
|  | Approvals are satisfied. ({{< icon name="check" >}}) |
|  | Approvals are satisfied, and you are one of the approvers. ({{< icon name="approval-solid" >}}) |
### Individual reviewer status
To see the review and approval status for each reviewer:
1. Open the merge request.
1. Check the right sidebar.
Each reviewer's status is shown next to their name.
- {{< icon name="dash-circle" >}} Awaiting review
- {{< icon name="status_running" >}} Review in progress
- {{< icon name="check-circle" >}} Approved
- {{< icon name="comment-lines" >}} Reviewer commented
- {{< icon name="status_warning" >}} Reviewer requested changes

To [re-request a review](../reviews/_index.md#re-request-a-review), select the **Re-request a review** icon ({{< icon name="redo" >}}) next to the user.
## Approve a merge request
Eligible approvers can approve merge requests in two ways:
1. Select **Approve** in the merge request widget.
1. Use the `/approve` [quick action](../../quick_actions.md) in a comment.
Approved merge requests display a green check mark ({{< icon name="check-circle-filled" >}}) next to the user's name in the reviewer list.
After a merge request receives the required approvals, it is ready to merge, unless it's blocked due to:
- [Merge conflicts](../conflicts.md)
- [Open threads](../_index.md#prevent-merge-unless-all-threads-are-resolved)
- [Failed CI/CD pipeline](../auto_merge.md)
### Prevent author approval
To prevent merge request authors from approving their own work, enable the [Prevent approval by author](settings.md#prevent-approval-by-author) setting.
### Approval rule changes
If you enable [approval rule overrides](settings.md#prevent-editing-approval-rules-in-merge-requests), changes to default approval rules
don't affect existing merge requests, except for [target branch](rules.md#approvals-for-protected-branches) changes.
## Invalid rules
{{< history >}}
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/405023) in GitLab 16.2. Feature flag `invalid_scan_result_policy_prevents_merge` removed.
{{< /history >}}
GitLab marks approval rules as **Auto approved** when they're impossible to satisfy, such as when:
- The only eligible approver is the merge request author.
- No eligible approvers are assigned to the rule.
- The required approvals exceed the number of eligible approvers.
These rules are automatically approved to unblock merge requests, unless you created rules through a
[merge request approval policy](../../../application_security/policies/merge_request_approval_policies.md).
Invalid policy-created rules:
- Display as **Action required**.
- Are not automatically approved.
- Block affected merge requests.
## Related topics
- [Merge request approvals API](../../../../api/merge_request_approvals.md)
- [Instance approval rules](../../../../administration/merge_requests_approvals.md) for GitLab Self-Managed instances
- [Enable approval permissions for users with the Reporter role](rules.md#enable-approval-permissions-for-users-with-the-reporter-role)
- [Edit or override merge request approval rules](rules.md#edit-or-override-merge-request-approval-rules)
|
https://docs.gitlab.com/user/project/merge_requests/settings
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_requests/settings.md
|
2025-08-13
|
doc/user/project/merge_requests/approvals
|
[
"doc",
"user",
"project",
"merge_requests",
"approvals"
] |
settings.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request approval settings
|
Define approval rules and limits in GitLab with merge request approval settings. Options include preventing author approval, requiring re-authentication, and removing approvals on new commits.
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can configure the settings for [merge request approvals](_index.md) to
ensure the approval rules meet your use case. You can also configure
[approval rules](rules.md), which define the number and type of users who must
approve work before it's merged. Merge request approval settings define how
to apply those rules as a merge request moves toward completion.
Use any combination of these settings to configure approval limits for merge requests:
- [**Prevent approval by author**](#prevent-approval-by-author):
Prevents the author of a merge request from approving it.
- [**Prevent approvals by users who add commits**](#prevent-approvals-by-users-who-add-commits):
Prevents users who add commits to a merge request from also approving it.
- [**Prevent editing approval rules in merge requests**](#prevent-editing-approval-rules-in-merge-requests):
Prevents users from overriding project approval rules on merge requests.
- [**Require user re-authentication (password or SAML) to approve**](#require-user-re-authentication-to-approve):
Force potential approvers to first authenticate with either a password or with SAML.
- Code Owner approval removals: Define what happens to existing approvals when
commits are added to the merge request.
- **Keep approvals**: Do not remove any approvals.
- [**Remove all approvals**](#remove-all-approvals-when-commits-are-added-to-the-source-branch):
Remove all existing approvals.
- [**Remove approvals by Code Owners if their files changed**](#remove-approvals-by-code-owners-if-their-files-changed):
If a Code Owner approves a merge request, and a later commit changes files
they are a Code Owner for, their approval is removed.
## Edit merge request approval settings
To view or edit merge request approval settings for a single project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Expand **Approvals**.
### Cascade settings from the instance or top-level group
To simplify the management of approval rule settings, configure the approval rules
at the broadest possible level. Rules created:
- [For your instance](../../../../administration/merge_requests_approvals.md) apply to all groups
and projects on an instance.
- On a [top-level group](../../../group/manage.md#group-merge-request-approval-settings) apply to all subgroups
and projects.
If a group or project inherits settings, you can't change them in the inheriting group or project.
You must change the settings where they originated: the top-level group or instance.
## Prevent approval by author
By default, the author of a merge request cannot approve it. To change this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
clear the **Prevent approval by author** checkbox.
1. Select **Save changes**.
Authors can edit the approval rule in an individual merge request and override
this setting, unless you configure one of these options:
- [Prevent overrides of default approvals](#prevent-editing-approval-rules-in-merge-requests) for your project.
- *(GitLab Self-Managed instances only)* Prevent overrides of default approvals
[for your instance](../../../../administration/merge_requests_approvals.md). When configured
for your instance, you can't edit this setting on projects or individual
merge requests.
## Prevent approvals by users who add commits
{{< history >}}
- [Feature flag `keep_merge_commits_for_approvals`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127744) added in GitLab 16.3 to also include merge commits in this check.
- [Feature flag `keep_merge_commits_for_approvals`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131778) removed in GitLab 16.5. This check now includes merge commits.
{{< /history >}}
By default, users who commit to a merge request can still approve it. You can prevent committers
in your project or on your instance from approving merge requests that are partially
their own:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Prevent approvals by users who add commits**.
If this checkbox is cleared, an administrator has disabled it
[for your instance](../../../../administration/merge_requests_approvals.md), and
you can't change it for your project.
1. Select **Save changes**.
[Code owners](../../codeowners/_index.md) who commit to a merge request cannot approve it,
if the merge request affects files they own.
For more information, see the [official Git documentation](https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History).
## Prevent editing approval rules in merge requests
By default, users can override the approval rules you [create for a project](rules.md)
on a per-merge-request basis. If you don't want users to change approval rules
on merge requests, you can disable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Prevent editing approval rules in merge requests**.
1. Select **Save changes**.
This change affects all open merge requests.
When you change this field, it can affect all open merge requests depending on the setting:
- If users could edit approval rules previously, and you disable this behavior,
GitLab updates all open merge requests to enforce the approval rules.
- If users could not edit approval rules previously, and you enable approval rule
editing, open merge requests remain unchanged. This preserves any changes already
made to approval rules in those merge requests.
## Require user re-authentication to approve
{{< history >}}
- Requiring re-authentication by using SAML authentication for GitLab.com groups [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/5981) in GitLab 16.6 [with a flag](../../../../administration/feature_flags/_index.md) named `ff_require_saml_auth_to_approve`. Disabled by default.
- Requiring re-authentication by using SAML authentication for GitLab Self-Managed instances [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/431415) in GitLab 16.7 [with a flag](../../../../administration/feature_flags/_index.md) named `ff_require_saml_auth_to_approve`. Disabled by default.
- [Enabled `ff_require_saml_auth_to_approve` by default](https://gitlab.com/gitlab-org/gitlab/-/issues/431714) in GitLab 16.8 for GitLab.com and GitLab Self-Managed instances.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default requiring re-authentication by using SAML authentication is available. To hide the feature, an administrator can
[disable the feature flag](../../../../administration/feature_flags/_index.md) named `ff_require_saml_auth_to_approve`. On GitLab.com and GitLab Dedicated, this feature is available.
{{< /alert >}}
You can force potential approvers to first authenticate with SAML or a password.
This permission enables an electronic signature for approvals, such as the one defined by
[Code of Federal Regulations (CFR) Part 11](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?CFRPart=11&showFR=1&subpartNode=21:1.0.1.1.8.3).
Prerequisites:
- This setting is only available on top-level groups.
1. On the left sidebar, select **Search or go to** and find your project.
1. Enable password authentication and SAML authentication. For more information on:
- Password authentication, see
[sign-in restrictions documentation](../../../../administration/settings/sign_in_restrictions.md#password-authentication-enabled).
- SAML authentication for GitLab.com groups, see
[SAML SSO for GitLab.com groups documentation](../../../group/saml_sso/_index.md).
- SAML authentication for GitLab Self-Managed instances, see
[SAML SSO for GitLab Self-Managed](../../../../integration/saml.md).
1. On the left sidebar, select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Require user re-authentication (password or SAML) to approve**.
1. Select **Save changes**.
## Remove all approvals when commits are added to the source branch
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
By default, an approval on a merge request is removed when you add more changes
after the approval.
GitLab uses [`git patch-id`](https://git-scm.com/docs/git-patch-id) to identify diffs
in merge requests. This value is a reasonably stable and unique identifier, and it enables
smarter decisions about resetting approvals inside a merge request. When you push new changes
to a merge request, the `patch-id` is evaluated against the previous `patch-id` to determine
if the approvals should be reset. This enables GitLab to make better reset decisions when
you perform commands like `git rebase` or `git merge <target>` on a feature branch.
To keep existing approvals after more changes are added to a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
clear the **Remove all approvals** checkbox.
1. Select **Save changes**.
If you automate the creation and approval of merge requests, build in logic to ensure commits are
processed fully before approving the merge request. This prevents an unintentional approval reset.
See [Approvals for automated merge requests](../../../../api/merge_request_approvals.md#approvals-for-automated-merge-requests)
for more details.
## Remove approvals by Code Owners if their files changed
To remove approvals only from Code Owners whose files change in a new commit:
Prerequisites:
- You must have at least the Maintainer role for a project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Remove approvals by Code Owners if their files changed**.
1. Select **Save changes**.
## Related topics
- [Merge request approval settings for your instance](../../../../administration/merge_requests_approvals.md)
- [Compliance center](../../../compliance/compliance_center/_index.md)
- [Merge request approvals API](../../../../api/merge_request_approvals.md)
- [Merge request approval settings API](../../../../api/merge_request_approval_settings.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Define approval rules and limits in GitLab with merge request approval
settings. Options include preventing author approval, requiring re-authentication,
and removing approvals on new commits.
title: Merge request approval settings
breadcrumbs:
- doc
- user
- project
- merge_requests
- approvals
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can configure the settings for [merge request approvals](_index.md) to
ensure the approval rules meet your use case. You can also configure
[approval rules](rules.md), which define the number and type of users who must
approve work before it's merged. Merge request approval settings define how
to apply those rules as a merge request moves toward completion.
Use any combination of these settings to configure approval limits for merge requests:
- [**Prevent approval by author**](#prevent-approval-by-author):
Prevents the author of a merge request from approving it.
- [**Prevent approvals by users who add commits**](#prevent-approvals-by-users-who-add-commits):
Prevents users who add commits to a merge request from also approving it.
- [**Prevent editing approval rules in merge requests**](#prevent-editing-approval-rules-in-merge-requests):
Prevents users from overriding project approval rules on merge requests.
- [**Require user re-authentication (password or SAML) to approve**](#require-user-re-authentication-to-approve):
Force potential approvers to first authenticate with either a password or with SAML.
- Code Owner approval removals: Define what happens to existing approvals when
commits are added to the merge request.
- **Keep approvals**: Do not remove any approvals.
- [**Remove all approvals**](#remove-all-approvals-when-commits-are-added-to-the-source-branch):
Remove all existing approvals.
- [**Remove approvals by Code Owners if their files changed**](#remove-approvals-by-code-owners-if-their-files-changed):
If a Code Owner approves a merge request, and a later commit changes files
they are a Code Owner for, their approval is removed.
## Edit merge request approval settings
To view or edit merge request approval settings for a single project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Expand **Approvals**.
### Cascade settings from the instance or top-level group
To simplify the management of approval rule settings, configure the approval rules
at the broadest possible level. Rules created:
- [For your instance](../../../../administration/merge_requests_approvals.md) apply to all groups
and projects on an instance.
- On a [top-level group](../../../group/manage.md#group-merge-request-approval-settings) apply to all subgroups
and projects.
If a group or project inherits settings, you can't change them in the inheriting group or project.
You must change the settings where they originated: the top-level group or instance.
## Prevent approval by author
By default, the author of a merge request cannot approve it. To change this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
clear the **Prevent approval by author** checkbox.
1. Select **Save changes**.
Authors can edit the approval rule in an individual merge request and override
this setting, unless you configure one of these options:
- [Prevent overrides of default approvals](#prevent-editing-approval-rules-in-merge-requests) for your project.
- *(GitLab Self-Managed instances only)* Prevent overrides of default approvals
[for your instance](../../../../administration/merge_requests_approvals.md). When configured
for your instance, you can't edit this setting on projects or individual
merge requests.
## Prevent approvals by users who add commits
{{< history >}}
- [Feature flag `keep_merge_commits_for_approvals`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127744) added in GitLab 16.3 to also include merge commits in this check.
- [Feature flag `keep_merge_commits_for_approvals`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131778) removed in GitLab 16.5. This check now includes merge commits.
{{< /history >}}
By default, users who commit to a merge request can still approve it. You can prevent committers
in your project or on your instance from approving merge requests that are partially
their own:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Prevent approvals by users who add commits**.
If this checkbox is cleared, an administrator has disabled it
[for your instance](../../../../administration/merge_requests_approvals.md), and
you can't change it for your project.
1. Select **Save changes**.
[Code owners](../../codeowners/_index.md) who commit to a merge request cannot approve it,
if the merge request affects files they own.
For more information, see the [official Git documentation](https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History).
## Prevent editing approval rules in merge requests
By default, users can override the approval rules you [create for a project](rules.md)
on a per-merge-request basis. If you don't want users to change approval rules
on merge requests, you can disable this setting:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Prevent editing approval rules in merge requests**.
1. Select **Save changes**.
This change affects all open merge requests.
When you change this field, it can affect all open merge requests depending on the setting:
- If users could edit approval rules previously, and you disable this behavior,
GitLab updates all open merge requests to enforce the approval rules.
- If users could not edit approval rules previously, and you enable approval rule
editing, open merge requests remain unchanged. This preserves any changes already
made to approval rules in those merge requests.
## Require user re-authentication to approve
{{< history >}}
- Requiring re-authentication by using SAML authentication for GitLab.com groups [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/5981) in GitLab 16.6 [with a flag](../../../../administration/feature_flags/_index.md) named `ff_require_saml_auth_to_approve`. Disabled by default.
- Requiring re-authentication by using SAML authentication for GitLab Self-Managed instances [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/431415) in GitLab 16.7 [with a flag](../../../../administration/feature_flags/_index.md) named `ff_require_saml_auth_to_approve`. Disabled by default.
- [Enabled `ff_require_saml_auth_to_approve` by default](https://gitlab.com/gitlab-org/gitlab/-/issues/431714) in GitLab 16.8 for GitLab.com and GitLab Self-Managed instances.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default requiring re-authentication by using SAML authentication is available. To hide the feature, an administrator can
[disable the feature flag](../../../../administration/feature_flags/_index.md) named `ff_require_saml_auth_to_approve`. On GitLab.com and GitLab Dedicated, this feature is available.
{{< /alert >}}
You can force potential approvers to first authenticate with SAML or a password.
This permission enables an electronic signature for approvals, such as the one defined by
[Code of Federal Regulations (CFR) Part 11](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?CFRPart=11&showFR=1&subpartNode=21:1.0.1.1.8.3).
Prerequisites:
- This setting is only available on top-level groups.
1. On the left sidebar, select **Search or go to** and find your project.
1. Enable password authentication and SAML authentication. For more information on:
- Password authentication, see
[sign-in restrictions documentation](../../../../administration/settings/sign_in_restrictions.md#password-authentication-enabled).
- SAML authentication for GitLab.com groups, see
[SAML SSO for GitLab.com groups documentation](../../../group/saml_sso/_index.md).
- SAML authentication for GitLab Self-Managed instances, see
[SAML SSO for GitLab Self-Managed](../../../../integration/saml.md).
1. On the left sidebar, select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Require user re-authentication (password or SAML) to approve**.
1. Select **Save changes**.
## Remove all approvals when commits are added to the source branch
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
By default, an approval on a merge request is removed when you add more changes
after the approval.
GitLab uses [`git patch-id`](https://git-scm.com/docs/git-patch-id) to identify diffs
in merge requests. This value is a reasonably stable and unique identifier, and it enables
smarter decisions about resetting approvals inside a merge request. When you push new changes
to a merge request, the `patch-id` is evaluated against the previous `patch-id` to determine
if the approvals should be reset. This enables GitLab to make better reset decisions when
you perform commands like `git rebase` or `git merge <target>` on a feature branch.
To keep existing approvals after more changes are added to a merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
clear the **Remove all approvals** checkbox.
1. Select **Save changes**.
If you automate the creation and approval of merge requests, build in logic to ensure commits are
processed fully before approving the merge request. This prevents an unintentional approval reset.
See [Approvals for automated merge requests](../../../../api/merge_request_approvals.md#approvals-for-automated-merge-requests)
for more details.
## Remove approvals by Code Owners if their files changed
To remove approvals only from Code Owners whose files change in a new commit:
Prerequisites:
- You must have at least the Maintainer role for a project.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval settings** and
select **Remove approvals by Code Owners if their files changed**.
1. Select **Save changes**.
## Related topics
- [Merge request approval settings for your instance](../../../../administration/merge_requests_approvals.md)
- [Compliance center](../../../compliance/compliance_center/_index.md)
- [Merge request approvals API](../../../../api/merge_request_approvals.md)
- [Merge request approval settings API](../../../../api/merge_request_approval_settings.md)
|
https://docs.gitlab.com/user/project/merge_requests/rules
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_requests/rules.md
|
2025-08-13
|
doc/user/project/merge_requests/approvals
|
[
"doc",
"user",
"project",
"merge_requests",
"approvals"
] |
rules.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge request approval rules
|
Use approval rules to define the users or groups who should approve merge requests. Approvers can be optional or required.
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Approval rules define how many [approvals](_index.md) a merge request must receive before it can
be merged, and which users should do the approving. They can be used in conjunction
with [code owners](#code-owners-as-approvers) to ensure that changes are
reviewed both by the group maintaining the feature, and any groups responsible
for specific areas of oversight.
You can define approval rules:
- [As project defaults](#add-an-approval-rule).
- [Per merge request](#edit-or-override-merge-request-approval-rules).
You can configure approval rules:
- [For the entire instance](../../../../administration/merge_requests_approvals.md).
If you don't define a [default approval rule](#add-an-approval-rule),
any user can approve a merge request. Even if you don't define a rule, you can still
enforce a [minimum number of required approvers](settings.md) in the project's settings.
Merge requests that target a different project, such as from a fork to the upstream project,
use the default approval rules from the target (upstream) project, not the source (fork).
Merge request approvals can be configured globally to apply across all (or a subset) projects with [policies](../../../application_security/policies/_index.md). [Merge request approval policies](../../../application_security/policies/merge_request_approval_policies.md) also provide additional flexibility with more granular configuration options.
## Add an approval rule
Prerequisites:
- You must have at least the Maintainer role for the project.
- To add a group as an approver in GitLab.com, you must be a member of the group or the
group must be public.
To add a merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section, select
**Add approval rule**.
1. On the right sidebar, complete the fields:
- In **Approvals required**, a value of `0` makes
[the rule optional](#configure-optional-approval-rules), and any number greater than `0`
creates a required rule.
Maximum number of required approvals is `100`.
- From **Add approvers**, select users or groups that are
[eligible to approve](#eligible-approvers).
GitLab suggests approvers based on previous authors of the files changed by the merge request.
1. Select **Save changes**. You can add [multiple approval rules](#multiple-approval-rules).
Your configuration for approval rule overrides determines if the new rule is applied
to existing merge requests:
- If [approval rule overrides](settings.md#prevent-editing-approval-rules-in-merge-requests) are allowed,
changes to these default rules are not applied to existing merge requests, except for
changes to the [target branch](#approvals-for-protected-branches) of the rule.
- If approval rule overrides are not allowed, all changes to default rules
are applied to existing merge requests. Any approval rules that were previously
manually [overridden](#edit-or-override-merge-request-approval-rules) during the
period when approval rule overrides where allowed, are not modified.
## Edit an approval rule
Prerequisites:
- You must have at least the Maintainer role for the project.
- To add a group as an approver in GitLab.com, you must be a member of the group or the
group must be public.
To edit a merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section, next to the rule you want to edit, select **Edit**.
1. On the right sidebar, edit the fields:
- In **Approvals required**, a value of `0` makes
[the rule optional](#configure-optional-approval-rules), and any number greater than `0`
creates a required rule.
Maximum number of required approvals is `100`.
- To remove users or groups, identify the group or user to remove, and select **Remove**
({{< icon name="remove" >}}).
1. Select **Save changes**.
## Delete an approval rule
Prerequisites:
- You must have at least the Maintainer role for the project.
To delete a merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, next to the rule you want to delete, select the trash can ({{< icon name="remove" >}}).
1. Select **Remove approvers**.
## Multiple approval rules
To enforce multiple approval rules on a merge request, add multiple default approval rules for a project.
When an [eligible approver](#eligible-approvers) approves a merge request, it
reduces the number of approvals left (the **Approvals** column) for all rules that the approver belongs to:

<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Multiple Approvers](https://www.youtube.com/watch?v=8JQJ5821FrA).
## Get notified about all merge requests you can approve
To get email notifications every time a merge request you're eligible to approve is created:
- [Set your notification level](../../../profile/notifications.md#edit-notification-settings) to **Custom**
and select the **Merge request you're eligible to approve is created** event.
## Edit or override merge request approval rules
You can override the merge request approval rules for a project by either:
- Editing an existing merge request.
- Creating a new merge request.
Prerequisites:
- You must have administrator access or all of the following must be true:
- You must have at least the Developer role or the project must accept contributions from external members.
- You must be the author of the merge request.
- The project setting [Prevent editing approval rules](settings.md#prevent-editing-approval-rules-in-merge-requests) is disabled.
To override approvers of a merge request:
1. When [creating a new merge request](../creating_merge_requests.md), scroll to the **Approval Rules** section,
and add or remove your desired approval rules before selecting **Create merge request**.
1. When viewing an existing merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select **Edit**.
1. Scroll to the **Approval Rules** section.
1. Add or remove your desired approval rules.
1. Select **Save changes**.
Administrators can change the [merge request approvals settings](settings.md#prevent-editing-approval-rules-in-merge-requests)
to prevent users from overriding approval rules for merge requests.
## Require multiple approvals for a rule
To create an approval rule which requires more than one approval:
- When you [create](#add-an-approval-rule) or [edit](#edit-an-approval-rule) a rule, set **Approvals required** to `2` or more.
To require multiple approvals for a rule, you can also
[use the API](../../../../api/merge_request_approvals.md#update-an-approval-rule-for-a-project)
to set the `approvals_required` attribute to `2` or more.
## Configure optional approval rules
Merge request approvals can be optional for projects where approvals are
appreciated, but not required. To make an approval rule optional:
- When you [create or edit a rule](#edit-an-approval-rule), set **Approvals required** to `0`.
To make an approval rule optional, you can also use the API to
[update an approval rule for a project](../../../../api/merge_request_approvals.md#update-an-approval-rule-for-a-project),
and set the `approvals_required` attribute to `0`.
## Approvals for protected branches
Approval rules are often relevant only to specific branches, like your
[default branch](../../repository/branches/default.md). To configure an
approval rule for certain branches:
1. [Create an approval rule](#add-an-approval-rule).
1. Go to your project and select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval rules**.
1. For **Target branch**:
- To apply the rule to all protected branches, select **All protected branches**.
- To apply the rule to a specific branch, select it from the list.
1. To enable this configuration, follow
[Require Code Owner approval on a protected branch](../../repository/branches/protected.md#require-code-owner-approval).
## Enable approval permissions for users with the Reporter role
Before users with the Reporter role can merge to a protected branch, you might have to grant them
permission to approve merge requests.
Some users (like managers) might not need permission to push or merge code, but still need
oversight on proposed work.
Users with the Reporter role can approve merge requests only through regular approval rules.
Code owner approval rules require users to have at least the Developer role. For more information,
see [Eligible approvers](#eligible-approvers).
Prerequisites:
- You must select a specific branch, as this method does not work with `All Branches` or `All protected branches` settings.
- The shared group must be added to an approval rule and not individual users, even when the added user is part of the group.
To enable approval permissions for these users without granting them push access:
1. [Create a protected branch](../../repository/branches/protected.md)
1. [Create a new group](../../../group/_index.md#create-a-group).
1. [Add the user to the group](../../../group/_index.md#add-users-to-a-group),
and select the Reporter role for the user. Do not assign roles with higher permissions than
Reporter due to a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/492467).
Assigning higher roles may result in unexpected behavior.
1. [Share the project with your group](../../members/sharing_projects_groups.md#invite-a-group-to-a-project),
with at least the Reporter role.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section:
- For a new rule, select **Add approval rule** and target the protected branch.
- For an existing rule, select **Edit** and target the protected branch.
1. On the right sidebar, in **Add approvers**, select the group you created.
1. Select **Save changes**.
## Security Approvals
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Bot comment for approvals [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/411656) in GitLab 16.2 [with a flag](../../../../administration/feature_flags/_index.md) named `security_policy_approval_notification`. Enabled by default.
- Bot comment for approvals [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130827) in GitLab 16.3. Feature flag `security_policy_approval_notification` removed.
{{< /history >}}
You can use [merge request approval policies](../../../application_security/policies/merge_request_approval_policies.md#merge-request-approval-policy-editor) to define security approvals based on the status of vulnerabilities in the merge request and the default branch.
Details for each security policy is shown in the Security Approvals section of your Merge Request configuration.
The security approval rules are applied to all merge requests until the pipeline is complete. The application of the
security approval rules prevents users from merging in code before the security scans run. After the pipeline is
complete, the security approval rules are checked to determine if the security approvals are still required.
In case the scanners in the pipeline identify an issue and security approvals are required, a bot comment is generated
on the merge request to indicate which steps are needed to proceed.

These policies are both created and edited in the [security policy editor](../../../application_security/policies/_index.md#policy-editor).
## Eligible approvers
To be eligible as an approver for your project, a user must be a direct member of at least one of the following:
- Your project.
- Your project's group.
- Any of your project's group's parent groups.
- Another group that has been [shared with your project](../../members/sharing_projects_groups.md#sharing-projects).
- Another group that has been [shared with your project's group or any of the group's parents](../../members/sharing_projects_groups.md#sharing-groups).
- A [group added as approvers](#group-approvers).
Users with the Developer role can approve merge requests if one of the following is true:
- Users added as approvers at the project or merge request level.
- Users who are [Code owners](#code-owners-as-approvers) of the files
changed in the merge request.
Users with the Reporter role can approve only if all of the following are true:
- The users are part of a group that has been [shared](../../members/sharing_projects_groups.md) with the project.
The group must have at least the Reporter role.
- The group has been added as merge request approvers.
- Approval permissions for users with the reporter role [are enabled](#enable-approval-permissions-for-users-with-the-reporter-role).
To show who has participated in the merge request review, the Approvals widget in
a merge request displays a **Commented by** column. This column lists eligible approvers
who commented on the merge request. It helps authors and reviewers identify who to
contact with questions about the merge request's content.
If the number of required approvals is greater than the number of assigned approvers,
approvals from other users with at least the Developer role
in the project count toward meeting the required number of approvals, even if the
users were not explicitly listed in the approval rules.
### Code owners as approvers
If you add [code owners](../../codeowners/_index.md) to your repository, the owners of files
become eligible approvers in the project. To enable this merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section, locate the **All eligible users** rule.
1. In the **Approvals required** column, enter the number of approvals required.
You can also
[require code owner approval](../../repository/branches/protected.md#require-code-owner-approval)
for protected branches.
### Approver by membership type
The following tables show how membership type affects eligibility for both approval rules and
Code Owners.
#### User eligibility
When you assign individual users as approvers for approval rules or reference users in `CODEOWNERS`
files, like `@username`:
| Membership type | Approval rules | Code Owners |
|--------------------------------------------------------------------------------------------------------------------|---------------------------------------------|-------------|
| Direct member of the project | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Direct member of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Direct member of a [group invited to the project](../../members/sharing_projects_groups.md#sharing-projects) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of a group invited to the project | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
| Direct member of a [group invited to the project's group](../../members/sharing_projects_groups.md#sharing-groups) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of a group invited to the project's group | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
| Direct member of a group invited to the project's group's parent groups | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of a group invited to the project's group's parent groups | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
#### Group eligibility
When you assign groups as approvers for approval rules or reference groups in `CODEOWNERS` files,
like `@group-name`, only direct members of eligible groups can provide approvals:
| Group type | Approval rules | Code Owners |
|------------|----------------|-------------|
| [Groups invited to the project](../../members/sharing_projects_groups.md#sharing-projects) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Groups invited to the project's group](../../members/sharing_projects_groups.md#sharing-groups) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No |
| Groups invited to a parent of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No |
| The project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| A parent of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
{{< alert type="note" >}}
For group-based approvals, only direct members of the group can approve merge requests.
Inherited members of the eligible groups cannot provide approvals.
{{< /alert >}}
### Group approvers
You can add a group of users as approvers. All direct members of this group
can approve the rule. Inherited members cannot approve the rule.
Typically the group is a subgroup in your top-level namespace, unless you are
collaborating with an external group. If you are collaborating with another group
and want to use members of that group as approvers, you can either:
- [Share access to the project](../../members/sharing_projects_groups.md#sharing-projects).
- [Share access to your project's group](../../members/sharing_projects_groups.md#sharing-groups),
which gives the external group approval access to all projects in your project's group.
A user's membership in an approver group determines their individual approval permissions
in the following ways:
- Inherited members are not considered approvers. Only direct members can approve merge requests.
- A user from a group approver group who is later also added as an individual approver
counts as one approver, not two.
- Merge request authors do not count as eligible approvers on their own merge requests by default.
To change this behavior, disable the
[**Prevent author approval**](settings.md#prevent-approval-by-author)
project setting.
- By default, committers to merge requests can approve a merge request. To change this behavior, enable
the [**Prevent committers approval**](settings.md#prevent-approvals-by-users-who-add-commits)
project setting.
## Troubleshooting
### Approval rule name can't be blank
As a workaround for this validation error, you can delete the approval rule through
the API.
1. [List all approval rules for the project](../../../../api/merge_request_approvals.md#list-all-approval-rules-for-a-project).
1. [DELETE the rule](../../../../api/merge_request_approvals.md#delete-an-approval-rule-for-a-project).
For more information about this validation error, read
[issue 285129](https://gitlab.com/gitlab-org/gitlab/-/issues/285129).
### Groups need explicit or inherited Developer role on a project
A group created to handle approvals may be created in a different area of the
project hierarchy than the project requiring review. If this happens, members of the
group may not have permission to approve the merge request as they do not have access to it.
For example:
In the group structure below, project 1 belongs to subgroup 1 and subgroup 4 has users.

Project 1 has configured an approval rule for the project, which assigns subgroup 4 as approvers.
When a merge request is created, approvers from subgroup 4 appear in the eligible approvers list.
However, as users from subgroup 4 do not have permission to view the merge request, the `404` error is returned.
To grant membership, the group must be invited as a project member. It is now possible for users from subgroup 4 to approve.

|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use approval rules to define the users or groups who should approve merge
requests. Approvers can be optional or required.
title: Merge request approval rules
breadcrumbs:
- doc
- user
- project
- merge_requests
- approvals
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Approval rules define how many [approvals](_index.md) a merge request must receive before it can
be merged, and which users should do the approving. They can be used in conjunction
with [code owners](#code-owners-as-approvers) to ensure that changes are
reviewed both by the group maintaining the feature, and any groups responsible
for specific areas of oversight.
You can define approval rules:
- [As project defaults](#add-an-approval-rule).
- [Per merge request](#edit-or-override-merge-request-approval-rules).
You can configure approval rules:
- [For the entire instance](../../../../administration/merge_requests_approvals.md).
If you don't define a [default approval rule](#add-an-approval-rule),
any user can approve a merge request. Even if you don't define a rule, you can still
enforce a [minimum number of required approvers](settings.md) in the project's settings.
Merge requests that target a different project, such as from a fork to the upstream project,
use the default approval rules from the target (upstream) project, not the source (fork).
Merge request approvals can be configured globally to apply across all (or a subset) projects with [policies](../../../application_security/policies/_index.md). [Merge request approval policies](../../../application_security/policies/merge_request_approval_policies.md) also provide additional flexibility with more granular configuration options.
## Add an approval rule
Prerequisites:
- You must have at least the Maintainer role for the project.
- To add a group as an approver in GitLab.com, you must be a member of the group or the
group must be public.
To add a merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section, select
**Add approval rule**.
1. On the right sidebar, complete the fields:
- In **Approvals required**, a value of `0` makes
[the rule optional](#configure-optional-approval-rules), and any number greater than `0`
creates a required rule.
Maximum number of required approvals is `100`.
- From **Add approvers**, select users or groups that are
[eligible to approve](#eligible-approvers).
GitLab suggests approvers based on previous authors of the files changed by the merge request.
1. Select **Save changes**. You can add [multiple approval rules](#multiple-approval-rules).
Your configuration for approval rule overrides determines if the new rule is applied
to existing merge requests:
- If [approval rule overrides](settings.md#prevent-editing-approval-rules-in-merge-requests) are allowed,
changes to these default rules are not applied to existing merge requests, except for
changes to the [target branch](#approvals-for-protected-branches) of the rule.
- If approval rule overrides are not allowed, all changes to default rules
are applied to existing merge requests. Any approval rules that were previously
manually [overridden](#edit-or-override-merge-request-approval-rules) during the
period when approval rule overrides where allowed, are not modified.
## Edit an approval rule
Prerequisites:
- You must have at least the Maintainer role for the project.
- To add a group as an approver in GitLab.com, you must be a member of the group or the
group must be public.
To edit a merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section, next to the rule you want to edit, select **Edit**.
1. On the right sidebar, edit the fields:
- In **Approvals required**, a value of `0` makes
[the rule optional](#configure-optional-approval-rules), and any number greater than `0`
creates a required rule.
Maximum number of required approvals is `100`.
- To remove users or groups, identify the group or user to remove, and select **Remove**
({{< icon name="remove" >}}).
1. Select **Save changes**.
## Delete an approval rule
Prerequisites:
- You must have at least the Maintainer role for the project.
To delete a merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, next to the rule you want to delete, select the trash can ({{< icon name="remove" >}}).
1. Select **Remove approvers**.
## Multiple approval rules
To enforce multiple approval rules on a merge request, add multiple default approval rules for a project.
When an [eligible approver](#eligible-approvers) approves a merge request, it
reduces the number of approvals left (the **Approvals** column) for all rules that the approver belongs to:

<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Multiple Approvers](https://www.youtube.com/watch?v=8JQJ5821FrA).
## Get notified about all merge requests you can approve
To get email notifications every time a merge request you're eligible to approve is created:
- [Set your notification level](../../../profile/notifications.md#edit-notification-settings) to **Custom**
and select the **Merge request you're eligible to approve is created** event.
## Edit or override merge request approval rules
You can override the merge request approval rules for a project by either:
- Editing an existing merge request.
- Creating a new merge request.
Prerequisites:
- You must have administrator access or all of the following must be true:
- You must have at least the Developer role or the project must accept contributions from external members.
- You must be the author of the merge request.
- The project setting [Prevent editing approval rules](settings.md#prevent-editing-approval-rules-in-merge-requests) is disabled.
To override approvers of a merge request:
1. When [creating a new merge request](../creating_merge_requests.md), scroll to the **Approval Rules** section,
and add or remove your desired approval rules before selecting **Create merge request**.
1. When viewing an existing merge request:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Select **Edit**.
1. Scroll to the **Approval Rules** section.
1. Add or remove your desired approval rules.
1. Select **Save changes**.
Administrators can change the [merge request approvals settings](settings.md#prevent-editing-approval-rules-in-merge-requests)
to prevent users from overriding approval rules for merge requests.
## Require multiple approvals for a rule
To create an approval rule which requires more than one approval:
- When you [create](#add-an-approval-rule) or [edit](#edit-an-approval-rule) a rule, set **Approvals required** to `2` or more.
To require multiple approvals for a rule, you can also
[use the API](../../../../api/merge_request_approvals.md#update-an-approval-rule-for-a-project)
to set the `approvals_required` attribute to `2` or more.
## Configure optional approval rules
Merge request approvals can be optional for projects where approvals are
appreciated, but not required. To make an approval rule optional:
- When you [create or edit a rule](#edit-an-approval-rule), set **Approvals required** to `0`.
To make an approval rule optional, you can also use the API to
[update an approval rule for a project](../../../../api/merge_request_approvals.md#update-an-approval-rule-for-a-project),
and set the `approvals_required` attribute to `0`.
## Approvals for protected branches
Approval rules are often relevant only to specific branches, like your
[default branch](../../repository/branches/default.md). To configure an
approval rule for certain branches:
1. [Create an approval rule](#add-an-approval-rule).
1. Go to your project and select **Settings > Merge requests**.
1. In the **Merge request approvals** section, scroll to **Approval rules**.
1. For **Target branch**:
- To apply the rule to all protected branches, select **All protected branches**.
- To apply the rule to a specific branch, select it from the list.
1. To enable this configuration, follow
[Require Code Owner approval on a protected branch](../../repository/branches/protected.md#require-code-owner-approval).
## Enable approval permissions for users with the Reporter role
Before users with the Reporter role can merge to a protected branch, you might have to grant them
permission to approve merge requests.
Some users (like managers) might not need permission to push or merge code, but still need
oversight on proposed work.
Users with the Reporter role can approve merge requests only through regular approval rules.
Code owner approval rules require users to have at least the Developer role. For more information,
see [Eligible approvers](#eligible-approvers).
Prerequisites:
- You must select a specific branch, as this method does not work with `All Branches` or `All protected branches` settings.
- The shared group must be added to an approval rule and not individual users, even when the added user is part of the group.
To enable approval permissions for these users without granting them push access:
1. [Create a protected branch](../../repository/branches/protected.md)
1. [Create a new group](../../../group/_index.md#create-a-group).
1. [Add the user to the group](../../../group/_index.md#add-users-to-a-group),
and select the Reporter role for the user. Do not assign roles with higher permissions than
Reporter due to a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/492467).
Assigning higher roles may result in unexpected behavior.
1. [Share the project with your group](../../members/sharing_projects_groups.md#invite-a-group-to-a-project),
with at least the Reporter role.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section:
- For a new rule, select **Add approval rule** and target the protected branch.
- For an existing rule, select **Edit** and target the protected branch.
1. On the right sidebar, in **Add approvers**, select the group you created.
1. Select **Save changes**.
## Security Approvals
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Bot comment for approvals [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/411656) in GitLab 16.2 [with a flag](../../../../administration/feature_flags/_index.md) named `security_policy_approval_notification`. Enabled by default.
- Bot comment for approvals [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130827) in GitLab 16.3. Feature flag `security_policy_approval_notification` removed.
{{< /history >}}
You can use [merge request approval policies](../../../application_security/policies/merge_request_approval_policies.md#merge-request-approval-policy-editor) to define security approvals based on the status of vulnerabilities in the merge request and the default branch.
Details for each security policy is shown in the Security Approvals section of your Merge Request configuration.
The security approval rules are applied to all merge requests until the pipeline is complete. The application of the
security approval rules prevents users from merging in code before the security scans run. After the pipeline is
complete, the security approval rules are checked to determine if the security approvals are still required.
In case the scanners in the pipeline identify an issue and security approvals are required, a bot comment is generated
on the merge request to indicate which steps are needed to proceed.

These policies are both created and edited in the [security policy editor](../../../application_security/policies/_index.md#policy-editor).
## Eligible approvers
To be eligible as an approver for your project, a user must be a direct member of at least one of the following:
- Your project.
- Your project's group.
- Any of your project's group's parent groups.
- Another group that has been [shared with your project](../../members/sharing_projects_groups.md#sharing-projects).
- Another group that has been [shared with your project's group or any of the group's parents](../../members/sharing_projects_groups.md#sharing-groups).
- A [group added as approvers](#group-approvers).
Users with the Developer role can approve merge requests if one of the following is true:
- Users added as approvers at the project or merge request level.
- Users who are [Code owners](#code-owners-as-approvers) of the files
changed in the merge request.
Users with the Reporter role can approve only if all of the following are true:
- The users are part of a group that has been [shared](../../members/sharing_projects_groups.md) with the project.
The group must have at least the Reporter role.
- The group has been added as merge request approvers.
- Approval permissions for users with the reporter role [are enabled](#enable-approval-permissions-for-users-with-the-reporter-role).
To show who has participated in the merge request review, the Approvals widget in
a merge request displays a **Commented by** column. This column lists eligible approvers
who commented on the merge request. It helps authors and reviewers identify who to
contact with questions about the merge request's content.
If the number of required approvals is greater than the number of assigned approvers,
approvals from other users with at least the Developer role
in the project count toward meeting the required number of approvals, even if the
users were not explicitly listed in the approval rules.
### Code owners as approvers
If you add [code owners](../../codeowners/_index.md) to your repository, the owners of files
become eligible approvers in the project. To enable this merge request approval rule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Merge request approvals** section, in the **Approval rules** section, locate the **All eligible users** rule.
1. In the **Approvals required** column, enter the number of approvals required.
You can also
[require code owner approval](../../repository/branches/protected.md#require-code-owner-approval)
for protected branches.
### Approver by membership type
The following tables show how membership type affects eligibility for both approval rules and
Code Owners.
#### User eligibility
When you assign individual users as approvers for approval rules or reference users in `CODEOWNERS`
files, like `@username`:
| Membership type | Approval rules | Code Owners |
|--------------------------------------------------------------------------------------------------------------------|---------------------------------------------|-------------|
| Direct member of the project | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Direct member of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Direct member of a [group invited to the project](../../members/sharing_projects_groups.md#sharing-projects) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of a group invited to the project | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
| Direct member of a [group invited to the project's group](../../members/sharing_projects_groups.md#sharing-groups) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of a group invited to the project's group | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
| Direct member of a group invited to the project's group's parent groups | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| Inherited member of a group invited to the project's group's parent groups | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
#### Group eligibility
When you assign groups as approvers for approval rules or reference groups in `CODEOWNERS` files,
like `@group-name`, only direct members of eligible groups can provide approvals:
| Group type | Approval rules | Code Owners |
|------------|----------------|-------------|
| [Groups invited to the project](../../members/sharing_projects_groups.md#sharing-projects) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Groups invited to the project's group](../../members/sharing_projects_groups.md#sharing-groups) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No |
| Groups invited to a parent of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No |
| The project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| A parent of the project's group | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
{{< alert type="note" >}}
For group-based approvals, only direct members of the group can approve merge requests.
Inherited members of the eligible groups cannot provide approvals.
{{< /alert >}}
### Group approvers
You can add a group of users as approvers. All direct members of this group
can approve the rule. Inherited members cannot approve the rule.
Typically the group is a subgroup in your top-level namespace, unless you are
collaborating with an external group. If you are collaborating with another group
and want to use members of that group as approvers, you can either:
- [Share access to the project](../../members/sharing_projects_groups.md#sharing-projects).
- [Share access to your project's group](../../members/sharing_projects_groups.md#sharing-groups),
which gives the external group approval access to all projects in your project's group.
A user's membership in an approver group determines their individual approval permissions
in the following ways:
- Inherited members are not considered approvers. Only direct members can approve merge requests.
- A user from a group approver group who is later also added as an individual approver
counts as one approver, not two.
- Merge request authors do not count as eligible approvers on their own merge requests by default.
To change this behavior, disable the
[**Prevent author approval**](settings.md#prevent-approval-by-author)
project setting.
- By default, committers to merge requests can approve a merge request. To change this behavior, enable
the [**Prevent committers approval**](settings.md#prevent-approvals-by-users-who-add-commits)
project setting.
## Troubleshooting
### Approval rule name can't be blank
As a workaround for this validation error, you can delete the approval rule through
the API.
1. [List all approval rules for the project](../../../../api/merge_request_approvals.md#list-all-approval-rules-for-a-project).
1. [DELETE the rule](../../../../api/merge_request_approvals.md#delete-an-approval-rule-for-a-project).
For more information about this validation error, read
[issue 285129](https://gitlab.com/gitlab-org/gitlab/-/issues/285129).
### Groups need explicit or inherited Developer role on a project
A group created to handle approvals may be created in a different area of the
project hierarchy than the project requiring review. If this happens, members of the
group may not have permission to approve the merge request as they do not have access to it.
For example:
In the group structure below, project 1 belongs to subgroup 1 and subgroup 4 has users.

Project 1 has configured an approval rule for the project, which assigns subgroup 4 as approvers.
When a merge request is created, approvers from subgroup 4 appear in the eligible approvers list.
However, as users from subgroup 4 do not have permission to view the merge request, the `404` error is returned.
To grant membership, the group must be invited as a project member. It is now possible for users from subgroup 4 to approve.

|
https://docs.gitlab.com/user/project/merge_requests/methods
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/merge_requests/_index.md
|
2025-08-13
|
doc/user/project/merge_requests/methods
|
[
"doc",
"user",
"project",
"merge_requests",
"methods"
] |
_index.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Merge methods
|
Your project's merge method determines whether to squash commits before merging, and if merge commits are created when work merges.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The merge method you select for your project determines how the changes in your
merge requests are merged into an existing branch.
The examples on this page assume a `main` branch with commits A, C, and E, and a
`feature` branch with commits B and D:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
gitGraph
accTitle: Diagram of a merge
accDescr: A Git graph of five commits on two branches, which will be expanded on in other graphs in this page.
commit id: "A"
branch feature
commit id: "B"
commit id: "D"
checkout main
commit id: "C"
commit id: "E"
```
## Configure a project's merge method
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Select your desired **Merge method** from these options:
- Merge commit
- Merge commit with semi-linear history
- Fast-forward merge
1. In **Squash commits when merging**, select the default behavior for handling commits:
- **Do not allow**: Squashing is never performed, and the user cannot change the behavior.
- **Allow**: Squashing is off by default, but the user can change the behavior.
- **Encourage**: Squashing is on by default, but the user can change the behavior.
- **Require**: Squashing is always performed, and the user cannot change the behavior.
1. Select **Save changes**.
## Merge commit
By default, GitLab creates a merge commit when a branch is merged into `main`.
A separate merge commit is always created, regardless of whether or not commits
are [squashed when merging](../squash_and_merge.md). This strategy can result
in both a squash commit and a merge commit being added to your `main` branch.
These diagrams show how the `feature` branch merges into `main` if you use the
**Merge commit** strategy. They are equivalent to the command `git merge --no-ff <feature>`,
and selecting `Merge commit` as the **Merge method** in the GitLab UI:
- After a feature branch is merged with the **Merge commit** method, your `main` branch
looks like this:
```mermaid
%%{init: { 'gitGraph': {'logLevel': 'debug', 'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'main', 'fontFamily': 'GitLab Sans'}} }%%
gitGraph
accTitle: Diagram of a merge commit
accDescr: A Git graph showing how merge commits are created in GitLab when a feature branch is merged.
commit id: "A"
branch feature
commit id: "B"
commit id: "D"
checkout main
commit id: "C"
commit id: "E"
merge feature
```
- In comparison, a squash merge constructs a squash commit, a virtual copy of all commits
from the `feature` branch. The original commits (B and D) remain unchanged
on the `feature` branch, and then a merge commit is made on the `main` branch to merge in the squashed branch:
```mermaid
%%{init: { 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'main', 'fontFamily': 'GitLab Sans'}} }%%
gitGraph
accTitle: Diagram of of a squash merge
accDescr: A Git graph showing repository and branch structure after a squash commit is added to the main branch.
commit id:"A"
branch feature
checkout main
commit id:"C"
checkout feature
commit id:"B"
commit id:"D"
checkout main
commit id:"E"
branch "B+D"
commit id: "B+D"
checkout main
merge "B+D"
```
The squash merge graph is equivalent to these settings in the GitLab UI:
- **Merge method**: Merge commit.
- **Squash commits when merging** should be set to either:
- Require.
- Either Allow or Encourage, and squashing must be selected on the merge request.
The squash merge graph is also equivalent to these commands:
```shell
git checkout `git merge-base feature main`
git merge --squash feature
git commit --no-edit
SOURCE_SHA=`git rev-parse HEAD`
git checkout main
git merge --no-ff $SOURCE_SHA
```
## Merge commit with semi-linear history
A merge commit is created for every merge, but the branch is only merged if
a fast-forward merge is possible. This ensures that if the merge request build
succeeded, the target branch build also succeeds after the merge. An example
commit graph generated using this merge method:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
gitGraph
accTitle: Diagram of a merge commit
accDescr: Shows the flow of commits when a branch merges with a merge commit.
commit id: "Init"
branch mr-branch-1
commit
commit
checkout main
merge mr-branch-1
branch mr-branch-2
commit
commit
checkout main
merge mr-branch-2
commit
branch squash-mr
commit id: "Squashed commits"
checkout main
merge squash-mr
```
When you visit the merge request page with `Merge commit with semi-linear history`
method selected, you can accept it only if a fast-forward merge is possible.
When a fast-forward merge is not possible, the user is given the option to rebase, see
[Rebasing in (semi-)linear merge methods](#rebasing-in-semi-linear-merge-methods).
This method is equivalent to the same Git commands as in the **Merge commit** method. However,
if your source branch is based on an out-of-date version of the target branch (such as `main`),
you must rebase your source branch.
This merge method creates a cleaner-looking history, while still enabling you to
see where every branch began and was merged.
## Fast-forward merge
Sometimes, a workflow policy might mandate a clean commit history without
merge commits. In such cases, the fast-forward merge is appropriate. With
fast-forward merge requests, you can retain a linear Git history and a way
to accept merge requests without creating merge commits. An example commit graph
generated using this merge method:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
gitGraph
accTitle: Diagram of a fast-forward merge
accDescr: Shows how a fast-forwarded merge request maintains a linear Git history, but does not add a merge commit.
commit id: "Init"
commit id: "Merge mr-branch-1"
commit id: "Merge mr-branch-2"
commit id: "Commit on main"
commit id: "Merge squash-mr"
```
This method is equivalent to:
- `git merge --ff <source-branch>` for regular merges.
- `git merge --squash <source-branch>` followed by `git commit` for squash merges.
When the fast-forward merge
([`--ff-only`](https://git-scm.com/docs/git-merge#git-merge---ff-only)) setting
is enabled, no merge commits are created and all merges are fast-forwarded.
Merging is only allowed if the branch can be fast-forwarded.
When a fast-forward merge is not possible, the user is given the option to rebase, see
[Rebasing in (semi-)linear merge methods](#rebasing-in-semi-linear-merge-methods).
When you visit the merge request page with `Fast-forward merge`
method selected, you can accept it only if a fast-forward merge is possible.
## Rebasing in (semi-)linear merge methods
In these merge methods, you can merge only when your source branch is up-to-date with the target branch:
- Merge commit with semi-linear history.
- Fast-forward merge.
If a fast-forward merge is not possible but a conflict-free rebase is possible,
GitLab provides:
- The [`/rebase` quick action](../conflicts.md#rebase).
- The option to select **Rebase** in the user interface.
You must rebase the source branch locally before a fast-forward merge if both
conditions are true:
- The target branch is ahead of the source branch.
- A conflict-free rebase is not possible.
Rebasing may be required before squashing, even though squashing can itself be
considered equivalent to rebasing.
### Rebase without CI/CD pipeline
To rebase a merge request's branch without triggering a CI/CD pipeline, select
**Rebase without pipeline** from the merge request reports section.
This option is:
- Available when fast-forward merge is not possible but a conflict-free rebase is possible.
- Not available when the **Pipelines must succeed** option is enabled.
Rebasing without a CI/CD pipeline saves resources in projects with a semi-linear
workflow that requires frequent rebases.
## Related topics
- [Squash and merge](../squash_and_merge.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Your project's merge method determines whether to squash commits before
merging, and if merge commits are created when work merges.
title: Merge methods
breadcrumbs:
- doc
- user
- project
- merge_requests
- methods
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The merge method you select for your project determines how the changes in your
merge requests are merged into an existing branch.
The examples on this page assume a `main` branch with commits A, C, and E, and a
`feature` branch with commits B and D:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
gitGraph
accTitle: Diagram of a merge
accDescr: A Git graph of five commits on two branches, which will be expanded on in other graphs in this page.
commit id: "A"
branch feature
commit id: "B"
commit id: "D"
checkout main
commit id: "C"
commit id: "E"
```
## Configure a project's merge method
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Select your desired **Merge method** from these options:
- Merge commit
- Merge commit with semi-linear history
- Fast-forward merge
1. In **Squash commits when merging**, select the default behavior for handling commits:
- **Do not allow**: Squashing is never performed, and the user cannot change the behavior.
- **Allow**: Squashing is off by default, but the user can change the behavior.
- **Encourage**: Squashing is on by default, but the user can change the behavior.
- **Require**: Squashing is always performed, and the user cannot change the behavior.
1. Select **Save changes**.
## Merge commit
By default, GitLab creates a merge commit when a branch is merged into `main`.
A separate merge commit is always created, regardless of whether or not commits
are [squashed when merging](../squash_and_merge.md). This strategy can result
in both a squash commit and a merge commit being added to your `main` branch.
These diagrams show how the `feature` branch merges into `main` if you use the
**Merge commit** strategy. They are equivalent to the command `git merge --no-ff <feature>`,
and selecting `Merge commit` as the **Merge method** in the GitLab UI:
- After a feature branch is merged with the **Merge commit** method, your `main` branch
looks like this:
```mermaid
%%{init: { 'gitGraph': {'logLevel': 'debug', 'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'main', 'fontFamily': 'GitLab Sans'}} }%%
gitGraph
accTitle: Diagram of a merge commit
accDescr: A Git graph showing how merge commits are created in GitLab when a feature branch is merged.
commit id: "A"
branch feature
commit id: "B"
commit id: "D"
checkout main
commit id: "C"
commit id: "E"
merge feature
```
- In comparison, a squash merge constructs a squash commit, a virtual copy of all commits
from the `feature` branch. The original commits (B and D) remain unchanged
on the `feature` branch, and then a merge commit is made on the `main` branch to merge in the squashed branch:
```mermaid
%%{init: { 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'main', 'fontFamily': 'GitLab Sans'}} }%%
gitGraph
accTitle: Diagram of of a squash merge
accDescr: A Git graph showing repository and branch structure after a squash commit is added to the main branch.
commit id:"A"
branch feature
checkout main
commit id:"C"
checkout feature
commit id:"B"
commit id:"D"
checkout main
commit id:"E"
branch "B+D"
commit id: "B+D"
checkout main
merge "B+D"
```
The squash merge graph is equivalent to these settings in the GitLab UI:
- **Merge method**: Merge commit.
- **Squash commits when merging** should be set to either:
- Require.
- Either Allow or Encourage, and squashing must be selected on the merge request.
The squash merge graph is also equivalent to these commands:
```shell
git checkout `git merge-base feature main`
git merge --squash feature
git commit --no-edit
SOURCE_SHA=`git rev-parse HEAD`
git checkout main
git merge --no-ff $SOURCE_SHA
```
## Merge commit with semi-linear history
A merge commit is created for every merge, but the branch is only merged if
a fast-forward merge is possible. This ensures that if the merge request build
succeeded, the target branch build also succeeds after the merge. An example
commit graph generated using this merge method:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
gitGraph
accTitle: Diagram of a merge commit
accDescr: Shows the flow of commits when a branch merges with a merge commit.
commit id: "Init"
branch mr-branch-1
commit
commit
checkout main
merge mr-branch-1
branch mr-branch-2
commit
commit
checkout main
merge mr-branch-2
commit
branch squash-mr
commit id: "Squashed commits"
checkout main
merge squash-mr
```
When you visit the merge request page with `Merge commit with semi-linear history`
method selected, you can accept it only if a fast-forward merge is possible.
When a fast-forward merge is not possible, the user is given the option to rebase, see
[Rebasing in (semi-)linear merge methods](#rebasing-in-semi-linear-merge-methods).
This method is equivalent to the same Git commands as in the **Merge commit** method. However,
if your source branch is based on an out-of-date version of the target branch (such as `main`),
you must rebase your source branch.
This merge method creates a cleaner-looking history, while still enabling you to
see where every branch began and was merged.
## Fast-forward merge
Sometimes, a workflow policy might mandate a clean commit history without
merge commits. In such cases, the fast-forward merge is appropriate. With
fast-forward merge requests, you can retain a linear Git history and a way
to accept merge requests without creating merge commits. An example commit graph
generated using this merge method:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
gitGraph
accTitle: Diagram of a fast-forward merge
accDescr: Shows how a fast-forwarded merge request maintains a linear Git history, but does not add a merge commit.
commit id: "Init"
commit id: "Merge mr-branch-1"
commit id: "Merge mr-branch-2"
commit id: "Commit on main"
commit id: "Merge squash-mr"
```
This method is equivalent to:
- `git merge --ff <source-branch>` for regular merges.
- `git merge --squash <source-branch>` followed by `git commit` for squash merges.
When the fast-forward merge
([`--ff-only`](https://git-scm.com/docs/git-merge#git-merge---ff-only)) setting
is enabled, no merge commits are created and all merges are fast-forwarded.
Merging is only allowed if the branch can be fast-forwarded.
When a fast-forward merge is not possible, the user is given the option to rebase, see
[Rebasing in (semi-)linear merge methods](#rebasing-in-semi-linear-merge-methods).
When you visit the merge request page with `Fast-forward merge`
method selected, you can accept it only if a fast-forward merge is possible.
## Rebasing in (semi-)linear merge methods
In these merge methods, you can merge only when your source branch is up-to-date with the target branch:
- Merge commit with semi-linear history.
- Fast-forward merge.
If a fast-forward merge is not possible but a conflict-free rebase is possible,
GitLab provides:
- The [`/rebase` quick action](../conflicts.md#rebase).
- The option to select **Rebase** in the user interface.
You must rebase the source branch locally before a fast-forward merge if both
conditions are true:
- The target branch is ahead of the source branch.
- A conflict-free rebase is not possible.
Rebasing may be required before squashing, even though squashing can itself be
considered equivalent to rebasing.
### Rebase without CI/CD pipeline
To rebase a merge request's branch without triggering a CI/CD pipeline, select
**Rebase without pipeline** from the merge request reports section.
This option is:
- Available when fast-forward merge is not possible but a conflict-free rebase is possible.
- Not available when the **Pipelines must succeed** option is enabled.
Rebasing without a CI/CD pipeline saves resources in projects with a semi-linear
workflow that requires frequent rebases.
## Related topics
- [Squash and merge](../squash_and_merge.md)
|
https://docs.gitlab.com/user/comparison_dependency_and_container_scanning
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/comparison_dependency_and_container_scanning.md
|
2025-08-13
|
doc/user/application_security
|
[
"doc",
"user",
"application_security"
] |
comparison_dependency_and_container_scanning.md
|
Application Security Testing
|
Composition Analysis
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Dependency Scanning compared to Container Scanning
|
Dependency Scanning compared to Container Scanning.
|
GitLab offers both [Dependency Scanning](dependency_scanning/_index.md) and
[Container Scanning](container_scanning/_index.md) to ensure coverage for all of these
dependency types. To cover as much of your risk area as possible, we encourage you to use all of our
security scanning tools:
- Dependency Scanning analyzes your project and tells you which software dependencies,
including upstream dependencies, have been included in your project, and what known
risks the dependencies contain.
- Container Scanning analyzes your containers and tells you about known risks in the operating
system's (OS) packages.
The following table summarizes which types of dependencies each scanning tool can detect:
| Feature | Dependency Scanning | Container Scanning |
|----------------------------------------------------------------------------------------------|---------------------|---------------------------------|
| Identify the manifest, lock file, or static file that introduced the dependency | {{< icon name="check-circle" >}} | {{< icon name="dotted-circle" >}} |
| Development dependencies | {{< icon name="check-circle" >}} | {{< icon name="dotted-circle" >}} |
| Dependencies in a lock file committed to your repository | {{< icon name="check-circle" >}} | {{< icon name="check-circle" >}} <sup>1</sup> |
| Binaries built by Go | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} <sup>2</sup> |
| Dynamically-linked language-specific dependencies installed by the Operating System | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} |
| Operating system dependencies | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} |
| Language-specific dependencies installed on the operating system (not built by your project) | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} |
1. Lock file must be present in the image to be detected.
1. [Report language-specific findings](container_scanning/_index.md#report-language-specific-findings) must be enabled, and binaries must be present in the image to be detected.
|
---
stage: Application Security Testing
group: Composition Analysis
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Dependency Scanning compared to Container Scanning
description: Dependency Scanning compared to Container Scanning.
breadcrumbs:
- doc
- user
- application_security
---
GitLab offers both [Dependency Scanning](dependency_scanning/_index.md) and
[Container Scanning](container_scanning/_index.md) to ensure coverage for all of these
dependency types. To cover as much of your risk area as possible, we encourage you to use all of our
security scanning tools:
- Dependency Scanning analyzes your project and tells you which software dependencies,
including upstream dependencies, have been included in your project, and what known
risks the dependencies contain.
- Container Scanning analyzes your containers and tells you about known risks in the operating
system's (OS) packages.
The following table summarizes which types of dependencies each scanning tool can detect:
| Feature | Dependency Scanning | Container Scanning |
|----------------------------------------------------------------------------------------------|---------------------|---------------------------------|
| Identify the manifest, lock file, or static file that introduced the dependency | {{< icon name="check-circle" >}} | {{< icon name="dotted-circle" >}} |
| Development dependencies | {{< icon name="check-circle" >}} | {{< icon name="dotted-circle" >}} |
| Dependencies in a lock file committed to your repository | {{< icon name="check-circle" >}} | {{< icon name="check-circle" >}} <sup>1</sup> |
| Binaries built by Go | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} <sup>2</sup> |
| Dynamically-linked language-specific dependencies installed by the Operating System | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} |
| Operating system dependencies | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} |
| Language-specific dependencies installed on the operating system (not built by your project) | {{< icon name="dotted-circle" >}} | {{< icon name="check-circle" >}} |
1. Lock file must be present in the image to be detected.
1. [Report language-specific findings](container_scanning/_index.md#report-language-specific-findings) must be enabled, and binaries must be present in the image to be detected.
|
https://docs.gitlab.com/user/get-started-security
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get-started-security.md
|
2025-08-13
|
doc/user/application_security
|
[
"doc",
"user",
"application_security"
] |
get-started-security.md
|
Application Security Testing
|
Secret Detection
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started securing your application
|
Test your application and resolve vulnerabilities.
|
Identify and remediate vulnerabilities in your application's source code.
Integrate security testing into the software development lifecycle
by automatically scanning your code for potential security issues.
You can scan various programming languages and frameworks,
and detect vulnerabilities like SQL injection, cross-site scripting (XSS),
and insecure dependencies. The results of the security scans are displayed in the GitLab UI,
where you can review and address them.
These features can also be integrated with other GitLab features like merge requests
and pipelines to ensure that security is a priority throughout the development process.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Adopting GitLab application security](https://www.youtube.com/watch?v=5QlxkiKR04k)
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
[View an interactive reading and how-to demo playlist](https://www.youtube.com/playlist?list=PL05JrBw4t0KrUrjDoefSkgZLx5aJYFaF9)
This process is part of a larger workflow:

## Step 1: Learn about scanning
Secret Detection scans your repository to help prevent your secrets from being exposed.
It works with all programming languages.
Dependency Scanning analyzes your application's dependencies for known vulnerabilities.
It works with certain languages and package managers.
For more information, see:
- [Secret Detection](secret_detection/_index.md)
- [Dependency Scanning](dependency_scanning/_index.md)
## Step 2: Choose a project to test
If it's your first time setting up GitLab security scanning, you should start with a single project.
The project should:
- Use your organization's typical programming languages and technologies,
because some scanning features work differently for different languages.
- Allow you to try new settings, like required approvals, without interrupting your team's daily work.
You can create a copy of a high-traffic project, or select a project that's not as busy.
## Step 3: Enable scanning
To identify leaked secrets and vulnerable packages in the project,
create a merge request that enables Secret Detection and Dependency Scanning.
This merge request updates your `.gitlab-ci.yml` file, so that the scans
run as part of your project's CI/CD pipeline.
As part of this MR, you can change settings to accommodate your project's layout or configuration.
For example, you might exclude a directory of third-party code.
After you merge this MR to your default branch, the system creates a baseline scan.
This scan identifies which vulnerabilities already exist on the default branch.
Then, merge requests will highlight any newly introduced problems.
Without a baseline scan, merge requests display every vulnerability in the branch,
even if the vulnerability already exists on the default branch.
For more information, see:
- [Enable Secret Detection](secret_detection/pipeline/_index.md#getting-started)
- [Secret Detection settings](secret_detection/pipeline/configure.md)
- [Enable Dependency Scanning](dependency_scanning/_index.md#getting-started)
- [Dependency Scanning settings](dependency_scanning/_index.md#available-cicd-variables)
## Step 4: Review scan results
Let your team get comfortable with viewing security findings in merge requests
and the vulnerability report.
Establish a vulnerability triage workflow. Consider creating labels and issue boards
to help manage issues created from vulnerabilities. With issue boards, all stakeholders
have a common view of all issues and can track remediation progress.
Monitor the Security Dashboard trends to gauge success in remediating existing vulnerabilities
and preventing the introduction of new ones.
For more information, see:
- [View the vulnerability report](vulnerability_report/_index.md)
- [View security findings in merge requests](detect/security_scanning_results.md)
- [View the Security Dashboard](security_dashboard/_index.md)
- [Labels](../project/labels.md)
- [Issue boards](../project/issue_board.md)
## Step 5: Schedule future scanning jobs
Enforce scheduled security scanning jobs by using a scan execution policy.
These scheduled jobs run independently from any other security scans you
might have defined in a compliance framework pipeline or in the project's `.gitlab-ci.yml` file.
Scheduled scans are most useful for projects or important branches with
low development activity and where pipeline scans are infrequent.
For more information, see:
- [Scan execution policy](policies/scan_execution_policies.md)
- [Container scans](container_scanning/_index.md)
- [Operational container scanning](../clusters/agent/vulnerabilities.md)
## Step 6: Limit new vulnerabilities
To enforce required scan types and ensure separation of duties between security and engineering,
use Scan Execution Policies.
To limit new vulnerabilities from being merged into your default branch,
create a merge request approval policy.
After you've gotten familiar with how scanning works, you can then choose to:
- Follow the same steps to enable scanning in more projects.
- Enforce scanning across more of your projects at once.
For more information, see:
- [Scan Execution Policies](policies/scan_execution_policies.md)
- [Merge request approval policy](policies/_index.md)
## Step 7: Continue scanning for new vulnerabilities
Over time, you want to ensure new vulnerabilities are not introduced.
- To surface newly discovered vulnerabilities that already exist in your repository,
run regular dependency and container scans.
- To scan container images in your production cluster for security vulnerabilities,
enable operational container scanning.
- Enable other scan types, like SAST, DAST, or Fuzz testing.
- To allow for DAST and Web API fuzzing on ephemeral test environments,
consider enabling review apps.
For more information, see:
- [SAST](sast/_index.md)
- [DAST](dast/_index.md)
- [Fuzz testing](coverage_fuzzing/_index.md)
- [Web API fuzzing](api_fuzzing/_index.md)
- [Review apps](../../ci/review_apps/_index.md)
|
---
stage: Application Security Testing
group: Secret Detection
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Test your application and resolve vulnerabilities.
title: Get started securing your application
breadcrumbs:
- doc
- user
- application_security
---
Identify and remediate vulnerabilities in your application's source code.
Integrate security testing into the software development lifecycle
by automatically scanning your code for potential security issues.
You can scan various programming languages and frameworks,
and detect vulnerabilities like SQL injection, cross-site scripting (XSS),
and insecure dependencies. The results of the security scans are displayed in the GitLab UI,
where you can review and address them.
These features can also be integrated with other GitLab features like merge requests
and pipelines to ensure that security is a priority throughout the development process.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, see [Adopting GitLab application security](https://www.youtube.com/watch?v=5QlxkiKR04k)
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
[View an interactive reading and how-to demo playlist](https://www.youtube.com/playlist?list=PL05JrBw4t0KrUrjDoefSkgZLx5aJYFaF9)
This process is part of a larger workflow:

## Step 1: Learn about scanning
Secret Detection scans your repository to help prevent your secrets from being exposed.
It works with all programming languages.
Dependency Scanning analyzes your application's dependencies for known vulnerabilities.
It works with certain languages and package managers.
For more information, see:
- [Secret Detection](secret_detection/_index.md)
- [Dependency Scanning](dependency_scanning/_index.md)
## Step 2: Choose a project to test
If it's your first time setting up GitLab security scanning, you should start with a single project.
The project should:
- Use your organization's typical programming languages and technologies,
because some scanning features work differently for different languages.
- Allow you to try new settings, like required approvals, without interrupting your team's daily work.
You can create a copy of a high-traffic project, or select a project that's not as busy.
## Step 3: Enable scanning
To identify leaked secrets and vulnerable packages in the project,
create a merge request that enables Secret Detection and Dependency Scanning.
This merge request updates your `.gitlab-ci.yml` file, so that the scans
run as part of your project's CI/CD pipeline.
As part of this MR, you can change settings to accommodate your project's layout or configuration.
For example, you might exclude a directory of third-party code.
After you merge this MR to your default branch, the system creates a baseline scan.
This scan identifies which vulnerabilities already exist on the default branch.
Then, merge requests will highlight any newly introduced problems.
Without a baseline scan, merge requests display every vulnerability in the branch,
even if the vulnerability already exists on the default branch.
For more information, see:
- [Enable Secret Detection](secret_detection/pipeline/_index.md#getting-started)
- [Secret Detection settings](secret_detection/pipeline/configure.md)
- [Enable Dependency Scanning](dependency_scanning/_index.md#getting-started)
- [Dependency Scanning settings](dependency_scanning/_index.md#available-cicd-variables)
## Step 4: Review scan results
Let your team get comfortable with viewing security findings in merge requests
and the vulnerability report.
Establish a vulnerability triage workflow. Consider creating labels and issue boards
to help manage issues created from vulnerabilities. With issue boards, all stakeholders
have a common view of all issues and can track remediation progress.
Monitor the Security Dashboard trends to gauge success in remediating existing vulnerabilities
and preventing the introduction of new ones.
For more information, see:
- [View the vulnerability report](vulnerability_report/_index.md)
- [View security findings in merge requests](detect/security_scanning_results.md)
- [View the Security Dashboard](security_dashboard/_index.md)
- [Labels](../project/labels.md)
- [Issue boards](../project/issue_board.md)
## Step 5: Schedule future scanning jobs
Enforce scheduled security scanning jobs by using a scan execution policy.
These scheduled jobs run independently from any other security scans you
might have defined in a compliance framework pipeline or in the project's `.gitlab-ci.yml` file.
Scheduled scans are most useful for projects or important branches with
low development activity and where pipeline scans are infrequent.
For more information, see:
- [Scan execution policy](policies/scan_execution_policies.md)
- [Container scans](container_scanning/_index.md)
- [Operational container scanning](../clusters/agent/vulnerabilities.md)
## Step 6: Limit new vulnerabilities
To enforce required scan types and ensure separation of duties between security and engineering,
use Scan Execution Policies.
To limit new vulnerabilities from being merged into your default branch,
create a merge request approval policy.
After you've gotten familiar with how scanning works, you can then choose to:
- Follow the same steps to enable scanning in more projects.
- Enforce scanning across more of your projects at once.
For more information, see:
- [Scan Execution Policies](policies/scan_execution_policies.md)
- [Merge request approval policy](policies/_index.md)
## Step 7: Continue scanning for new vulnerabilities
Over time, you want to ensure new vulnerabilities are not introduced.
- To surface newly discovered vulnerabilities that already exist in your repository,
run regular dependency and container scans.
- To scan container images in your production cluster for security vulnerabilities,
enable operational container scanning.
- Enable other scan types, like SAST, DAST, or Fuzz testing.
- To allow for DAST and Web API fuzzing on ephemeral test environments,
consider enabling review apps.
For more information, see:
- [SAST](sast/_index.md)
- [DAST](dast/_index.md)
- [Fuzz testing](coverage_fuzzing/_index.md)
- [Web API fuzzing](api_fuzzing/_index.md)
- [Review apps](../../ci/review_apps/_index.md)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.