What is Git and Why Does It Rule Everything

What is Git and Why Does It Rule Everything

Git started as Linus Torvalds' middle finger to proprietary version control after BitKeeper revoked the Linux kernel team's free license in 2005.

Linus built Git in two weeks because he was pissed off and needed something that wouldn't suck for managing thousands of kernel developers.

Git Distributed Version Control

The result changed software development forever. Git's distributed model means every developer has a complete copy of the project history.

No single point of failure, no waiting for a central server to respond, no wondering if your code survived the server crash.

Git's weird architecture choices actually make it blazingly fast. Everything is stored as content-addressed blobs using SHA-1 hashes (moving to SHA-256 in Git 3.0).

When you commit, Git doesn't store file differences

GitHub Logo

GitHub's 2018 acquisition for $7.5 billion proved Git's dominance.

Microsoft didn't just buy a code hosting service

GitLab Logo

The Git ecosystem is massive: GitHub hosts over 100 million repositories, GitLab serves enterprises, Bitbucket handles Atlassian integration, and SourceForge... exists.

Git powers everything from personal dotfiles to Microsoft's 300GB Windows repository with over 3 million files.

Git won because everything else either died (RIP SVN), costs a fortune (fucking Perforce), or has zero community (Mercurial).

It's not perfect

  • beginners spend months learning to unstage files and veterans still accidentally force-push to main. But Git works, scales, and every tool worth using integrates with it.

The latest Git 2.51 release (August 18, 2025) continues preparing for Git 3.0 with SHA-256 support, performance improvements, and the new reftable backend becoming default. These aren't flashy features, but they'll handle the next decade of exponential repository growth.

Git vs The Competition

Feature

Git

Subversion (SVN)

Mercurial

Perforce

Bazaar

Learning Curve

πŸ’€ Prepare to suffer for months

πŸ“š Pretty straightforward

πŸ“– Reasonable once you get it

πŸ’° Enterprise nightmare

⚰️ Dead simple

Performance

⚑ Blazing fast local operations

🐌 Network dependent

πŸƒ Fast enough

πŸ’Έ Fast if you pay enough

🐒 Slow as molasses

Market Share

πŸ‘‘ 93.87% developer adoption

πŸ“‰ Legacy systems only

πŸ¦• Facebook and... that's it

πŸ’Ό Gaming/enterprise only

πŸ’€ Effectively dead

Distributed

βœ… Full local history

❌ Central server required

βœ… Fully distributed

❌ Central server model

βœ… Distributed design

Branching

🌳 Cheap, fast branches

😱 Expensive copy operations

🌿 Good branching model

πŸ’° Costs extra

🌱 Branch-heavy workflow

Community

🌍 Massive ecosystem

πŸ‘΄ Aging community

🏝️ Small but dedicated

🏒 Corporate support only

πŸͺ¦ Ghost town

Hosting

🎯 GitHub, GitLab, everywhere

πŸ›οΈ Apache Foundation

πŸ¦‹ Bitbucket (deprecated)

🏦 Perforce Cloud $$$

πŸ•ΈοΈ Launchpad (cobwebs)

Windows Support

⚠️ Git Bash or WSL needed

βœ… Native TortoiseSVN

βœ… TortoiseHg available

βœ… Native Windows client

❓ Who cares anymore

File Size Limits

🚫 Large files need Git LFS

βœ… Handles large files well

⚠️ Struggles with binaries

πŸ’ͺ Designed for huge files

πŸ“ Small projects only

Cost

πŸ†“ Free and open source

πŸ†“ Free and open source

πŸ†“ Free and open source

πŸ’Έ $5-15+ per user/month

πŸ†“ Free but abandoned

Git's Architecture and Why It's Both Brilliant and Insane

Git Three Stage Architecture

Git's three-stage architecture confuses everyone initially. You have the working directory (your actual files), the staging area (what Git calls the \"index\"), and the repository (the committed history). Spent my first month asking "why do I have to git add files I already changed?" The staging area is pure sadism, but it enables surgical commits where you can stage specific hunks of changes.

Content-Addressed Storage

Git Object Storage

Everything in Git is identified by SHA-1 hashes (moving to SHA-256 in Git 3.0). Files become blobs, directories become trees, and commits are just objects pointing to other objects. This makes Git's storage incredibly efficient and enables features like automatic deduplication. If you have the same 1MB file in 100 commits, Git stores it once.

The hash-based system also makes Git cryptographically secure by design. You can't change history without changing hashes, which makes tampering detectable. CVE-2025-48384 affects Git on Linux/macOS when cloning malicious repositories with submodules, but the core design remains solid.

Distributed by Default

Unlike centralized systems like SVN, every Git clone is a complete repository. Your laptop has the same capabilities as GitHub's servers. This distributed model eliminates single points of failure and makes operations lightning fast since everything happens locally.

Git Branching Model

Git's branching model treats branches as lightweight pointers to commits, not heavyweight directory copies like SVN. Creating a branch is literally writing 40 bytes to a file. Switching branches updates your working directory to match the branch state, which is why Git yells at you about unmitted changes.

The Plumbing vs Porcelain Split

Git separates low-level \"plumbing\" commands (git cat-file, git write-tree) from high-level "porcelain" commands (git add, git commit). Most users never touch plumbing commands, but they're what power Git's internals. This layered architecture lets tools like GitHub Desktop build custom interfaces while leveraging Git's proven core.

Platform Gotchas That Will Ruin Your Day

Windows: Git Bash provides a Unix-like environment, but Windows' 260-character path limit breaks deep directory structures. Git LFS is mandatory for any binary files over 100MB. Line ending conversion (`core.autocrlf`) causes mysterious diff issues.

macOS: Case-insensitive filesystem by default means README.md and readme.md are the same file, breaking Linux-developed projects. Git's precomposed Unicode handling differs from HFS+, causing filename encoding issues.

Linux: Usually the smoothest experience since Git was born here. Watch out for filesystem permissions if you're sharing repositories between users or containers.

Performance at Scale

Git Performance Chart

Git handles Microsoft's Windows repository: 300GB with over 3 million files. They use custom tooling like VFS for Git (now Scalar) to make this workable, but stock Git chokes on repositories this size.

For normal projects, Git's performance is excellent. Local operations (diff, log, branch) are instant since they don't hit the network. Remote operations (fetch, push) depend on your connection and the remote server's capacity.

The Git 2.51 release includes reftable backend improvements that dramatically speed up repositories with thousands of branches and tags. These optimizations matter when you're dealing with CI/CD systems that create feature branches automatically.

Git FAQ: The Questions Everyone Asks

Q

How do I unfuck this mess I just made?

A

git reflog is your savior. It shows everything you've done, even after resets or rebases. Find the commit hash where things worked and git reset --hard <hash> to go back. Reflog saved my career at least a dozen times when I did something incredibly dumb.

Q

Why does Git have a staging area? It's confusing as hell.

A

Because Linus built it for kernel hackers who need surgical control over commits. The staging area lets you commit specific parts of files using git add -p. Yes, it's weird initially, but you'll eventually appreciate being able to stage clean commits from messy working directories.

Q

What's the difference between `git reset`, `git revert`, and `git checkout`?

A

git reset moves your branch pointer to a different commit. --soft keeps changes staged, --mixed (default) unstages them, --hard nukes everything.

git revert creates new commits that undo previous commits. Safe for shared branches since it doesn't rewrite history.

git checkout switches branches or updates working directory files. In modern Git, use git switch for branches and git restore for files.

Q

How do I fix "fatal: refusing to merge unrelated histories"?

A

Use git pull --allow-unrelated-histories when combining repositories that don't share common commits. This happens when initializing a repo locally and then connecting to a remote with existing commits.

Q

Why is my Git repository so fucking slow?

A

Large repositories suffer from several issues:

  • Too many loose objects: run git gc to pack them
  • Massive files tracked in history: use git filter-branch or BFG Repo-Cleaner to remove them
  • Deep directory structures on Windows: enable long path support or use WSL
  • Network latency: git config --global core.preloadindex true helps with large working trees
Q

Should I use `git merge` or `git rebase`?

A

Merge preserves the complete history and shows when features were integrated. Creates merge commits that some people find ugly but accurately represent development flow.

Rebase creates a linear history by replaying commits on top of the target branch. Cleaner history but rewrites commits, making it dangerous for shared branches.

Most teams use merge for feature branches and rebase for cleaning up personal work before pushing.

Q

What's the deal with Git LFS and why do I need it?

A

Git stores complete file histories, so a 100MB image file in 50 commits becomes 5GB of repository bloat. Git LFS (Large File Storage) replaces big files with pointers and stores the actual files on a separate server.

Enable LFS for any files over 100MB or binary files that change frequently: git lfs track "*.psd" then commit the .gitattributes file.

Q

Can I recover deleted commits?

A

Probably. Git keeps orphaned commits for 30 days by default. Use git fsck --lost-found to find dangling commits, then git show <hash> to inspect them. If you deleted a branch, check git reflog --all to find the last commit.

Q

Why does Git think my file changed when I didn't touch it?

A

Usually line ending issues. Windows uses CRLF (\r ) while Unix uses LF ( ). Configure core.autocrlf properly:

  • Windows: git config --global core.autocrlf true
  • macOS/Linux: git config --global core.autocrlf input

Or just use .gitattributes files to specify line ending handling per file type.

Q

How do I contribute to open source projects with Git?

A
  1. Fork the repository on GitHub/GitLab
  2. Clone your fork locally: git clone <your-fork-url>
  3. Add upstream remote: git remote add upstream <original-repo-url>
  4. Create feature branch: git checkout -b feature-name
  5. Make changes, commit, push to your fork
  6. Create pull request from your branch to upstream main

Keep your fork synced: git fetch upstream && git merge upstream/main

Q

What's this CVE-2025-48384 vulnerability I keep hearing about?

A

CVE-2025-48384 affects Git on Linux and macOS when cloning repositories with malicious submodules. The vulnerability allows arbitrary file writes during git clone --recursive.

Update Git immediately - versions before these are vulnerable:

  • Git 2.45.4 (released July 8, 2025)
  • Git 2.44.4
  • Git 2.43.7

Windows users aren't affected by this specific CVE.

Q

Why do people say Git has bad UX?

A

Because Linus built it for kernel hackers, not beginners. Commands have inconsistent interfaces, error messages are cryptic, and the mental model is alien if you're coming from centralized VCS.

But Git's power comes from exposing its internals. Once you understand that everything is commits, trees, and blobs identified by hashes, the commands make more sense. It just takes time to build that mental model.

Essential Git Resources

Related Tools & Recommendations

pricing
Similar content

Enterprise Git Hosting: GitHub, GitLab & Bitbucket Cost Analysis

When your boss ruins everything by asking for "enterprise features"

GitHub Enterprise
/pricing/github-enterprise-bitbucket-gitlab/enterprise-deployment-cost-analysis
100%
tool
Similar content

GitLab CI/CD Overview: Features, Setup, & Real-World Use

CI/CD, security scanning, and project management in one place - when it works, it's great

GitLab CI/CD
/tool/gitlab-ci-cd/overview
92%
pricing
Similar content

GitHub Enterprise vs GitLab Ultimate - Total Cost Analysis 2025

The 2025 pricing reality that changed everything - complete breakdown and real costs

GitHub Enterprise
/pricing/github-enterprise-vs-gitlab-cost-comparison/total-cost-analysis
68%
troubleshoot
Similar content

Fix Git 'Your Local Changes Would Be Overwritten' Error

The Git error that's fucked more developers than missing semicolons - 5 battle-tested solutions that actually work

Git
/troubleshoot/git-local-changes-overwritten/common-solutions
55%
howto
Similar content

How to Set Up SSH Keys for Git & GitHub: A Complete Guide

Tired of typing your GitHub password every fucking time you push code?

Git
/howto/setup-git-ssh-keys-github/complete-ssh-setup-guide
54%
tool
Similar content

Git Restore: Safely Undo Changes & Restore Files in Git

Stop using git checkout to restore files - git restore actually does what you expect

Git Restore
/tool/git-restore/overview
54%
tool
Similar content

Git Disaster Recovery & CVE-2025-48384 Security Alert Guide

Learn Git disaster recovery strategies and get immediate action steps for the critical CVE-2025-48384 security alert affecting Linux and macOS users.

Git
/tool/git/disaster-recovery-troubleshooting
51%
troubleshoot
Similar content

Fix Complex Git Merge Conflicts - Advanced Resolution Strategies

When multiple development teams collide and Git becomes a battlefield - systematic approaches that actually work under pressure

Git
/troubleshoot/git-local-changes-overwritten/complex-merge-conflict-resolution
49%
troubleshoot
Similar content

Fix Git 'Failed to Push Some Refs' Error: Ultimate Guide

The definitive fix guide for the error that's destroyed more deployments than any other Git message

Git
/troubleshoot/git-failed-push-some-refs/push-rejection-solutions
48%
howto
Similar content

Undo Git Commits: Keep Changes & Fix Mistakes Safely

Committed too early and now you're fucked? Here's how to unfuck yourself without losing two weeks of work

Git
/howto/undo-git-commit-keep-changes/complete-undo-guide
45%
howto
Similar content

Git: How to Merge Specific Files from Another Branch

November 15th, 2023, 11:47 PM: Production is fucked. You need the bug fix from the feature branch. You do NOT need the 47 experimental commits that Jim pushed a

Git
/howto/merge-git-branch-specific-files/selective-file-merge-guide
44%
howto
Similar content

Install GitHub CLI: A Step-by-Step Setup Guide

Tired of alt-tabbing between terminal and GitHub? Get gh working so you can stop clicking through web interfaces

GitHub CLI
/howto/github-cli-install/complete-setup-guide
44%
troubleshoot
Similar content

Git Fatal Not a Git Repository - Fix It in Under 5 Minutes

When Git decides to fuck your deployment at 2am

Git
/troubleshoot/git-fatal-not-a-git-repository/common-errors-solutions
40%
tool
Similar content

Open Policy Agent (OPA): Centralize Authorization & Policy Management

Stop hardcoding "if user.role == admin" across 47 microservices - ask OPA instead

/tool/open-policy-agent/overview
40%
tool
Similar content

ArgoCD - GitOps for Kubernetes That Actually Works

Continuous deployment tool that watches your Git repos and syncs changes to Kubernetes clusters, complete with a web UI you'll actually want to use

Argo CD
/tool/argocd/overview
38%
troubleshoot
Similar content

Fix Git Checkout Failures: Local Changes Overwritten Error

When Git checkout blocks your workflow because uncommitted changes are in the way - battle-tested solutions for urgent branch switching

Git
/troubleshoot/git-local-changes-overwritten/branch-switching-checkout-failures
38%
tool
Similar content

Flyway: Database Migrations Explained - Why & How It Works

Database migrations without the XML bullshit or vendor lock-in

Flyway
/tool/flyway/overview
38%
alternatives
Similar content

Git Hosting Alternatives: Cut Costs, Boost Efficiency

Facing high GitHub Enterprise costs? Explore effective Git hosting alternatives that save your budget. Learn what works, what doesn't, and how to manage migrati

GitHub
/alternatives/git-hosting-platforms/enterprise-alternatives
37%
howto
Similar content

Configure Multiple Git Accounts with SSH Keys

Git asking for passwords every goddamn time? Personal furry fanfiction commits accidentally pushed to your company repo?

Git
/howto/configure-git-multiple-accounts/ssh-based-configuration
35%
troubleshoot
Similar content

Git Fatal Not a Git Repository: Enterprise Security Solutions

When Git Security Updates Cripple Enterprise Development Workflows

Git
/troubleshoot/git-fatal-not-a-git-repository/enterprise-security-scenarios
35%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization