Snippets help you share code segments or files with yourself, your team, or the world. One more way we're making code collaboration better for professional software teams.
- Are built for team collaboration or individual sharing.
- Are syntax sensitive, making drag and drop quick and simple.
- Are built on Git or Mercurial so revisions are tracked and you can clone and push.
- Support multiple files, each snippet can have many files so you can share a single snippet without loosing context.
- Have amazing API support so you can build snippets into your app or process.
Snippets at a glance
Snippets are as simple as:
- Click Snippets > Create snippet.
- Paste some code or drag a file onto the page.
Select the owner of the snippet from Create in menu.
Set the permissions to either public or private.
Click Create snippet.
Permissions in snippets
Here's how permissions work for snippets:
|Snippet owner||Setting||Who can view||Who can edit|
|Team||Public||Anyone can view the snippet.||
Any member of the team can edit the snippet.
To allow a new person to contribute to snippets you can add them to your team.
|Private||Only team members can view the snippet.|
|Individual account||Public||Anyone can view the snippet.||Only the owner of an individual snippet can edit the snippet.|
|Private||Only you can view the snippet.|
Clone your snippet so you can work on it locally and push back up to Bitbucket Cloud. Cloning snippets works almost exactly the same as cloning a repository.
- Click Clone.
- Copy the command in the clone dialog.
Switch to the directory where you want to clone the snippet using the
cd(change directory) command as shown in the following example:
Paste the clone link into your terminal.
Start working on your snippet.
Was this helpful?
Thanks for your feedback!