Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-28 18:08:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-28 18:08:36 +0300
commitee7db70e1185876e97eca97ce8efabfc64c360b9 (patch)
tree4c09297635be43c0189a2a85dd2a38d5f72bc523 /doc
parent3fa33c82f9c49f4b53ddcf017fe77f1bff48a460 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r--doc/administration/job_artifacts.md17
-rw-r--r--doc/administration/object_storage.md28
-rw-r--r--doc/ci/pipelines/downstream_pipelines.md3
-rw-r--r--doc/ci/pipelines/img/job_artifacts_browser_button_v13_11.pngbin9633 -> 0 bytes
-rw-r--r--doc/ci/pipelines/img/job_artifacts_browser_v13_11.pngbin10083 -> 0 bytes
-rw-r--r--doc/ci/pipelines/img/job_artifacts_jobs_page_v13_11.pngbin22599 -> 0 bytes
-rw-r--r--doc/ci/pipelines/img/job_artifacts_merge_request_v13_11.pngbin13256 -> 0 bytes
-rw-r--r--doc/ci/pipelines/img/job_artifacts_pipelines_page_v13_11.pngbin47332 -> 0 bytes
-rw-r--r--doc/ci/pipelines/img/job_latest_artifacts_browser.pngbin10551 -> 0 bytes
-rw-r--r--doc/ci/pipelines/job_artifacts.md370
-rw-r--r--doc/ci/runners/configure_runners.md25
-rw-r--r--doc/ci/yaml/index.md18
-rw-r--r--doc/development/documentation/styleguide/word_list.md2
-rw-r--r--doc/development/internal_users.md7
-rw-r--r--doc/tutorials/index.md4
-rw-r--r--doc/user/admin_area/monitoring/health_check.md2
-rw-r--r--doc/user/packages/dependency_proxy/index.md30
-rw-r--r--doc/user/project/badges.md2
-rw-r--r--doc/user/project/merge_requests/creating_merge_requests.md7
-rw-r--r--doc/user/project/repository/branches/index.md85
20 files changed, 326 insertions, 274 deletions
diff --git a/doc/administration/job_artifacts.md b/doc/administration/job_artifacts.md
index 0a4213b7e2d..6547cb53b7c 100644
--- a/doc/administration/job_artifacts.md
+++ b/doc/administration/job_artifacts.md
@@ -419,6 +419,8 @@ reasons are:
to remove these. This script should always find work to do, as it also removes empty directories (see above).
- [Artifact housekeeping was changed significantly](#artifacts-housekeeping-disabled-in-gitlab-146-to-152),
and you might need to enable a feature flag to used the updated system.
+- The [keep latest artifacts from most recent success jobs](../ci/pipelines/job_artifacts.md#keep-artifacts-from-most-recent-successful-jobs)
+ feature is enabled.
In these and other cases, identify the projects most responsible
for disk space usage, figure out what types of artifacts are using the most
@@ -807,3 +809,18 @@ To work around this issue, you can try:
- For older kernels, using the `nolease` mount option to disable file leasing.
For more information, [see the investigation details](https://gitlab.com/gitlab-org/gitlab/-/issues/389995).
+
+### Usage quota shows incorrect artifact storage usage
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/238536) in GitLab 14.10.
+
+Sometimes the [artifacts storage usage](../user/usage_quotas.md) displays an incorrect
+value for the total storage space used by artifacts. To recalculate the artifact
+usage statistics for all projects in the instance, you can run this background script:
+
+```shell
+bin/rake 'gitlab:refresh_project_statistics_build_artifacts_size[file.csv]'
+```
+
+The artifact usage value can fluctuate to `0` while the script is running. After
+recalculation, usage should display as expected again.
diff --git a/doc/administration/object_storage.md b/doc/administration/object_storage.md
index 469db2652d7..6f50f085927 100644
--- a/doc/administration/object_storage.md
+++ b/doc/administration/object_storage.md
@@ -11,24 +11,24 @@ It's recommended over NFS and
in general it's better in larger setups as object storage is
typically much more performant, reliable, and scalable.
-There are two ways of specifying the object storage:
+To configure the object storage, you have two options:
-- [Consolidated configuration](#consolidated-object-storage-configuration) (recommended): A single credential is
- shared by all supported object types.
-- [Storage-specific configuration](#storage-specific-configuration): Every object defines its
- own object storage [connection and configuration](#connection-settings).
+- Recommended. [Consolidated configuration](#consolidated-object-storage-configuration):
+ A single credential is shared by all supported object types.
+- [Storage-specific configuration](#storage-specific-configuration): Every
+ object defines its own object storage connection and configuration.
-For more information on the differences and to transition from one form to another, see
-[Transition to consolidated form](#transition-to-consolidated-form).
+ If you already use the storage-specific form, see how to
+ [transition to the consolidated form](#transition-to-consolidated-form).
-If you are currently storing data locally, see
-[Migrate to object storage](#migrate-to-object-storage) for migration details.
+If you store data locally, see how to
+[migrate to object storage](#migrate-to-object-storage).
## Supported object storage providers
-GitLab is tightly integrated with `Fog`, so you can refer to its
-[documentation](https://fog.io/about/provider_documentation.html) to check
-which storage services can be integrated with GitLab.
+GitLab is tightly integrated with the Fog library, so you can see which
+[providers](https://fog.io/about/provider_documentation.html) can be used
+with GitLab.
Specifically, GitLab has been tested by vendors and customers on a number of object storage providers:
@@ -36,12 +36,12 @@ Specifically, GitLab has been tested by vendors and customers on a number of obj
is not supported, see [issue #335775](https://gitlab.com/gitlab-org/gitlab/-/issues/335775)
for more information)
- [Google Cloud Storage](https://cloud.google.com/storage)
-- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
+- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces) (S3 compatible)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatible mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- [Azure Blob storage](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction)
+- [MinIO](https://min.io/) (S3 compatible)
- On-premises hardware and appliances from various storage vendors, whose list is not officially established.
-- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
## Consolidated object storage configuration
diff --git a/doc/ci/pipelines/downstream_pipelines.md b/doc/ci/pipelines/downstream_pipelines.md
index 1e4654e69fe..ffcfee98f05 100644
--- a/doc/ci/pipelines/downstream_pipelines.md
+++ b/doc/ci/pipelines/downstream_pipelines.md
@@ -334,7 +334,8 @@ To retry failed and canceled jobs, select **Retry** (**{retry}**):
### Recreate a downstream pipeline
-> Retry trigger job from graph view [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367547) in GitLab 15.10 [with a flag](../../administration/feature_flags.md) named `ci_recreate_downstream_pipeline`. Disabled by default.
+> - Retry trigger job from graph view [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367547) in GitLab 15.10 [with a flag](../../administration/feature_flags.md) named `ci_recreate_downstream_pipeline`. Disabled by default.
+> - [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/6947) in GitLab 15.11. Feature flag `ci_recreate_downstream_pipeline` removed.
You can recreate a downstream pipeline by retrying its corresponding trigger job. The newly created downstream pipeline replaces the current downstream pipeline in the pipeline graph.
diff --git a/doc/ci/pipelines/img/job_artifacts_browser_button_v13_11.png b/doc/ci/pipelines/img/job_artifacts_browser_button_v13_11.png
deleted file mode 100644
index 710a82075ce..00000000000
--- a/doc/ci/pipelines/img/job_artifacts_browser_button_v13_11.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/pipelines/img/job_artifacts_browser_v13_11.png b/doc/ci/pipelines/img/job_artifacts_browser_v13_11.png
deleted file mode 100644
index 6a8ea49b833..00000000000
--- a/doc/ci/pipelines/img/job_artifacts_browser_v13_11.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/pipelines/img/job_artifacts_jobs_page_v13_11.png b/doc/ci/pipelines/img/job_artifacts_jobs_page_v13_11.png
deleted file mode 100644
index 9f09e36b927..00000000000
--- a/doc/ci/pipelines/img/job_artifacts_jobs_page_v13_11.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/pipelines/img/job_artifacts_merge_request_v13_11.png b/doc/ci/pipelines/img/job_artifacts_merge_request_v13_11.png
deleted file mode 100644
index f4b875de471..00000000000
--- a/doc/ci/pipelines/img/job_artifacts_merge_request_v13_11.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/pipelines/img/job_artifacts_pipelines_page_v13_11.png b/doc/ci/pipelines/img/job_artifacts_pipelines_page_v13_11.png
deleted file mode 100644
index c7b0b91d488..00000000000
--- a/doc/ci/pipelines/img/job_artifacts_pipelines_page_v13_11.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/pipelines/img/job_latest_artifacts_browser.png b/doc/ci/pipelines/img/job_latest_artifacts_browser.png
deleted file mode 100644
index c6d8856078b..00000000000
--- a/doc/ci/pipelines/img/job_latest_artifacts_browser.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/pipelines/job_artifacts.md b/doc/ci/pipelines/job_artifacts.md
index e26682c4562..05673c87771 100644
--- a/doc/ci/pipelines/job_artifacts.md
+++ b/doc/ci/pipelines/job_artifacts.md
@@ -6,8 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Job artifacts **(FREE)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16675) in GitLab 12.4, artifacts in internal and private projects can be previewed when [GitLab Pages access control](../../administration/pages/index.md#access-control) is enabled.
-
Jobs can output an archive of files and directories. This output is known as a job artifact.
You can download job artifacts by using the GitLab UI or the [API](../../api/job_artifacts.md#get-job-artifacts).
@@ -20,7 +18,7 @@ For administrator information about job artifact storage, see [administering job
## Create job artifacts
-To create job artifacts, use the `artifacts` keyword in your `.gitlab-ci.yml` file:
+To create job artifacts, use the [`artifacts`](../yaml/index.md#artifacts) keyword in your `.gitlab-ci.yml` file:
```yaml
pdf:
@@ -28,65 +26,48 @@ pdf:
artifacts:
paths:
- mycv.pdf
- expire_in: 1 week
```
In this example, a job named `pdf` calls the `xelatex` command to build a PDF file from the
LaTeX source file, `mycv.tex`.
-The `paths` keyword determines which files to add to the job artifacts.
+The [`paths`](../yaml/index.md#artifactspaths) keyword determines which files to add to the job artifacts.
All paths to files and directories are relative to the repository where the job was created.
-The `expire_in` keyword determines how long GitLab keeps the job artifacts.
-You can also [use the UI to keep job artifacts from expiring](#download-job-artifacts).
-If `expire_in` is not defined, the
-[instance-wide setting](../../user/admin_area/settings/continuous_integration.md#default-artifacts-expiration)
-is used.
-
-If you run two types of pipelines (like branch and scheduled) for the same ref,
-the pipeline that finishes later creates the job artifact.
+### With wildcards
-To disable artifact passing, define the job with empty [dependencies](../yaml/index.md#dependencies):
+You can use wildcards for paths and directories. For example, to create an artifact
+with all the files inside the directories that end with `xyz`:
```yaml
job:
- stage: build
- script: make build
- dependencies: []
-```
-
-You may want to create artifacts only for tagged releases to avoid filling the
-build server storage with temporary build artifacts. For example, use [`rules`](../yaml/index.md#rules)
-to create artifacts only for tags:
-
-```yaml
-default-job:
- script:
- - mvn test -U
- rules:
- - if: $CI_COMMIT_BRANCH
-
-release-job:
- script:
- - mvn package -U
+ script: echo "build xyz project"
artifacts:
paths:
- - target/*.war
- rules:
- - if: $CI_COMMIT_TAG
+ - path/*xyz/*
```
-You can use wildcards for directories too. For example, if you want to get all the
-files inside the directories that end with `xyz`:
+### With an expiry
+
+The [`expire_in`](../yaml/index.md#artifactsexpire_in) keyword determines how long
+GitLab keeps the job artifacts. For example:
```yaml
-job:
+pdf:
+ script: xelatex mycv.tex
artifacts:
paths:
- - path/*xyz/*
+ - mycv.pdf
+ expire_in: 1 week
```
-### Use CI/CD variables to define the artifacts name
+If `expire_in` is not defined, the [instance-wide setting](../../user/admin_area/settings/continuous_integration.md#default-artifacts-expiration)
+is used.
+
+To prevent artifacts from expiring, you can select **Keep** from the job details page.
+The option is not available when an artifact has no expiry set.
+
+### With CI/CD variables to define the artifacts name
You can use [CI/CD variables](../variables/index.md) to dynamically define the
artifacts file's name.
@@ -113,32 +94,12 @@ job:
```
If your branch-name contains forward slashes
-(for example `feature/my-feature`) it's advised to use `$CI_COMMIT_REF_SLUG`
+(for example `feature/my-feature`) use `$CI_COMMIT_REF_SLUG`
instead of `$CI_COMMIT_REF_NAME` for proper naming of the artifact.
-To create an archive with a name of the current job and the current branch or
-tag including only the binaries directory:
+### With a Windows runner or shell executor
-```yaml
-job:
- artifacts:
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
- paths:
- - binaries/
-```
-
-To create an archive with a name of the current [stage](../yaml/index.md#stages) and branch name:
-
-```yaml
-job:
- artifacts:
- name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
- paths:
- - binaries/
-```
-
-If you use **Windows Batch** to run your shell scripts you must replace
-`$` with `%`:
+If you use Windows Batch to run your shell scripts you must replace `$` with `%`:
```yaml
job:
@@ -148,8 +109,7 @@ job:
- binaries/
```
-If you use **Windows PowerShell** to run your shell scripts you must replace
-`$` with `$env:`:
+If you use Windows PowerShell to run your shell scripts you must replace `$` with `$env:`:
```yaml
job:
@@ -159,7 +119,7 @@ job:
- binaries/
```
-### Exclude files from job artifacts
+### Without excluded files
Use [`artifacts:exclude`](../yaml/index.md#artifactsexclude) to prevent files from
being added to an artifacts archive.
@@ -189,13 +149,13 @@ artifacts:
- binaries/temp/**/*
```
-### Add untracked files to artifacts
+### With untracked files
Use [`artifacts:untracked`](../yaml/index.md#artifactsuntracked) to add all Git untracked
files as artifacts (along with the paths defined in [`artifacts:paths`](../yaml/index.md#artifactspaths)). Untracked
files are those that haven't been added to the repository but exist in the repository checkout.
-Save all Git untracked files and files in `binaries`:
+For example, to save all Git untracked files and files in `binaries`:
```yaml
artifacts:
@@ -204,7 +164,7 @@ artifacts:
- binaries/
```
-Save all untracked files but [exclude](../yaml/index.md#artifactsexclude) `*.txt`:
+For example, to save all untracked files but [exclude](../yaml/index.md#artifactsexclude) `*.txt` files:
```yaml
artifacts:
@@ -213,6 +173,19 @@ artifacts:
- "*.txt"
```
+## Prevent a job from fetching artifacts
+
+Jobs downloads all artifacts from the completed jobs in previous stages by default.
+To prevent a job from downloading any artifacts, set [`dependencies`](../yaml/index.md#dependencies)
+to an empty array (`[]`):
+
+```yaml
+job:
+ stage: test
+ script: make build
+ dependencies: []
+```
+
## View all job artifacts
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/254938) in GitLab 15.11 [with a flag](../../administration/feature_flags.md) named `artifacts_management_page`. Disabled by default.
@@ -222,156 +195,104 @@ This list displays all jobs and their associated artifacts. Expand an entry to a
all artifacts associated with a job, including:
- Artifacts created with the `artifacts:` keyword.
-- [Report artifacts](../yaml/artifacts_reports.md)
+- [Report artifacts](../yaml/artifacts_reports.md).
- Job logs and metadata, which are stored internally as separate artifacts.
You can download or delete individual artifacts from this list.
## Download job artifacts
-You can download job artifacts or view the job archive:
+You can download job artifacts by selecting **Download** (**{download}**) from:
-- On the **Pipelines** page, to the right of the pipeline:
-
- ![Job artifacts in Pipelines page](img/job_artifacts_pipelines_page_v13_11.png)
-
-- On the **Jobs** page, to the right of the job:
-
- ![Job artifacts in Jobs page](img/job_artifacts_jobs_page_v13_11.png)
-
-- On a job's detail page. The **Keep** button indicates an `expire_in` value was set:
-
- ![Job artifacts browser button](img/job_artifacts_browser_button_v13_11.png)
-
-- On a merge request, by the pipeline details:
-
- ![Job artifacts in merge request](img/job_artifacts_merge_request_v13_11.png)
-
-- When browsing an archive:
-
- ![Job artifacts browser](img/job_artifacts_browser_v13_11.png)
+- Any **Pipelines** list, to the right of the pipeline select **Download artifacts** (**{download}**).
+- Any **Jobs** list, to the right of the job select **Download artifacts** (**{download}**).
+- A job's detail page, on the right of the page select **Download**.
+- A merge request **Overview** page, to the right of the latest pipeline select **Artifacts** (**{download}**).
+- The [**Artifacts**](#view-all-job-artifacts) page, to the right of the job select **Download** (**{download}**).
+- If the **Browse** (**{folder-open}**) option is available, you can browse the contents of the artifacts
+ from the UI without downloading the artifact. You can also select **Download artifacts archive**
+ from the artifacts browser.
If [GitLab Pages](../../administration/pages/index.md) is enabled in the project, you can preview
HTML files in the artifacts directly in your browser. If the project is internal or private, you must
enable [GitLab Pages access control](../../administration/pages/index.md#access-control) to preview
HTML files.
-## View failed job artifacts
-
-If the latest job has failed to upload the artifacts, you can see that
-information in the UI.
-
-![Latest artifacts button](img/job_latest_artifacts_browser.png)
-
-## Delete job artifacts
-
-WARNING:
-This is a destructive action that leads to data loss. Use with caution.
-
-You can delete a single job, which also removes the job's
-artifacts and log. You must be:
-
-- The owner of the job.
-- A user with at least the Maintainer role for the project.
-
-To delete a job:
-
-1. Go to a job's detail page.
-1. In the upper-right corner of the job's log, select **Erase job log** (**{remove}**).
-1. On the confirmation dialog, select **OK**.
+You can download job artifacts from the latest successful pipeline by using [the job artifacts API](../../api/job_artifacts.md).
+You cannot download [artifact reports](../yaml/artifacts_reports.md) with the job artifacts API,
+unless the report is added as a regular artifact with `artifacts:paths`.
-## Expose job artifacts in the merge request UI
+### From a URL
-Use the [`artifacts:expose_as`](../yaml/index.md#artifactsexpose_as) keyword to expose
-[job artifacts](../pipelines/job_artifacts.md) in the [merge request](../../user/project/merge_requests/index.md) UI.
+You can download the artifacts archive for a specific job with a publicly accessible
+URL for the [job artifacts API](../../api/job_artifacts.md#download-the-artifacts-archive).
-For example, to match a single file:
+For example, to download the latest artifacts of a job named `build` in the `main` branch of a project on GitLab.com:
-```yaml
-test:
- script: ["echo 'test' > file.txt"]
- artifacts:
- expose_as: 'artifact 1'
- paths: ['file.txt']
+```plaintext
+https://gitlab.com/api/v4/projects/<project-id>/jobs/artifacts/main/download?job=build
```
-With this configuration, GitLab adds a link **artifact 1** to the relevant merge request
-that points to `file.txt`. To access the link, select **View exposed artifact**
-below the pipeline graph in the merge request overview.
-
-An example that matches an entire directory:
+For example, to download the file `review/index.html` from the latest job named `build` in the `main` branch of a project on GitLab.com:
-```yaml
-test:
- script: ["mkdir test && echo 'test' > test/file.txt"]
- artifacts:
- expose_as: 'artifact 1'
- paths: ['test/']
+```plaintext
+https://gitlab.com/api/v4/projects/<project-id>/jobs/artifacts/main/raw/review/index.html?job=build
```
-## Retrieve job artifacts for other projects
-
-To retrieve a job artifact from a different project, you might need to use a
-private token to [authenticate and download](../../api/job_artifacts.md#get-job-artifacts)
-the artifact.
+In both examples, replace `<project-id>` with a valid project ID, found at the top of the project details page.
-## How searching for job artifacts works
+Artifacts for [parent and child pipelines](downstream_pipelines.md#parent-child-pipelines)
+are searched in hierarchical order from parent to child. For example, if both parent and
+child pipelines have a job with the same name, the job artifacts from the parent pipeline are returned.
-In [GitLab 13.5 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/201784), artifacts
-for [parent and child pipelines](downstream_pipelines.md#parent-child-pipelines) are searched in hierarchical
-order from parent to child. For example, if both parent and child pipelines have a
-job with the same name, the job artifact from the parent pipeline is returned.
+### From a URL with the artifacts browser
-## Access the latest job artifacts
+You can browse the job artifacts of the latest successful pipeline for a specific job
+with a publicly accessible URL.
-You can download job artifacts from the latest successful pipeline by using [the job artifacts API](../../api/job_artifacts.md).
-You cannot download [artifact reports](../yaml/artifacts_reports.md) with the job artifacts API,
-unless the report is added as a regular artifact with `artifacts:paths`.
-
-### Download the whole artifacts archive for a specific job
-
-You can download the artifacts archive for a specific job with [the job artifacts API](../../api/job_artifacts.md#download-the-artifacts-archive).
-
-For example, to download the latest artifacts of a job named `build` in the `main` branch of a project on GitLab.com:
+For example, to browse the latest artifacts of a job named `build` in the `main` branch of a project on GitLab.com:
```plaintext
-https://gitlab.com/api/v4/projects/<project-id>/jobs/artifacts/main/download?job=build
+https://gitlab.com/<full-project-path>/-/jobs/artifacts/main/browse?job=build
```
-Replace `<project-id>` with a valid project ID, found at the top of the project details page.
+Replace `<full-project-path>` with a valid project path, you can find it in the URL for your project.
-### Download a single file from the artifacts
+## Delete job log and artifacts
-You can download a specific file from the artifacts archive for a specific job with [the job artifacts API](../../api/job_artifacts.md#download-a-single-artifact-file-by-job-id).
+WARNING:
+Deleting the job log and artifacts is a destructive action that cannot be reverted. Use with caution.
-For example, to download the file `review/index.html` from the latest job named `build` in the `main` branch of the `gitlab` project in the `gitlab-org` namespace:
+You can delete a job's artifacts and log.
-```plaintext
-https://gitlab.com/api/v4/projects/27456355/jobs/artifacts/main/raw/review/index.html?job=build
-```
+Prerequisites:
-### Browse job artifacts
+- You must be the owner of the job or a user with at least the Maintainer role for the project.
-To browse the job artifacts of the latest successful pipeline for a specific job you can use the following URL:
+To delete a job:
-```plaintext
-https://example.com/<namespace>/<project>/-/jobs/artifacts/<ref>/browse?job=<job_name>
-```
+1. Go to a job's detail page.
+1. In the upper-right corner of the job's log, select **Erase job log and artifacts** (**{remove}**).
-For example, to browse the latest artifacts of a job named `build` in the `main` branch of a project on GitLab.com:
+## Link to job artifacts in the merge request UI
-```plaintext
-https://gitlab.com/<full-project-path>/-/jobs/artifacts/main/browse?job=build
-```
+Use the [`artifacts:expose_as`](../yaml/index.md#artifactsexpose_as) keyword to display
+a link to [job artifacts](../pipelines/job_artifacts.md) in the [merge request](../../user/project/merge_requests/index.md) UI.
-Replace `<full-project-path>` with a valid project path, you can find it in the URL for your project.
+For example, for an artifact with a single file:
-## When job artifacts are deleted
+```yaml
+test:
+ script: ["echo 'test' > file.txt"]
+ artifacts:
+ expose_as: 'artifact 1'
+ paths: ['file.txt']
+```
-See the [`expire_in`](../yaml/index.md#artifactsexpire_in) documentation for information on when
-job artifacts are deleted.
+With this configuration, GitLab adds **artifact 1** as a link to `file.txt` to the
+**View exposed artifact** section of the relevant merge request.
-### Keep artifacts from most recent successful jobs
+## Keep artifacts from most recent successful jobs
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16267) in GitLab 13.0.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/229936) in GitLab 13.4.
@@ -400,7 +321,7 @@ You can disable this behavior for all projects on a self-managed instance in the
When **Keep artifacts from most recent successful jobs** is enabled, artifacts are always kept for [blocked](../jobs/job_control.md#types-of-manual-jobs)
pipelines. These artifacts expire only after the blocking job is triggered and the pipeline completes.
-For more information, see [issue 387087](https://gitlab.com/gitlab-org/gitlab/-/issues/387087).
+[Issue 387087](https://gitlab.com/gitlab-org/gitlab/-/issues/387087) proposes to change this behavior.
## Troubleshooting
@@ -416,49 +337,55 @@ the keyword reference for information on how to fetch artifacts with these keywo
- [`needs`](../yaml/index.md#needs)
- [`needs:artifacts`](../yaml/index.md#needsartifacts)
-### Job artifacts using too much disk space
+### Job artifacts use too much disk space
-There are a number of potential causes for this.
-[Read more in the job artifacts administration documentation](../../administration/job_artifacts.md#job-artifacts-using-too-much-disk-space).
+If job artifacts are using too much disk space, see the
+[job artifacts administration documentation](../../administration/job_artifacts.md#job-artifacts-using-too-much-disk-space).
### Error message `No files to upload`
-This message is often preceded by other errors or warnings that specify the filename and why it wasn't
-generated. Check the job log for these messages.
+This message appears in job logs when a the runner can't find the file to upload. Either
+the path to the file is incorrect, or the file was not created. You can check the job
+log for other errors or warnings that specify the filename and why it wasn't
+generated.
-If you find no helpful messages, retry the failed job after activating
-[CI/CD debug logging](../variables/index.md#enable-debug-logging).
-This logging should provide information to help you investigate further.
+For more detailed job logs, you can [enable CI/CD debug logging](../variables/index.md#enable-debug-logging)
+and try the job again. This logging might provide more information about why the file
+wasn't created.
### Error message `Missing /usr/bin/gitlab-runner-helper. Uploading artifacts is disabled.`
-There is a [known issue](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3068) where setting a CI/CD variable named `DEBUG` can cause artifact uploads to fail.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3068) in GitLab 15.2, GitLab Runner uses `RUNNER_DEBUG` instead of `DEBUG`, fixing this issue.
-To work around this, either use a different variable name or set it inline with `script`:
+In GitLab 15.1 and earlier, setting a CI/CD variable named `DEBUG` can cause artifact uploads to fail.
-```yaml
-# This job might fail due to issue gitlab-org/gitlab-runner#3068
-failing_test_job:
- variables:
- DEBUG: true
- script: bin/mycommand
- artifacts:
- paths:
- - bin/results
+To work around this, you can:
-# This job does not define a CI/CD variable named `DEBUG` and is not affected by the issue
-successful_test_job:
- script: DEBUG=true bin/mycommand
- artifacts:
- paths:
- - bin/results
-```
+- Update to GitLab and GitLab Runner 15.2
+- Use a different variable name
+- Set it as an environment variable in a `script` command:
-### Error message `FATAL: invalid argument` when uploading a dotenv artifact on a windows runner
+ ```yaml
+ failing_test_job: # This job might fail due to issue gitlab-org/gitlab-runner#3068
+ variables:
+ DEBUG: true
+ script: bin/mycommand
+ artifacts:
+ paths:
+ - bin/results
+
+ successful_test_job: # This job does not define a CI/CD variable named `DEBUG` and is not affected by the issue
+ script: DEBUG=true bin/mycommand
+ artifacts:
+ paths:
+ - bin/results
+ ```
+
+### Error message `FATAL: invalid argument` when uploading a dotenv artifact on a Windows runner
The PowerShell `echo` command writes files with UCS-2 LE BOM (Byte Order Mark) encoding,
-but only UTF-8 is supported. If you try create the dotenv artifact with `echo`, it causes a
-`FATAL: invalid argument` error.
+but only UTF-8 is supported. If you try to create a [`dotenv`](../yaml/artifacts_reports.md)
+artifact with `echo`, it causes a `FATAL: invalid argument` error.
Use PowerShell `Add-Content` instead, which uses UTF-8:
@@ -475,7 +402,7 @@ test-job:
dotenv: build.env
```
-### Job artifacts are not expired
+### Job artifacts do not expire
If some job artifacts are not expiring as expected, check if the
[**Keep artifacts from most recent successful jobs**](#keep-artifacts-from-most-recent-successful-jobs)
@@ -486,39 +413,42 @@ of each ref do not expire and are not deleted.
### Error message `This job could not start because it could not retrieve the needed artifacts.`
-A job configured with [`needs:artifacts`](../yaml/index.md#needsartifacts) keyword
+A job configured with the [`needs:artifacts`](../yaml/index.md#needsartifacts) keyword
fails to start and returns this error message if:
- The job's dependencies cannot be found.
- The job cannot access the relevant resources due to insufficient permissions.
-The troubleshooting steps to follow are determined by the syntax used in the job configuration.
+The troubleshooting steps to follow differ based on the syntax the job uses:
+
+- [`needs:project`](#for-a-job-configured-with-needsproject)
+- [`needs:pipeline:job`](#for-a-job-configured-with-needspipelinejob)
-#### Job configured with `needs:project`
+#### For a job configured with `needs:project`
The `could not retrieve the needed artifacts.` error can happen for a job using
-[`needs:project`](../yaml/index.md#needsproject), with a configuration similar to:
+[`needs:project`](../yaml/index.md#needsproject) with a configuration similar to:
```yaml
rspec:
needs:
- - project: org/another-project
+ - project: my-group/my-project
job: dependency-job
ref: master
artifacts: true
```
-To troubleshoot this job, verify that:
+To troubleshoot this error, verify that:
-- Project `org/another-project` is in a group with a Premium subscription plan.
-- The user running the job has permissions to access resources in `org/another-project`.
+- Project `my-group/my-project` is in a group with a Premium subscription plan.
+- The user running the job can access resources in `my-group/my-project`.
- The `project`, `job`, and `ref` combination exists and results in the desired dependency.
- Any variables in use evaluate to the correct values.
-#### Job configured with `needs:pipeline:job`
+#### For a job configured with `needs:pipeline:job`
The `could not retrieve the needed artifacts.` error can happen for a job using
-[`needs:pipeline:job`](../yaml/index.md#needspipelinejob), with a configuration similar to:
+[`needs:pipeline:job`](../yaml/index.md#needspipelinejob) with a configuration similar to:
```yaml
rspec:
@@ -528,9 +458,9 @@ rspec:
artifacts: true
```
-To troubleshoot this job, verify that:
+To troubleshoot this error, verify that:
- The `$UPSTREAM_PIPELINE_ID` CI/CD variable is available in the current pipeline's
- parent-child pipeline hierarchy.
+ parent-child pipeline hierarchy.
- The `pipeline` and `job` combination exists and resolves to an existing pipeline.
- `dependency-job` has run and finished successfully.
diff --git a/doc/ci/runners/configure_runners.md b/doc/ci/runners/configure_runners.md
index 41dda5da0b2..cc30f661bf2 100644
--- a/doc/ci/runners/configure_runners.md
+++ b/doc/ci/runners/configure_runners.md
@@ -249,6 +249,29 @@ Example 2:
1. A job that has no tags defined is executed and run.
1. A second job that has a `docker` tag defined is stuck.
+### A runner and a job have multiple tags
+
+The selection logic that matches the job and runner is based on the list of `tags`
+defined in the job.
+
+The following examples illustrate the impact of a runner and a job having multiple tags. For a runner to be
+selected to run a job, it must have all of the tags defined in the job script block.
+
+Example 1:
+
+1. The runner is configured with the tags `[docker, shell, gpu]`.
+1. The job has the tags `[docker, shell, gpu]` and is executed and run.
+
+Example 2:
+
+1. The runner is configured with the tags `[docker, shell, gpu]`.
+1. The job has the tags `[docker, shell,]` and is executed and run.
+
+Example 3:
+
+1. The runner is configured with the tags `[docker, shell]`.
+1. The job has the tags `[docker, shell, gpu]` and is not executed.
+
### Use tags to run jobs on different platforms
You can use tags to run different jobs on different platforms. For
@@ -782,7 +805,7 @@ variables:
NOTE:
Zip archives are the only supported artifact type. Follow [the issue for details](https://gitlab.com/gitlab-org/gitlab/-/issues/367203).
-GitLab Runner can generate and produce attestation metadata for all build artifacts. To enable this feature, you must set the `RUNNER_GENERATE_ARTIFACTS_METADATA` environment variable to `true`. This variable can either be set globally or it can be set for individual jobs. The metadata is in rendered in a plain text `.json` file that's stored with the artifact. The filename is as follows: `{ARTIFACT_NAME}-metadata.json` where `ARTIFACT_NAME` is what was defined as the [name for the artifact](../pipelines/job_artifacts.md#use-cicd-variables-to-define-the-artifacts-name) in the CI file. The filename, however, defaults to `artifacts-metadata.json` if no name was given to the build artifacts.
+GitLab Runner can generate and produce attestation metadata for all build artifacts. To enable this feature, you must set the `RUNNER_GENERATE_ARTIFACTS_METADATA` environment variable to `true`. This variable can either be set globally or it can be set for individual jobs. The metadata is in rendered in a plain text `.json` file that's stored with the artifact. The filename is as follows: `{ARTIFACT_NAME}-metadata.json` where `ARTIFACT_NAME` is what was defined as the [name for the artifact](../pipelines/job_artifacts.md#with-cicd-variables-to-define-the-artifacts-name) in the CI file. The filename, however, defaults to `artifacts-metadata.json` if no name was given to the build artifacts.
### Attestation format
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index 9730b575fee..0bbd3bf37b4 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -829,7 +829,7 @@ subdirectories of `binaries/`.
**Related topics**:
-- [Exclude files from job artifacts](../pipelines/job_artifacts.md#exclude-files-from-job-artifacts).
+- [Exclude files from job artifacts](../pipelines/job_artifacts.md#without-excluded-files).
#### `artifacts:expire_in`
@@ -842,9 +842,9 @@ subdirectories of `binaries/`.
Use `expire_in` to specify how long [job artifacts](../pipelines/job_artifacts.md) are stored before
they expire and are deleted. The `expire_in` setting does not affect:
-- Artifacts from the latest job, unless keeping the latest job artifacts is:
- - [Disabled at the project level](../pipelines/job_artifacts.md#keep-artifacts-from-most-recent-successful-jobs).
- - [Disabled instance-wide](../../user/admin_area/settings/continuous_integration.md#keep-the-latest-artifacts-for-all-jobs-in-the-latest-successful-pipelines).
+- Artifacts from the latest job, unless keeping the latest job artifacts is disabled
+ [at the project level](../pipelines/job_artifacts.md#keep-artifacts-from-most-recent-successful-jobs).
+ or [instance-wide](../../user/admin_area/settings/continuous_integration.md#keep-the-latest-artifacts-for-all-jobs-in-the-latest-successful-pipelines).
- [Pipeline artifacts](../pipelines/pipeline_artifacts.md). You can't specify an expiration date for
pipeline artifacts. See [When pipeline artifacts are deleted](../pipelines/pipeline_artifacts.md#when-pipeline-artifacts-are-deleted)
for more information.
@@ -890,7 +890,7 @@ job:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15018) in GitLab 12.5.
Use the `artifacts:expose_as` keyword to
-[expose job artifacts in the merge request UI](../pipelines/job_artifacts.md#expose-job-artifacts-in-the-merge-request-ui).
+[expose job artifacts in the merge request UI](../pipelines/job_artifacts.md#link-to-job-artifacts-in-the-merge-request-ui).
**Keyword type**: Job keyword. You can use it only as part of a job or in the
[`default` section](#default).
@@ -927,7 +927,7 @@ test:
**Related topics**:
-- [Expose job artifacts in the merge request UI](../pipelines/job_artifacts.md#expose-job-artifacts-in-the-merge-request-ui).
+- [Expose job artifacts in the merge request UI](../pipelines/job_artifacts.md#link-to-job-artifacts-in-the-merge-request-ui).
#### `artifacts:name`
@@ -958,7 +958,7 @@ job:
**Related topics**:
-- [Use CI/CD variables to define the artifacts name](../pipelines/job_artifacts.md#use-cicd-variables-to-define-the-artifacts-name).
+- [Use CI/CD variables to define the artifacts name](../pipelines/job_artifacts.md#with-cicd-variables-to-define-the-artifacts-name).
#### `artifacts:public`
@@ -1053,7 +1053,7 @@ job:
**Related topics**:
-- [Add untracked files to artifacts](../pipelines/job_artifacts.md#add-untracked-files-to-artifacts).
+- [Add untracked files to artifacts](../pipelines/job_artifacts.md#with-untracked-files).
#### `artifacts:when`
@@ -1626,7 +1626,7 @@ the [stage](#stages) precedence.
- The job status does not matter. If a job fails or it's a manual job that isn't triggered, no error occurs.
- If the artifacts of a dependent job are [expired](#artifactsexpire_in) or
- [deleted](../pipelines/job_artifacts.md#delete-job-artifacts), then the job fails.
+ [deleted](../pipelines/job_artifacts.md#delete-job-log-and-artifacts), then the job fails.
### `environment`
diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md
index 48bc98caada..767276bebcb 100644
--- a/doc/development/documentation/styleguide/word_list.md
+++ b/doc/development/documentation/styleguide/word_list.md
@@ -687,7 +687,7 @@ Remove **-ing** words whenever possible. They can be difficult to translate,
and more precise terms are usually available. For example:
- Instead of **The files using storage are deleted**, use **The files that use storage are deleted**.
-- Instead of **Delete files using the Edit button**, use **Delete files by using the Edit button**.
+- Instead of **Delete files using the Edit button**, use **Use the Edit button to delete files**.
- Instead of **Replicating your server is required**, use **You must replicate your server**.
## issue
diff --git a/doc/development/internal_users.md b/doc/development/internal_users.md
index 67000d969af..541a7117c6a 100644
--- a/doc/development/internal_users.md
+++ b/doc/development/internal_users.md
@@ -44,5 +44,8 @@ Other examples of internal users:
- [Ghost User](../user/profile/account/delete_account.md#associated-records)
- [Support Bot](../user/project/service_desk.md#support-bot-user)
- Visual Review Bot
-- Resource access tokens (including [project access tokens](../user/project/settings/project_access_tokens.md)).
- These are implemented as `project_bot` users with a `PersonalAccessToken`.
+- Resource access tokens, including:
+ - [Project access tokens](../user/project/settings/project_access_tokens.md).
+ - [Group access tokens](../user/group/settings/group_access_tokens.md).
+
+ These are implemented as `project_{project_id}_bot_{random_string}` i.e. `group_{group_id}_bot_{random_string}` users, with a `PersonalAccessToken`.
diff --git a/doc/tutorials/index.md b/doc/tutorials/index.md
index 7a94583ae69..3df89a23379 100644
--- a/doc/tutorials/index.md
+++ b/doc/tutorials/index.md
@@ -16,7 +16,7 @@ and running quickly.
| Topic | Description | Good for beginners |
|-------|-------------|--------------------|
| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Introduction to GitLab](https://youtu.be/_4SmIyQ5eis?t=90) (59m 51s) | Walk through recommended processes and example workflows for using GitLab. | **{star}** |
-| [GitLab 101](https://levelup.gitlab.com/learn/course/gitlab101) | Learn the basics of GitLab in this certification course. | **{star}** |
+| [GitLab with Git Essentials](https://levelup.gitlab.com/courses/gitlab-with-git-essentials) | Learn the basics of Git and GitLab in this self-paced course. | **{star}** |
| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Use GitLab for DevOps](https://www.youtube.com/watch?v=7q9Y1Cv-ib0) (12m 34s) | Use GitLab through the entire DevOps lifecycle, from planning to monitoring. | **{star}** |
| [Use Markdown at GitLab](../user/markdown.md) | GitLab Flavored Markdown (GLFM) is used in many areas of GitLab, for example, in merge requests. | **{star}** |
| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Learn GitLab project walkthrough](https://www.youtube.com/watch?v=-oaI2WEKdI4&list=PL05JrBw4t0KofkHq4GZJ05FnNGa11PQ4d) (59m 2s) | Step through the tutorial-style issues in the **Learn GitLab** project. If you don't have this project, download [the export file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/vendor/project_templates/learn_gitlab_ultimate.tar.gz) and [import it to a new project](../user/project/settings/import_export.md#import-a-project-and-its-data). | |
@@ -113,7 +113,7 @@ enabling you to work with those services directly from GitLab.
If you're learning about GitLab, here are some ways you can find more tutorial
content:
-- Find learning tracks and certification options at [GitLab Learn](https://about.gitlab.com/learn/).
+- Find learning tracks and certification options at [Level Up](https://levelup.gitlab.com/).
GitLab learning platform login required (email and password for non-GitLab team members).
- Find recent tutorials on the GitLab blog by [searching by the `tutorial` tag](https://about.gitlab.com/blog/tags.html#tutorial).
diff --git a/doc/user/admin_area/monitoring/health_check.md b/doc/user/admin_area/monitoring/health_check.md
index 668d34af024..f3b09c61532 100644
--- a/doc/user/admin_area/monitoring/health_check.md
+++ b/doc/user/admin_area/monitoring/health_check.md
@@ -92,8 +92,6 @@ Example response:
On failure, the endpoint returns a `503` HTTP status code.
-This check does hit the database and Redis if authenticated via `token`.
-
This check is being exempt from Rack Attack.
## Liveness
diff --git a/doc/user/packages/dependency_proxy/index.md b/doc/user/packages/dependency_proxy/index.md
index 1ed57d8a7b1..d7cf33cc2a4 100644
--- a/doc/user/packages/dependency_proxy/index.md
+++ b/doc/user/packages/dependency_proxy/index.md
@@ -342,25 +342,21 @@ Authenticating with credentials from job payload (GitLab Registry)
Make sure you are using the expected authentication mechanism.
-### "Not Found" error when pulling image
+### `Not Found` or `404` error when pulling image
-Docker errors similar to the following may indicate that the user running the build job doesn't have
-a minimum of the Guest role in the specified Dependency Proxy group:
+Errors like these might indicate that the user running the job doesn't have
+a minimum of the Guest role in the Dependency Proxy group:
-```plaintext
-ERROR: gitlab.example.com:443/group1/dependency_proxy/containers/alpine:latest: not found
+- ```plaintext
+ ERROR: gitlab.example.com:443/group1/dependency_proxy/containers/alpine:latest: not found
-failed to solve with frontend dockerfile.v0: failed to create LLB definition:
-gitlab.example.com:443/group1/dependency_proxy/containers/alpine:latest: not found
-```
+ failed to solve with frontend dockerfile.v0: failed to create LLB definition: gitlab.example.com:443/group1/dependency_proxy/containers/alpine:latest: not found
+ ```
-```plaintext
-ERROR: Job failed: failed to pull image
-"gitlab.example.com:443/group1/dependency_proxy/containers/alpine:latest" with specified policies [always]:
-Error response from daemon: error parsing HTTP 404 response body:
-unexpected end of JSON input: "" (manager.go:237:1s)
-```
+- ```plaintext
+ ERROR: Job failed: failed to pull image "gitlab.example.com:443/group1/dependency_proxy/containers/alpine:latest" with specified policies [always]:
+ Error response from daemon: error parsing HTTP 404 response body: unexpected end of JSON input: "" (manager.go:237:1s)
+ ```
-NOTE:
-The work to correctly display `Access denied` errors in such cases is being tracked in the following issue:
-[Dependency proxy error reporting confusing - "404/not found" should be "access denied" when not group member](https://gitlab.com/gitlab-org/gitlab/-/issues/354826).
+For more information about the work to improve the error messages in similar cases to `Access denied`,
+see [issue 354826](https://gitlab.com/gitlab-org/gitlab/-/issues/354826).
diff --git a/doc/user/project/badges.md b/doc/user/project/badges.md
index 2d36a378b82..65b072034ce 100644
--- a/doc/user/project/badges.md
+++ b/doc/user/project/badges.md
@@ -279,7 +279,7 @@ To add a new badge with a custom image to a group or project:
1. Select **Add badge**.
To learn how to use custom images generated through a pipeline, see the documentation on
-[accessing the latest job artifacts by URL](../../ci/pipelines/job_artifacts.md#access-the-latest-job-artifacts).
+[accessing the latest job artifacts by URL](../../ci/pipelines/job_artifacts.md#from-a-url).
## Placeholders
diff --git a/doc/user/project/merge_requests/creating_merge_requests.md b/doc/user/project/merge_requests/creating_merge_requests.md
index e5d9f46c75b..2043bf16af9 100644
--- a/doc/user/project/merge_requests/creating_merge_requests.md
+++ b/doc/user/project/merge_requests/creating_merge_requests.md
@@ -33,7 +33,8 @@ be associated with a given target branch at a time.
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).
+After merging the merge request, the issue is closed automatically, unless
+[automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing).
You can see a **Create merge request** dropdown list below the issue description.
NOTE:
@@ -57,8 +58,8 @@ The dropdown list contains the options **Create merge request and branch** and *
After selecting one of these options, a new branch or branch and merge request
is created based on your project's [default branch](../repository/branches/default.md).
-The branch name is based on your project's branch name template. The default template
-is `%{id}-%{title}`. Supported variables for branch name templates are `%{id}` and `%{title}`.
+The branch name is based on your project's [branch name template](../repository/branches/index.md),
+but this value can be changed.
When you select **Create branch** in an empty
repository project, GitLab performs these actions:
diff --git a/doc/user/project/repository/branches/index.md b/doc/user/project/repository/branches/index.md
index 4382d666ac6..f4973c81ef8 100644
--- a/doc/user/project/repository/branches/index.md
+++ b/doc/user/project/repository/branches/index.md
@@ -25,6 +25,61 @@ Branches are the foundation of development in a project:
1. Preview changes in a branch with a [review app](../../../../ci/review_apps/index.md).
1. After the contents of your branch are merged, [delete the merged branch](#delete-merged-branches).
+## Create branch
+
+To create a new branch from the GitLab UI:
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Repository > Branches**.
+1. On the top right, select **New branch**.
+1. Enter a **Branch name**.
+1. In **Create from**, select the base of your branch: an existing branch, an existing
+ tag, or a commit SHA.
+1. Select **Create branch**.
+
+### In a blank project
+
+A [blank project](../../index.md#create-a-blank-project) does not contain a branch, but
+you can add one.
+
+Prerequisites:
+
+- You must have at least the Developer role in the project.
+- Unless you have the Maintainer or Owner roles, the
+ [default branch protection](../../../group/manage.md#change-the-default-branch-protection-of-a-group)
+ must be set to `Partially protected` or `Not protected` for you to push a commit
+ to the default branch.
+
+To add a [default branch](default.md) to an empty project:
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. Scroll to **The repository for this project is empty** and select the type of
+ file you want to add.
+1. In the Web IDE, make any desired changes to this file, then select **Create commit**.
+1. Enter a commit message, and select **Commit**.
+
+GitLab creates a default branch and adds your file to it.
+
+### From an issue
+
+When viewing an issue, you can create an associated branch directly from that page.
+
+Prerequisites:
+
+- You must have the Developer or higher role in the project.
+
+To create a branch from an issue:
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Issues** (**{issues}**) and find your issue.
+1. Below the issue description, find the **Create merge request** dropdown list, and select
+ **{chevron-down}** to display the dropdown list.
+1. Select **Create branch**. A default **Branch name** is provided, based on the
+ [default pattern](#configure-default-pattern-for-branch-names-from-issues) for
+ this project. If desired, enter a different **Branch name**.
+1. Select **Create branch** to create the branch based on your project's
+ [default branch](default.md).
+
## Manage and protect branches
GitLab provides you multiple methods to protect individual branches. These methods
@@ -99,7 +154,35 @@ To view the **Branch rules overview** list:
- [Approval rules](../../merge_requests/approvals/rules.md).
- [Status checks](../../merge_requests/status_checks.md).
-## Prefix branch names with issue numbers
+## Name your branch
+
+If you follow GitLab standards for [naming branches](#prefix-branch-names-with-issue-numbers),
+and configure branch names that follow these standards, GitLab can streamline your workflow:
+
+- Connect a merge request to its parent issue.
+- Connect a branch to an issue.
+- [Close the issue](../../issues/managing_issues.md#closing-issues-automatically)
+ when the connected merge request closes, and the connected branch merges.
+
+### Configure default pattern for branch names from issues
+
+By default, GitLab uses the pattern `%{id}-%{title}` when creating a branch from
+an issue, but you can change this pattern.
+
+Prerequisites:
+
+- You must have at least the Maintainer role for the project.
+
+To change the default pattern for branches created from issues:
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Settings > Repository** and expand **Branch defaults**.
+1. Scroll to **Branch name template** and enter a value. The field supports these variables:
+ - `%{id}`: The numeric ID of the issue.
+ - `%{title}`: The title of the issue, modified to use only characters acceptable in Git branch names.
+1. Select **Save changes**.
+
+### Prefix branch names with issue numbers
To streamline the creation of merge requests, start your branch name with an
issue number. GitLab uses the issue number to import data into the merge request: