TDDE45 Software Design and Construction
Getting started with Git and GitLab
Introduction
An essential tool for the lab series is Git, a distributed version control system. It is assumed that you are familiar with Git and its terminology. In case you are not, we have collected a number of useful references that will easily get you started:
- Pro Git — A free book available on Git’s official website. Chapters 2.1–2.4 are highly recommended.
- Try Git — Got 15 minutes and want to learn Git? An interactive introduction to Git.
- Git Magic — Rough instructions for particular effects. Available in many languages.
- Git How To — A guided tour that walks through the fundamentals of Git, inspired by the premise that to know a thing is to do it.
- Git Cheatsheet — A handy reference for Git commands.
- Learn Version Control with Git — A step-by-step course for the complete beginner.
In this course, the management of Git repositories is done using a web-based platform called GitLab, which is deployed on one of LiU’s servers. Log in to LiU’s GitLab using your LiU ID.
Getting access to labs
We have chosen to make the gitlab repositories private in order since this makes forks private as well (so you don't accidentally share the repository).
From the 2027 course instance and onwards, you should be getting access to the TDDE45-student group automatically by virtue of having applied to- or registered for the course. Essentially, if you are getting course emails you should be fine. If you do not - feel free to request access to the group on the page above. Contact your lab assistant or the examiner if you do not get access to the labs after requesting it.
Checking your SSH keys
Please set up SSH keys in accordance with GitLab’s manual. Please refrain from using RSA keys (instead, use ed25519 until quantum-safe alternatives are available).
- The Gitlab help page "Use SSH keys with GitLab"
- There is also a GitLab video tutorial
What are SSH keys?
SSH keys are a way to identify trusted computers without involving passwords. The main advantage, except for not having to supply your password every time, is that your password is actually never sent over the network, and thus it is a bit safer.
Setting up your group
The goal is to create a single group that you invite your lab assistant to (who can see all your code and easily leave the group at the end of the course). The final structure should look something like:
Creating a group
Go to New group to create a Private group called TDDE45-2026-LIUID1-LIUID2 for your lab pair.
Set up permissions
Invite your lab partner (with the Owner role). Invite your lab assistant with at least the Developer role.
Forking lab repositories
Go to the lab assignment you want to work on (e.g. lab1.
There is a button called Fork; in the next screen choose the group to fork into. Do not create a new repository with the same files as the actual; use forking instead.
You will need a local copy to work on at some point, so we clone this from the repository. Here we've selecting 'Clone with SSH'.
git clone git@gitlab.liu.se:tdde45-2026-LIUID1-LIUID2/tdde45-lab1-using-design-patterns.git Cloning into 'tdde45-lab1-using-design-patterns'... remote: Enumerating objects: 148, done. remote: Counting objects: 100% (148/148), done. remote: Compressing objects: 100% (110/110), done. remote: Total 148 (delta 20), reused 148 (delta 20), pack-reused 0 (from 0) Receiving objects: 100% (148/148), 197.16 KiB | 3.72 MiB/s, done. Resolving deltas: 100% (20/20), done.
Note that you may get prompted about the password to unlock the SSH key, unless you've already done so and it has been loaded into an agent.
If you need to share a certain repository with other members of your 6-student team (as indicated by the lab instructions), you can invite them on a per-repository basis. You can create a Team for the other members to make it easier to invite them multiple times.
Recommended reading
For a more extensive introduction to branching and Git, please see
git-scm.com if you would like to dive deeper into how Git works and how to
work with it.
Page responsible: Adrian Pop
Last updated: 2026-10-13
