Quick tutorial for Git/Github
If you only plan to clone public repositories, you can probably just use git clone https://
or simply download and unzip the repository of interest.
However, you will need to connect your command line to your Github account in the following scenarios:
to clone private repositories that you own or one which you have been added as a collaborator.
to perform any write operation in the repository (e.g. push, pull, merge, branch, etc.)
Using Github with the cluster (e.g. on the cluster)
The cluster already has git installed. However, you may still want to link it to your Github account to do the operations mentionned above.
In this case, performn the following steps, which constitute a simplified version of the information provided by Github.
If you don’t have Github already, create an account.
Open a terminal on the cluster (either within Jupyter lab after connecting through SSH).
In the command line of your , type
ssh-keygen -t ed25519 -C "your_email@example.com"
and indicate a passphrase (optional, you can skip it ). This will create a new SSH key. Replaceyour_email@example.com
by the email address you’ve used when creating your github account (it should work with other valid addresses too).Still in the command line, type
cat ~/.ssh/id_ed25519.pub
(id_ed25519 is a default name: if you specified a name for your key, adjust accordingly) and copy paste what comes out.Finally, login into your Github account, go to the following address
https://github.com/settings/profile
and paste what you got from previous step (it should start with ‘ssh-rsa’ and finish with the email address you’ve provided at step 2).To connect Github to your command line, just type
ssh -T git@github.com
. You’ll be asked the passphrase of your SSH key (if you defined one at step 2). In principle, you will only have to do this once. If git commands start to complain that private repositories “do not exist”, you might have to redo this last operation.
Leave a message
Feel free to comment, make a question, report a bug, etc. If you want to notify a specific user (e.g. to get a faster response), you may include their Github handle in your message (e.g. @romainligneul or @samuelgarcia).