Git is an essential tool in a developer's toolbox, widely regarded as the most popular version control system. Understanding how to use Git effectively is crucial for tracking changes in files, improving productivity, and collaborating efficiently with others.
In this workshop, we will cover Git in the command line, going through the basic mechanisms of versioning files. We will look at the most important commands, as well as useful tips for getting out of trouble when things go wrong. We will use Github.com to work with a repository outside of our local machine, where we will also explore the use of Pull Requests. To merge changes and resolve conflicts, we will use Visual Studio Code.
Ensure that Git is installed on your machine and accessible from the command line/terminal.
If you already have Git installed, you can skip this step. On Windows, check if you have git bash
installed. If you are on macOS or Linux, you can check if Git is available by typing git version
.
If Git is not installed, you can find instructions for installing it on all operating systems here: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
You are free to use the code editor of your choice, but we highly recommend Visual Studio Code.
- Even though you have this file (
README.md
) on your local machine if you have cloned the repository, it is easier to read on GitHub due to formatting. We therefore recommend using a browser to read the exercises. - Start with Exercise 1, and feel free to ask if anything is unclear or if there is something you would like to discuss.
❗ We will not use the GUI client in this workshop. Instead, we will use the terminal/command line (CLI). It is a good idea to avoid copy-pasting commands to get used to typing Git commands, even though it may feel inconvenient at first. Once you get the hang of it, using the CLI tool becomes an efficient way to work.
This repository contains a set of exercises organized in folders. Each folder contains a README.md
describing the exercise:
✏️ - A task you should do
📖 - A section of text to read (no tasks, just information).
💡 - Additional information.
❗ - Something important.
❓ - Open-ended question for the reader ("What do you think would happen if...")
💩 - Bad practice (don't-do-this)
⭐ - A bonus task (not required)
Will look like this:
CTRL + ALT + C
Emphasizes how lines of text should change.
- this text was removed
+ and replaced with this text