Share code with GitLab snippets
Use GitLab snippets to store and quickly share bits of code, files, or entire folders with others.
Create a snippet
Select a code fragment in the editor, or files and folders you want to include to the new snippet in the Project tool window (Alt+1).
Right-click the selection to open the context menu and then select Create Snippet.
The Create a GitLab Snippet dialog opens.
Specify the Project parameter:
If you want to create a project snippet, choose a project from the list of available GitLab projects you can create your snippet for.
To make this snippet listed under the chosen project, but visible only to you, keep the Private box checked.
If you want to create a personal snippet, choose None.
Add a title and, optionally, a description of the new snippet.
Specify the Path handling mode parameter to prevent duplication when passing the name of each file in the snippet to GitLab:
Relative: to find the nearest common parent of the selected files and pass along the paths to the files relative to that common parent.
Content root relative: to include the path of the files relative to the module.
Project relative: to include the path of the files relative to the project.
No paths: to pass along the filenames only, without a path.
Select the Private checkbox to make this snippet visible only to you.
Select the Copy URL checkbox to copy the link to the new snippet once it is created.
Select the Open in browser checkbox to open the new snippet in a default browser once the snippet is created.