Short how-to explaining how to get git
working on Jupyter. This is focussed on accessing our Gitlab … but should work with others as well.
Open a terminal session from the main menu: File > New > Terminal
Add our Gitlab to the known hosts:
ssh-keyscan -t rsa gitlab.rlp.net >> ~/.ssh/known_hosts
Enter
ssh-keygen
.. then follow these questions:
3.1. Pick the location and base name of the key files. Normally you can leave as is.
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jovyan/.ssh/id_rsa):
... just hit Enter
3.2. Set a passphrase, can be empty
Enter passphrase (empty for no passphrase):
... enter passphrase or leave blank then hit Enter
Enter same passphrase again:
... enter same passphrase as above and hit Enter
3.3. Keys are being generated
Your identification has been saved ...
Success! ... this shows the generated credentials, etc.
cat /home/jovyan/.ssh/id_rsa.pub
The resulting text should start with ssh-rsa
and end with an email similar to jovyan@jupyter-florian
. Copy the text including start and end.
5.1. In the menu to the left click SSH Keys
6.1. You can safely rename the key at Title (where the fake email address now shows up). I usually pick something like KITeGG Jupyter Florian.
6.2. Click Add key button below to save your key.
Switch back to the Jupyter terminal session.
To have yourself show up as author of the commits you need to set the user and email in the git configuration.
8.1. Set the user (author) name:
git config --global user.name "Florian Jenett"
The name here can be anything. Gitlab will recognize you by your email in the next step.
8.2. Set the email. Make sure to use the one you are using on Gitlab to have the commits be linked to your account.
git config --global user.email "florian.jenett@hs-mainz.de"
9.1. Now you should be able to clone, pull, post to/from Gitlab.