Skip to content

Git has won the source control battle for now, and it is a vital tool to learn for any developer today. Learn the basic commands and workflow in this lesson.

Notifications You must be signed in to change notification settings

nerdschoolbergen/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Version Control with Git

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.

Open presentation slides

Prerequisites

Git

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

Editor

You are free to use the code editor of your choice, but we highly recommend Visual Studio Code.

How to get started

  • 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.

Exercises

This repository contains a set of exercises organized in folders. Each folder contains a README.md describing the exercise:

Symbols and notation used in the exercises

Icons with special meaning

✏️ - 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)

Keyboard keys

Will look like this:

CTRL + ALT + C

Diff blocks

Emphasizes how lines of text should change.

- this text was removed
+ and replaced with this text

About

Git has won the source control battle for now, and it is a vital tool to learn for any developer today. Learn the basic commands and workflow in this lesson.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5