Skip to content
⚠️ This wiki is intended and relevant only for DTU Compute - Department of Applied Mathematics and Computer Science

GitLab

To use git for your own projects and team projects, DTU Compute provides a GitLab instance with all the benefits it offers. Primarily a place for your repositories, other features are available such as public runners and container registry.

Login with your DTU credentials here:

https://lab.compute.dtu.dk

There are two login tabs:

  • DTU Compute Login - For users with their primary affiliation at DTU Compute (employee or guest)
  • DTU Login - For users from other departments and general students

If you are blocked from accessing the GitLab instance, see here


Important

GitLab repositories have Git-LFS enabled by default, which ensures a more efficient handling of binary files, such as images, PDFs and compressed files. Without Git-LFS, storing these types of files with Git can make repositories unnecessarily large.

Unfortunately Git-LFS is not always installed by default, so please make sure that you have it installed on your system. Read more here.

Add your public keys

To access your private repositories, add your public SSH key to your GitLab account.
If you don’t have an SSH key, read about how to set it up here.

The file id_ed25519.pub (or id_rsa.pub if it is an older key) is your public key that you can share with other systems, including DTU Compute’s GitLab.

To add your public key to GitLab, follow these steps after login:

  1. In the top-right corner click your user icon
  2. Click Edit profile and on the left-hand panel click SSH Keys
  3. Follow the instructions from here

Git-LFS

To install Git-LFS refer to the documentation. On macOS (Homebrew) and Linux, install the git-lfs package.

Binary file types are tracked in the .gitattributes file. Add file types using the command:

git lfs track "*.pdf*"

or edit the file directly, for example:

*.pdf filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text

Remember to add, commit and push this file to your repository.

Give access to other users

To share a repository with other users, the user you want to add has to login to GitLab first. Then you can find and add them as a member of your project.

  1. Select the project you want to share
  2. In the left-hand panel select Manage -> Members
  3. Click the Invite members button and search for the username

Instructions for collaboration with a user from outside DTU

Users can get access to GitLab service at DTU Compute only if they have a DTU account. Therefore, if you’d try giving access to an external person through your GitLab project/group settings, it will not work.

  1. Create a guest account for the external person by logging in to guest.dtu.dk with your DTU credentials.
  2. After logging in, you should see the options as in the figure below. Choose Create user.

  1. You should see the form below appearing in the next screen. The username must consist of 8-9 characters (only letters and digits are allowed). It is important to enable access to DTU Wireless system for GitLab to be able to discover the new user.

  1. After clicking the Create user button, you should see the green success message and the information about the user appearing below the search box. You can edit, delete, and change the password for users. Note that guest users are not able to change credentials themselves and you must do it for them.

  2. After a certain amount of time (around 1-2 hours), notify the owners of the guest accounts that they should be able to sign in to GitLab with their new credentials at the GitLab log-in page, using the DTU Login tab. The credentials can be sent by email when changing the user’s password.

  3. You should now be able to share your group/project with your guest users by going to Manage -> Members and clicking the blue Invite members button. The search box will appear where you can search guest users by their usernames in the usual way.

Project Visibility & License

New repositories are by default set to be private which means that only you, and members that you allow, are able to see and work with the repository. This can be changed to either internal (lab.compute.dtu.dk members) or public (visible to the whole internet). To change the visibility of a repository:

  1. Select Settings -> General
  2. Expand Visibility, project features, permissions and change Project visibility

Important

Please be aware that public repositories can be found in the /public access directory (https://lab.compute.dtu.dk/public). If you have projects here that are not meant to be public, change the visibility of your repository!

If you do want your project to be public, we ask that you add a license. This can be done easily by clicking the Add license link beneath the project name in your project homepage.

Mirroring repositories

It may make sense to mirror a repository to/from an external source such as Github. For instructions read the official documentation

Shared Runners

Available for all projects are currently two GitLab Runners called “DTU Compute shared runner” 1 & 2, for various CI/CD tasks.

  1. Go to Settings -> CI/CD -> Runners
  2. In the Instance tab enable “Turn on instance runners for this project”

Blocked from login

If you can’t login to DTU Compute GitLab, the most common reason is attempting to use both login tabs, starting with the wrong one first. Please make sure to understand the difference between the two login tabs before entering your credentials. If you do end up being blocked, Contact IT Support.

Last updated on