Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1b8e9249
Commit
1b8e9249
authored
May 14, 2020
by
Marcia Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Versioned Snippets: move section below description
parent
b8a955f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
40 deletions
+40
-40
doc/user/snippets.md
doc/user/snippets.md
+40
-40
No files found.
doc/user/snippets.md
View file @
1b8e9249
...
...
@@ -11,6 +11,44 @@ There are two types of snippets:
-
Personal snippets.
-
Project snippets.
## Personal snippets
Personal snippets are not related to any project and can be created completely
independently. There are 3 visibility levels that can be set, public, internal
and private. See
[
Public access
](
../public_access/public_access.md
)
for more information.
## Project snippets
Project snippets are always related to a specific project.
See
[
Project features
](
project/index.md#project-features
)
for more information.
## Create a snippet
To create a personal snippet, click the plus icon (
**{plus-square-o}**
)
on the top navigation and select
**New snippet**
from the dropdown menu:
![
New personal snippet from non-project pages
](
img/new_personal_snippet_v12_10.png
)
If you're on a project's page but you want to create a new personal snippet,
click the plus icon (
**{plus-square-o}**
) and select
**New snippet**
from the
lower part of the dropdown (
**GitLab**
on GitLab.com;
**Your Instance**
on
self-managed instances):
![
New personal snippet from project pages
](
img/new_personal_snippet_from_project_v12_10.png
)
To create a project snippet, navigate to your project's page and click the
plus icon (
**{plus-square-o}**
), then select
**New snippet**
from the upper
part of the dropdown (
**This project**
).
![
New personal snippet from project pages
](
img/new_project_snippet_from_project_v12_10.png
)
From there, add the
**Title**
,
**Description**
, and a
**File**
name with the
appropriate extension (for example,
`example.rb`
,
`index.html`
).
CAUTION:
**Warning:**
Make sure to add the file name to get code highlighting and to avoid this
[
copy-pasting bug
](
https://gitlab.com/gitlab-org/gitlab/-/issues/22870
)
.
## Versioned Snippets
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/239) in GitLab 13.0.
...
...
@@ -61,7 +99,7 @@ master branch.
### Limitations
-
Binary files are not supported.
-
Creating or deleting branches is not supported. Only a default
*master*
-
Creating or deleting branches is not supported. Only a default
*master*
.
branch is used.
-
Git tags are not supported in snippet repositories.
-
Snippets' repositories are limited to one file. Attempting to push more
...
...
@@ -70,45 +108,7 @@ than one file will result in an error.
it's planned to be added in future iterations. See the
[
revisions tab issue
](
https://gitlab.com/gitlab-org/gitlab/-/issues/39271
)
for updates.
-
The
[
maximum size for a snippet
](
../administration/snippets/index.md#snippets-content-size-limit
)
is 50MB, by default.
## Personal snippets
Personal snippets are not related to any project and can be created completely
independently. There are 3 visibility levels that can be set, public, internal
and private. See
[
Public access
](
../public_access/public_access.md
)
for more information.
## Project snippets
Project snippets are always related to a specific project.
See
[
Project features
](
project/index.md#project-features
)
for more information.
## Create a snippet
To create a personal snippet, click the plus icon (
**{plus-square-o}**
)
on the top navigation and select
**New snippet**
from the dropdown menu:
![
New personal snippet from non-project pages
](
img/new_personal_snippet_v12_10.png
)
If you're on a project's page but you want to create a new personal snippet,
click the plus icon (
**{plus-square-o}**
) and select
**New snippet**
from the
lower part of the dropdown (
**GitLab**
on GitLab.com;
**Your Instance**
on
self-managed instances):
![
New personal snippet from project pages
](
img/new_personal_snippet_from_project_v12_10.png
)
To create a project snippet, navigate to your project's page and click the
plus icon (
**{plus-square-o}**
), then select
**New snippet**
from the upper
part of the dropdown (
**This project**
).
![
New personal snippet from project pages
](
img/new_project_snippet_from_project_v12_10.png
)
From there, add the
**Title**
,
**Description**
, and a
**File**
name with the
appropriate extension (for example,
`example.rb`
,
`index.html`
).
CAUTION:
**Warning:**
Make sure to add the file name to get code highlighting and to avoid this
[
copy-pasting bug
](
https://gitlab.com/gitlab-org/gitlab/-/issues/22870
)
.
is 50 MB, by default.
## Discover snippets
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment