Snippets
Snippets are standalone pieces of code or text that aren't tied to a repository — handy for sharing a configuration file, a log excerpt, or a quick code sample. Each snippet has a title, an optional description, a file name, and its content.
Creating a Snippet
- Go to Snippets and click New snippet (you must be signed in)
- Enter a Title (required)
- Optionally add a Description
-
Set a File name (e.g.
snippet.ex). The extension determines syntax highlighting; if omitted it defaults tosnippet.txt - Choose a Visibility level (see below)
- Paste your code or text into Content (required)
- Click Create snippet
Visibility
Each snippet has one of three visibility levels:
| Level | Who can see it |
|---|---|
private |
Only you, the author. This is the default. |
internal |
Any signed-in user on this GitBlixt instance. |
public |
Anyone, including visitors who aren't signed in. |
The Snippets list shows all public snippets, plus your own snippets of any visibility when you're signed in.
Viewing a Snippet
Opening a snippet shows its title, author, file name, visibility, and creation time, along with the description and the content. The content is rendered with syntax highlighting based on the file name's extension, and the line count is shown above it. If you don't have permission to view a snippet, GitBlixt reports that it can't be found.
Editing and Deleting
Only the author can edit or delete a snippet. On a snippet you own, use the Edit button to change any field, or Delete to remove it (you'll be asked to confirm). Deletion is immediate and permanent.