Question
My end goal is to have an offline, updateable copy of my snippets (including title & description) such that I can search and use them easily. How can I get all my snippets from Gitlab to my local machine?
I'm using Gitlab version is 13.12.10-ee
.
What I've looked into
Cloning snippets
It's possible to clone snippet contents in Gitlab, but this only includes the file associated with the snippet. The title and description are excluded.
E.g. when I do git clone git@company.gitlab.com:snippets/$snippet_id.git
I only receive the files associated with the snippet, not the title and the description:
I've checked the documentation but could not find any mention of interacting with the description through git.
Gitlab API
I found that the Gitlab API has a snippets endpoint. However, when I use the python-gitlab CLI tool and request a single snippet with gitlab snippet get --id 123
I only get the ID and the title.
When I do gitlab snippet content --id 123
I only get the contents of the file associated with the snippet.