Here are instructions on how to set up SSH, Git and GitLab. This is something you should only have to do once – after that you will be able to work smoothly with your laborations.
This guide requires you do to some nasty things in the terminal. Here’s how open it:
You will use Git to synchronise your local work with the lab project on Chalmers GitLab. For this, you need an SSH key.
Start the terminal.
ssh-keygen
in the terminal, leaving all input prompts empty (including empty password).
It should print the path to your public key. Look for something like:
Your public key has been saved in C:\Users\<username>\.ssh\id_<something>.pub
(on Mac/Linux it should be /<...>/.ssh/id_<something>.pub
instead).
.ssh
directory:
cd $home\.ssh
cd ~/.ssh
cd; cd .ssh
cat id_<something>.pub
.
It should print something like this (the initial part may differ depending on settings):
ssh-ed25519 ...long-string-of-numbers-and-characters... user@computer
Copy the whole line above and add it as a key on Chalmers GitLab:
Paste the contents of the file you copied before into the key textbox, and give your key a name:
You don’t need to change anything else:
ssh -T git@git.chalmers.se
.
You may be prompted to confirm the authenticity of the host (just answer “yes”).
The command should then print a welcome sentence:
Welcome to GitLab, @<username>!
Here are more detailed/advanced instructions. If you have any problems, ask a teaching assistant in the discussion channels or during lab supervision.
Git is the industry standard for version control and collaborative software development.
First you can check if you already have it installed:
Run git --version
, if it doesn’t print an error you have it.
Otherwise there are instructions for how to install it on your computer.
It will pay off to become familiar with it! The student union also has a good introduction to Git.
Don’t forget to set up your name and chalmers/GU email in Git on your computer:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Note: If you use the Chalmers lab computers, you may experience a problem with git cloning. This is due to the following:
ssh-keygen
puts the key in your user folder on the C drive (in C:\...\.ssh\
).git
looks for your key in your Z drive (in Z:\.ssh\
).To solve this, just copy over the whole .ssh
directory from your user folder on the C drive to the Z drive.