Git & GitHub ยท Chapter 1 of 42

Introduction to Version Control

Version control is a system that records changes to files over time so you can recall specific versions later. It lets teams of developers work on the same codebase without overwriting each other's work, and it keeps a full history of every change ever made.

Git is the most popular version control system in the world. Unlike older centralized systems, Git is distributed, meaning every developer has a full copy of the project history on their own machine, which makes it fast and resilient.

Why use version control?

Version control lets you track changes, undo mistakes, collaborate with others without conflicts, and understand who changed what and why. It is essential for any serious software project, from solo scripts to huge teams.

Centralized vs distributed

Centralized systems like old-style SVN store history on one server. Distributed systems like Git give every clone a full history, so you can work offline and still commit changes.

Example 1 (bash)
git --version
Output
git version 2.43.0

Checks that Git is installed and shows the installed version.

Example 2 (bash)
git help
Output
usage: git [--version] [--help] ...

Shows a list of common Git commands and how to get more help.

Key points

  • Version control tracks changes to files over time.
  • Git is a distributed version control system.
  • Every developer has a full copy of project history locally.
  • GitHub is a popular hosting service built around Git.
๐Ÿ’ก Note: Git and GitHub are not the same thing โ€” Git is the tool, GitHub is a website that hosts Git repositories.

๐Ÿ“ Quick Quiz

1. What is version control used for?

2. Git is best described as a:

3. What is the relationship between Git and GitHub?