The clone operation

There are two ways to get a repository on your computer. By creating a new one locally (also called initialisation of a repository). Or, alternatively, you can download an existing repository from a platform like GitLab, GitHub, or similar (this is called “cloning” a project). In our course we use our self-hosted GitLab instance, located at gitlab.ewi.tudelft.nl.

As this course will provide you with a template to start working from, we will explain the case where you download an existing project to your machine.

Always use TU Delft's Single Sign On (NetID login) to authenticate yourself to GitLab and do not change the username (your NetID) and/or your primary email address (your student email). Those are used to generate reports about your performance in our course.

There is also a GitLab instance located at gitlab.tudelft.nl. These instances are not linked in any way. You should only use the instance of our faculty.

Finding the URL of the project

To clone a project we need to have the URL of the repository. To get this we will first go to the project in the web interface of GitLab by clicking on Projects > Your projects in the top left corner in GitLab, now select your personal git assignment repository. The name of this repository contains your NetID in the name. Click on the blue “Clone” button in the top-right corner and copy the “Clone with SSH” URL (starts with git@…, not https://).

Cloning using the https URL is also possible, but this will trigger a prompt where you have to enter a username and password. This way of authentication is likely to be deprecated in the near future, less secure and is less convenient (you have to type your password). Therefore, we recommend you already get familiar with cloning over SSH.

Cloning a repository

Now that we have the URL we need to clone the repository on our machine. This can be done in the following way;

Navigate to the folder where you'd like to store the projects' files and run the following command;

git clone <URL>

You can paste a URL into the terminal using ⌘V (OSX), Ctrl+Insert (Windows) or Crtl+Shift+V (Linux).

Assignment


Clone your individual git repository to your local machine.

Common errors

Here you can find some of the most common errors that your peers have encountered in the past year(s).

You are prompted for git@gitlab.ewi.tudelft.nl's password

Something in your SSH key setup is not working as expected. Please check whether your SSH agent is running (you may need to restart it manually upon reboot of your device), and that your SSH key is loaded into the agent.

Do not enter any password. You don't have the correct password, and performing too many attempts here will get your IP banned from our GitLab server.