← Back to list

Git: Origins

Git Fundamentals: Understanding Version Control from First Principles

Mohammed Faham · 2026-06-20 09:42 · 0 claps · 4.2 min read
#git #version-control #github #git-basics #intro-to-git
Open on Medium ↗
Wiki topics: 🔓 · Open Source

Git: Origins

Git Fundamentals: Understanding Version Control from First Principles

At its core, Git is a distributed version control system. Imagine a highly intelligent, time-traveling filing cabinet for your code. When you are building software — whether it is a simple script or a complex full-stack application — your codebase is constantly evolving. You add features, break things, experiment, and collaborate with others.

Git tracks every single modification made to a project over time. It allows you to save snapshots of your work, revert to previous states if something breaks, and seamlessly merge your code with teammates’ work without overwriting each other. It is the invisible backbone of modern software engineering; mastering it is the difference between coding in constant fear of losing your work and coding with absolute confidence.

Imagine you are writing a complex essay. You write a rough draft, save it as essay_v1.docx. You make changes, save it as essay_v2_final.docx. Then your reviewer asks for edits, so you save essay_v2_final_REALLY_FINAL.docx. Very quickly, your folder is a chaotic mess, and if you realize a paragraph from v1 was actually better, good luck finding it without reading through every file.

Git solves this. It is a piece of software that runs on your computer and acts as a silent observer of your project folder. Instead of saving hundreds of files with different names, you only keep one working copy of your files. When you reach a milestone, you tell Git to take a “snapshot” of the entire project. Git labels this snapshot with a unique ID and a message. If you ever need to go back in time to see exactly what the project looked like on Tuesday at 3:00 PM, Git instantly swaps out your current files for the files from that snapshot.

Formal Explanation & Mechanics

Formally, Git is a Distributed Version Control System (DVCS). To understand its mechanics, we must look at two architectural choices that define it.

A. Distributed vs. Centralized: Older systems like Subversion (SVN) were Centralized Version Control Systems (CVCS). They relied on a single central server that stored all the history. If you wanted to see the history or save a version, you had to be connected to the internet to talk to that server. If the server crashed, nobody could work.

Git is Distributed. When you download a Git repository, you don’t just download the latest files; you download the entire history of the project directly to your local hard drive. Every collaborator’s computer has a full, independent backup of the database. You can work, save versions, and explore history entirely offline. You only need the internet when you want to sync your local database with someone else’s.

B. Snapshots, Not Differences (Deltas): This is the most critical mechanical concept of Git. Most other version control systems store information as a list of file-based changes (deltas). They think: “File A started like this. On Tuesday, line 5 changed. On Wednesday, line 10 changed.”

Git does not do this. Git thinks about its data more like a stream of miniature filesystems. Every time you save a version (a “commit”), Git takes a picture of what all your files look like at that exact moment and stores a reference to that snapshot. For efficiency, if a file has not changed, Git doesn’t store the file again — it just links to the previous identical file it has already stored. This “Snapshot over Deltas” architecture makes Git incredibly fast at branching and switching contexts.

Concrete Examples & Implementation

To use Git, we must first install it and configure your identity. Git stamps every snapshot you take with your name and email so collaborators know who made what changes.

Installation:

  • Windows: Download the installer from [git-scm.com](https://git-scm.com/) (this installs Git Bash, an excellent terminal).
  • macOS: Open a terminal and run git --version. If it’s not installed, it will prompt you to install Apple's Command Line Tools.
  • Linux (Ubuntu/Debian): sudo apt install git

Global Configuration: Once installed, open your terminal. Let’s configure our global settings. The --global flag tells Git to use these credentials for every project on your computer.

# 1. Set your name
git config --global user.name "The Boogieman"

# 2. Set your email
git config --global user.email "boogiemen@example.com"

# 3. Set the default branch name to 'main' (modern standard)
git config --global init.defaultBranch main

# 4. Verify your configuration
git config --list

NOTE: Where are these settings actually saved? Git simply creates a hidden plain-text file in your operating system’s home directory called .gitconfig. When you run those commands, Git is just writing text into that file.

Common Misconceptions

Misconception: Git and GitHub are the same thing.

  • Git is the actual software engine running locally on your computer that tracks history. It is a command-line tool. You do not need the internet or an account to use Git.
  • GitHub (like GitLab or Bitbucket) is a for-profit company that hosts Git repositories in the cloud. It provides a web interface to view the Git databases you upload to them.
  • Analogy: Git is to GitHub what video editing software is to YouTube.

Sources & Recommended Resources

  • Source: Chacon, S., & Straub, B. (2014). Pro Git (2nd ed.). Apress. (Specifically Chapter 1: Getting Started). Read it free online at: git-scm.com/book
  • Resource: YouTube — The Missing Semester of Your CS Education (MIT). Lecture 6: Version Control. (Highly recommended for understanding the underlying data model early on).

What’s Next?

We have established what Git is and configured it.

Next up: We will dive into The Local Workflow (The Three Trees), where we will actually create a repository and learn how Git moves files through three distinct stages to create history (init, add, commit, status).

Until then take care and stay tuned!


메타데이터
post_id
9a0a75aafdce
slug
git-origins-9a0a75aafdce
url
https://medium.com/@mohdfahamb/git-origins-9a0a75aafdce
canonical_url
https://medium.com/@mohdfahamb/git-origins-9a0a75aafdce
author_url
https://medium.com/@mohdfahamb
status
ok
fetched_at
2026-06-23 03:48:11