Skip to content

Tutorial Objectives

Topics 💡

Please try to reserve 3-4h of your time for this tutorial. If you plan on rushing through this tutorial, you will only get frustrated. We know that 3-4h seem like a lot of time, but after this tutorial you will be prepared for working collaboratively with Git and GitLabTM, which is exactly what the DataHub is built for. This tutorial is created in a praxis-oriented manner and under every section you'll find tasks which are nice for getting some practice. Because: You can only learn Git and GitLabTM by actually doing it!!

This tutorial teaches to work with Git through the command line. This has the purpose to make you understand what's really going on when you communicate with Git. However, you are welcome to use one of the many Graphical User Interfaces (Git GUIs) for Git which are more user friendly than working with the command line. A good start, for example, is to use VSCode as your code editor, as it comes with a Git integration and multiple extension packs for Git as well as for GitLabTM.

Please be reminded that for going through this tutorial you need to have gone through the Installation and Setup part.

Version Control and Git: Background and Theory

Objectives📍

  • What Version Control is and where it comes from
  • Why it is useful
  • The basic principles of Git:
    • the Git database
    • structure of the Git repository
    • the staging area
    • commits

Basic Git Workflow

Objectives📍

  • init
  • add
  • commit
  • status
  • diff
  • log

Branching and merging

Objectives📍

  • branch
  • checkout
  • merge
  • HEAD and detached HEAD
  • moving in your commit history
  • how to solve a merge conflict

GitLabTM workflow

Objectives📍

  • What is GitLab
  • local vs. remote repository
  • push
  • pull
  • clone
  • fetch
  • merge
  • merge conflict between your local and remote repository

Contributing on GitLabTM

Objectives📍

  • fork
  • merge requests
  • GitLabTM for project management
  • Git LFS

optional/reading/further materials