What is Git and Why Version Control
Version control is a system that records changes to files over time so you can recall specific versions later. Git is the most widely used version control system in the world.
The Problem Git Solves
Have you ever:
- Lost work because you overwrote a file?
- Created files named
project_final.doc,project_final_v2.doc,project_REALLY_final.doc? - Wondered what changed between yesterday and today?
- Tried to collaborate with others and accidentally overwrote their work?
Git solves all these problems and more.
What is Version Control?
Version control (also called source control) is a system that tracks changes to files over time. Think of it as an "infinite undo" for your entire project.
Key Benefits
| Benefit | Description |
|---|---|
| History | See exactly what changed, when, and by whom |
| Backup | Your work is safely stored with full history |
| Collaboration | Multiple people can work on the same files |
| Branching | Work on features without affecting the main code |
| Reversibility | Easily undo mistakes and restore previous versions |
What is Git?
Git is a distributed version control system (DVCS) created by Linus Torvalds in 2005 (the same person who created Linux).
Distributed vs Centralized
Centralized VCS: Distributed VCS (Git):
[Server] [Server]
| |
---|--- ---|---
| | | | | |
[A] [B] [C] [A] [B] [C]
Full Full Full
Copy Copy Copy
In Git, every developer has a complete copy of the repository, including its full history. This means you can work offline, and there's no single point of failure.
Why Git is Popular
- Speed: Git operations are extremely fast
- Branching: Creating and merging branches is cheap and easy
- Distributed: Every clone is a full backup
- Data Integrity: Git uses SHA-1 hashes to ensure data integrity
- Industry Standard: Used by almost every tech company
Git vs GitHub
It's important to understand the difference:
| Git | GitHub |
|---|---|
| Version control software | Web-based hosting service |
| Runs locally on your computer | Cloud-based platform |
| Command-line tool | Web interface + additional features |
| Free and open source | Free tier + paid plans |
Git is the tool. GitHub is a service that hosts Git repositories and adds collaboration features.
Try the Git Terminal
Practice Git commands in this interactive terminal:
Core Concepts Overview
Repository
A Git repository (or "repo") is a directory that Git is tracking. It contains all your project files plus a hidden .git folder that stores the version history.
Commit
A commit is a snapshot of your project at a point in time. Each commit has:
- A unique identifier (SHA hash)
- A message describing the change
- Author information
- A timestamp
- A pointer to the previous commit
Branch
A branch is an independent line of development. The default branch is typically called main (or master in older projects).
Exercise: Your First Git Commands
Try running these commands to explore the Git environment:
Summary
- Version control tracks changes to files over time
- Git is a distributed version control system
- GitHub is a hosting service for Git repositories
- Git provides history, backup, collaboration, and branching capabilities
- Every Git clone is a complete copy of the repository
In the next lesson, we'll install Git and configure it for your system.

