Using GitLab in Deepnote
GitLab users could be initially sad only seeing the Octocat icon in the sidebar menu of Deepnote. While the integration of Deepnote with GitLab is slightly more manual than the GitHub integration, it is still possible. This article gives a step by step guide on how to achieve that.
1. Generate SSH key pair
This can be done either directly in Deepnote or somewhere else and then uploaded to Deepnote. The SSH key should be stored somewhere in
~/work to ensure it does not get deleted after HW reboot. We will store it in
2. Create Deploy Key in GitLab
Get the contents of the public key
Take the output of the above cell and create a new Deploy Key at https://gitlab.com/YOUR_ORG/YOUR_REPO/-/settings/repository. Depending whether you only want to
pull the code in Deepnote or also have the possibility to
push new code, check the
Grant write permissions to this key.
3. Set the
GIT_SSH_COMMAND environment variable
GIT_SSH_COMMAND environment variable to
ssh -i ~/work/git-ssh-key using the Environment Variables integration.
4. 🎉 You are all set!
With the above setup done, you can head to the Terminal and clone your project (or do it directly from the notebook if you feel like it :))
After the initial clone you can happily
pull in the Terminal.
Make sure you only share the project with people that should have access to the repository, as the above described approach keeps the private key accessible to everybody with Read access to the project.
In case this is a problem for you, please reach out to us at
firstname.lastname@example.org or directly to me and we can try help you set up with slightly more complicated setup when the private key is stored in Environment Variable Integration