Share code with GitLab snippets
GitLab settings: Settings | Version Control | GitLab
Required plugins: Git and GitLab (bundled and enabled by default)
Use GitLab snippets to store and quickly share bits of code, files, or entire folders with others.
note
To use this feature, you should be logged in to your GitLab account or have at least one repository linked to a remote GitLab project.
Select a code fragment in the editor, or files and folders you want to include to the new snippet in the Project tool window Alt01.
note
Selecting a folder includes all files in it.
A single snippet can support up to 10 files.
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.
Click OK.
Thanks for your feedback!