Install & Configure Git

When Git is not installed on your system yet then you can follow the steps from Git’s website to install it. For later parts of this course, we recommend you use linux.

You can check whether Git is installed by running the following command on your terminal:

git --version

This should print something like

git version 2.37.2

There are multiple ways to use Git. For instance, you can use your terminal (entering raw commands), you can use a GUI (in case you prefer pushing buttons instead of typing commands) or your editor (e.g., IntelliJ, Eclipse, etc.) may include Git support.

In this manual we will focus on interacting with git through the terminal. We will always mention the equivalent terminal commands in case you prefer to work with the terminal. The most important thing is to get familiar with the terms, and how to perform the basic operations in Git.

We strongly discourage you to use SourceTree, a git GUI. This GUI doesn't handle authentication errors properly, and will just try again and again until your IP gets banned.

Configuring Git on your system

Submitting your code on GitLab has been restricted to only accept code that is authored by students. The platform will automatically check whether the email address ends with @student.tudelft.nl.

Therefore, you need to instruct Git what name and email address to associate with your work. You can configure this on a global and a per project level.

Run the following commands to set your git email address globally. It's safest to set it globally, but especially if you already use a personal email address for other git repositories, you can simply remove the --global from the commands below, and running the command inside the repository you want to change the settings for.

git config --global user.name "Your full name"
git config --global user.email "Your student email"
# This one is just very convenient
git config --global push.autoSetupRemote true

To check whether the commands were successful, you can run;

git config --global user.name
git config --global user.email

This should output whatever you configured using the commands above. Make sure that the configured email address ends with @student.tudelft.nl!

You should now have everything set to get started with git. We will walk you through the entire flow, an overview is given below (highlighted are the Git terms you should know);