diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /doc/user/snippets.md | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'doc/user/snippets.md')
-rw-r--r-- | doc/user/snippets.md | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/doc/user/snippets.md b/doc/user/snippets.md index dc3ab35067e..1750e2c8d10 100644 --- a/doc/user/snippets.md +++ b/doc/user/snippets.md @@ -33,20 +33,18 @@ You can create snippets in multiple ways, depending on whether you want to creat 1. Select the kind of snippet you want to create: - **To create a personal snippet**: On the - [Snippets dashboard](https://gitlab.com/dashboard/snippets), click + [Snippets dashboard](https://gitlab.com/dashboard/snippets), select **New snippet**, or: - *If you're on a project's page,* select the plus icon (**{plus-square-o}**) in the top navigation bar, and then select **New snippet** from the - **GitLab** (GitLab SaaS) or **Your Instance** (self-managed) section - of the same dropdown menu. + **GitLab** section of the same dropdown list. - *For all other pages,* select the plus icon (**{plus-square-o}**) - in the top navigation bar, then select **New snippet** from the dropdown - menu. + in the top navigation bar, then select **New snippet** from the dropdown list. - If you installed the [GitLab Workflow VS Code extension](project/repository/vscode.md), use the [`Gitlab: Create snippet` command](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#create-snippet). - **To create a project snippet**: Go to your project's page. Select the plus icon (**{plus-square-o}**), and then select **New snippet** from the - **This project** section of the dropdown menu. + **This project** section of the dropdown list. 1. Add a **Title** and **Description**. 1. Name your **File** with an appropriate extension, such as `example.rb` or `index.html`. Filenames with appropriate extensions display [syntax highlighting](#filenames). @@ -154,15 +152,14 @@ To delete a file from your snippet through the GitLab UI: 1. Go to your snippet in the GitLab UI. 1. Select **Edit** in the top right corner. -1. Select **Delete file** alongside the filename of each file -you wish to delete. +1. Select **Delete file** alongside the filename of each file you wish to delete. 1. Select **Save changes**. ## Clone snippets Instead of copying a snippet to a local file, you may want to clone a snippet to preserve its relationship with the repository, so you can receive or make updates -as needed. Select the **Clone** button on a snippet to display the URLs to clone with SSH or HTTPS: +as needed. Select **Clone** on a snippet to display the URLs to clone with SSH or HTTPS: ![Clone snippet](img/snippet_clone_button_v13_0.png) @@ -202,7 +199,7 @@ For example: ## Download snippets You can download the raw content of a snippet. By default, they download with Linux-style line endings (`LF`). If -you want to preserve the original line endings you need to add a parameter `line_ending=raw` +you want to preserve the original line endings you must add a parameter `line_ending=raw` (For example: `https://gitlab.com/snippets/SNIPPET_ID/raw?line_ending=raw`). In case a snippet was created using the GitLab web interface the original line ending is Windows-like (`CRLF`). |