← Previous: Pydantic | Next: Linting →
If you are new to git we do not expect you to master Git's commands and workflow right away. You are going to practice in class with git and during the course you will be using git frequently. So we will be there to help and guide you in working with git proficiently.
To below material is for you to gain a basic understanding of how git works and how to use it. You do not have to be able to apply this right away, but we recommend that you watch the videos and read the material to get a feel for git and it's basic commands.
Git is a very powerfull and relatively simple tool, but it can also get very messy if you do not understand what is going on. Understanding how git is structured and how it works "under the hood" makes it easier to use git and will help you avoid problems.
We would like to ask you to watch the following video. It is a bit long, but it's an accessible presentation on what git is actually doing. Trust us, watching this video will be an investment worth it, not only for the course, but also for your professional work! It also covers some of the basic commands. In the below section we will dive a little deeper in these commands.
Git has some basic commands, some of wich were covered in the video. Using git through the command line is the most basic way to use git. For a more in depth coverage of git's commands, we recommend that you watch the following tutorial:
NOTE: in the tutorial below the examples use GitHub. We will be using gitlab. The commands are the same, but the url's are different. You are free to experiment with the commands covered in the turorial, but we will also practice these in class.
Instead of the command line u can also use the GUI in VSCode to to work with Git. The GUI in VSCode has some advantages over using the command line, especially if you are if you use add ons like GitLens or GitGraph.
Every action you can perform in the GUI of VS Code , is essentially one or more git commands. So we recommend that you first learn how to use git through the command line, and then gradually start using the GUI's of VSCode and it's add ons. Ensuring that you inderstand wich actions in the git workflow you are performing when you press a button in the GUI.
For an overview of the Git GUI in VS Code, check out this tutortial.
For more advanced use you van check out the tutorials on GitLens and GitGraph.
- Learn more about trunk based git
From the tutorials above, you got a taste of how a git workflow looks like. There are many different ways to work with git. In large development teams, GitFlow is widely used. But for smaller teams and projects, Scaled Trunk Based Git (also called Feature Branch Workflow) is a more lightweight alternative. We will be using this workflow in class and will teach and support you to use this workflow in your projects. To learn what the Scaled Trunk Based Git Workflow is, continue with this tutorial.
If you are interested in learning more about the more complex GitFlow, you can check out this very short video on its structure. For a simple and accessible comparison of different implementations of GitFlow, check out this short video.