This is an old revision of the document!
Lorentz Institute runs a private instance of Gitlab accessible to all institute members at https://gitlab.lorentz.leidenuniv.nl regardless of their role within the Institute.
You are strongly encouraged to use it to collaborate with your colleagues and fellow scientists anywhere in the world. Accounts for external users can be requested via support@lorentz.institute.nl.
Lorentz Institute members must use the button Sign in with Lorentz Institute IdP to login via the institute Identity Provider Server, where as external users must use the Standard tab in the authentication form.
Because access to the Institute Gitlab instance occurs via Single-Sign On1) for all IL members, git push and pull operations must be performed either using SSH key-pairs (SSH protocol) or using Personal Access Tokens (HTTPS protocol). Failing to set up SSH key-pairs or Access Tokens will prevent IL members to interact via git with our Gitlab server.
In this case, the server will warn you with a message like the one in the figure below
ssh-keygen -t ed25519 -C "bongo@gitlab.lorentz.leidenuniv.nl"
The cmd above will generate the private/public keys $HOME/.ssh/id_ed25519
2) and $HOME/.ssh/id_ed25519.pub
respectively.
Visit https://gitlab.lorentz.leidenuniv.nl/-/profile/keys, copy the contents of the newly created $HOME/.ssh/id_ed25519.pub
and paste it as in the figure below and push Add key.
Git over SSH is now enabled for your IL account.
Visit https://gitlab.lorentz.leidenuniv.nl/-/profile/personal_access_tokens, choose a token name, assign the necessary scopes3), and click on Create Personal Access Token.
Your personal access token will look something like xyzop-ybVxByblaUBLA7RUAGAs
(this is a fake one). Please take note of it and store it in a very safe place. Disclosing this token is equivalent to disclosing your credentials! Should a token be compromised at any time, just visit https://gitlab.lorentz.leidenuniv.nl/-/profile/personal_access_tokens to revoke any compromised tokens.
Your IL account is now enabled to perform git operations over HTTPS.
In the examples that follow it is shown how you can synchronise for the first time your local git repo to Gitlab and viceversa. The examples below assume you are typing all commands in a BASH GNU/Linux terminal and that you are familiar with the basics of git by reading carefully the following documents
# create test repo mkdir test cd test/ git init . echo "Hello World" >> README.md git add * git commit . -m "Test" git push --set-upstream https://gitlab.lorentz.leidenuniv.nl/bongo1/test.git master Username for 'https://gitlab.lorentz.leidenuniv.nl': bongo1 Password for 'https://bongo1@gitlab.lorentz.leidenuniv.nl': <Personal Access Token> Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Writing objects: 100% (3/3), 231 bytes | 115.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 remote: remote: remote: The private project bongo1/test was successfully created. remote: remote: To configure the remote, run: remote: git remote add origin https://gitlab.strw.leidenuniv.nl/bongo1/test.git remote: remote: To view the project, visit: remote: https://gitlab.strw.leidenuniv.nl/bongo1/test remote: remote: remote: To https://gitlab.lorentz.leidenuniv.nl/bongo1/test.git * [new branch] master -> master branch 'master' set up to track 'https://gitlab.lorentz.leidenuniv.nl/bongo1/test.git/master'.
git clone https://gitlab.strw.leidenuniv.nl/bongo1/test.git Cloning into 'test'... Username for 'https://gitlab.strw.leidenuniv.nl': bongo1 Password for 'https://bongo1@gitlab.strw.leidenuniv.nl': <Personal Access Token> remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (3/3), done.