← Back to Git Course | Chapter 1: Introduction & Setup | Lesson 2 of 7

Git History & Features

History of Git

Linus Torvalds wrote Git in 2005 after the Linux kernel team lost access to their previous proprietary tool, and he needed something fast, secure against tampering, and fully distributed from day one. The whole system is built primarily in C with supporting shell scripts, prioritizing raw speed over convenience features.

Example: History of Git

bash
git init

Speed and Performance

Because almost every Git operation -- viewing history, diffing files, creating a branch -- reads from your local disk instead of a remote server, there's no network round-trip slowing you down. That local-first design is what keeps large teams on platforms like cookiescursor.com productive even on a slow connection.

Example: Speed and Performance

bash
git log

Data Integrity with SHA-1

Every file, directory tree, and commit in Git is identified by a SHA-1 hash: a 40-character fingerprint computed from its exact contents. Change even one byte and the hash changes completely, which means Git can detect any silent corruption or tampering in your project's entire history.

Example: Data Integrity with SHA-1

bash
git hash-object file.txt

Lightweight Branching Model

A Git branch isn't a full copy of your project -- it's just a 41-byte file holding the hash of the commit it currently points to. That's why creating, switching, or merging dozens of branches costs almost nothing in time or disk space, unlike heavier version control systems.

Example: Lightweight Branching Model

bash
git branch feature-x
cat .git/refs/heads/feature-x

The Staging Area

The staging area (also called the index) sits between your working files and your permanent history, acting like a prep table where you choose exactly which changes go into the next commit. This lets you build one clean, focused commit even when you've been editing several unrelated things at once.

Example: The Staging Area

bash
git add file.txt
git status
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.