If you have ever worked on a project and ended up with files named report_final.docx, report_final_v2.docx, and report_FINAL_use_this_one.docx, you have already felt the problem that Git was built to solve. Git is a tool that tracks every change you make to your files over time — who changed what, when, and why — so you never have to manage that mess by hand again.
The Problem Git Solves
Imagine you are working on a piece of software with three other people. You are all editing the same files. Without a system to coordinate those changes, chaos is almost inevitable: someone overwrites another person's work, a bug gets introduced and nobody remembers what changed, or a version that worked perfectly last week is gone because someone deleted it.
This is not a new problem. Developers have been wrestling with it since the earliest days of software. The solution is a category of tools called version control systems, and the idea is simple at its core: instead of saving just the current state of your files, you save the entire history of changes. You can go back to any point in time, see exactly what changed, and combine work from multiple people without losing anything.
Git is, by a wide margin, the most popular version control system in the world. According to the 2022 Stack Overflow Developer Survey, 96.65% of professional developers use it as their primary tool. Whether you are building a mobile app, contributing to an open-source project, or just writing scripts for your own use, Git is almost certainly the tool you will reach for.
A Brief History: How Git Was Born in Ten Days
Git was not the result of a long committee process. It was written in roughly ten days in April 2005 by Linus Torvalds — the same person who created the Linux operating system kernel — out of sheer necessity.
At the time, thousands of developers around the world were contributing to Linux using a proprietary tool called BitKeeper, which was provided free of charge to the open-source community under a restrictive license. When that arrangement broke down in early April 2005, the project was suddenly left without a version control system capable of handling its scale and its distributed, global contributor base.
Torvalds looked at the available alternatives, found none of them good enough, and started writing his own. The first Git commit was on April 7, 2005. By June 16 — just ten weeks later — Git was already managing the release of Linux kernel 2.6.12. Torvalds then handed the project to Junio C. Hamano, who has led it ever since. Version 1.0 shipped in December of that year.
The name, incidentally, is a bit of self-deprecating British slang. As Torvalds put it: "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'."
Two Ways to Think About Version Control
Before Git, most version control tools worked the same way: there was one central server that held the project's history, and developers would connect to it to save their work or retrieve someone else's. This is called a centralized model. It works, but it has a fragile quality — if the server goes down, nobody can commit anything. If the server is lost without a backup, the entire history disappears with it.
Git takes a different approach, called distributed version control. When you download a project with Git, you are not just getting the latest files — you are getting the entire history of the project on your own machine. Every contributor has a full copy. This means you can work, commit changes, look up old versions, and experiment entirely offline. The only time you need a network connection is when you want to share your work with others.
This also means there is no single point of failure. If the main server disappears, any clone of the repository can restore it completely.
How Git Remembers Your Work
Most version control systems save history as a sequence of changes — think of a list of "edit this line, add that line, delete this block." Git works differently. Every time you record a change — an operation called a commit — Git takes a snapshot of all your files at that exact moment, like a photograph of your entire project.
Under the hood, Git stores each snapshot efficiently: if a file has not changed since the last commit, Git does not copy it again — it simply keeps a reference to the previous version. This means snapshots do not waste space, and you can retrieve any version of your project instantly, without having to replay a long chain of patches.
What ties all these snapshots together is a chain of references, where each commit knows which commit came before it. This creates a browsable history that you can compare or travel through at any point. If you introduce a bug today, you can pinpoint the exact change that caused it. If you delete a file by mistake, you can recover it in seconds.
Git also protects this history with a cryptographic fingerprint. Every commit, every file, every change gets a unique identifier based on its exact contents. If anything in the history is tampered with, the fingerprints no longer match and Git immediately knows something is wrong. Your project's history, in other words, is essentially tamper-proof.
The Three Places Your Files Live
When you work with Git on your computer, your files are always in one of three places. Understanding this is probably the single most useful thing you can know as a beginner, because it makes almost every Git command click into place.
The files on your disk that you open and edit as normal. Git is watching these, but has not recorded any changes yet.
A preparation area where you decide exactly which changes to include in your next commit — even if you have other changes you are not ready to save yet.
The permanent record inside the hidden .git folder. Once something is committed here, it is part of your history and can always be recovered.
git add, and permanently record it with git commit.The staging area might feel like an unnecessary extra step when you first encounter it, but it is actually one of Git's most thoughtful features. Say you spent the afternoon fixing two unrelated issues. Without a staging area, you would have to commit both at once. With it, you can stage only the first fix, commit it with a clear message, and then stage and commit the second separately — leaving a history that is easy to read and understand later.
Branches: Trying Things Without Breaking Anything
One of the things that genuinely set Git apart from older tools was how it handles branches. A branch is simply a way of saying: "let me try this idea without touching the working version of the project." You create a branch, experiment freely, and if it works out, you merge it back into the main line. If it does not, you delete the branch and nothing is affected.
In older tools, creating a branch was expensive — the system had to copy entire directory trees on the server. In Git, a branch is essentially just a small label pointing to a commit, so creating one takes milliseconds and costs almost nothing. This seemingly minor difference changed how people work: instead of branches being rare, heavy operations reserved for major features, they became something you do casually, several times a day. The pull-request model that powers open-source collaboration on GitHub and GitLab is built entirely on this idea.
GitHub, GitLab, and Codeberg: Where Git Lives Online
Git itself is a command-line tool that runs on your own computer. The platforms below are websites built on top of Git that add collaboration features: code review, issue tracking, automated testing, team permissions, and more. Think of them as a friendlier layer built on top of the underlying tool.
GitHub
Cloud · MicrosoftLaunched in April 2008, acquired by Microsoft for $7.5 billion in 2018. The de facto home of open-source software, with more than 180 million developers as of 2025. If you are just getting started, this is likely where you will spend most of your time.
GitLab
Cloud + Self-hostedFounded in 2011, popular among companies that prefer to host their own infrastructure. Comes with built-in CI/CD pipelines and security tooling that teams would otherwise need to piece together from separate services.
Codeberg
Non-profit · Open SourceA community-driven platform run by a German non-profit association, built on the open-source Forgejo engine. It has no advertising, no tracking, and no venture capital behind it — just a straightforward, privacy-respecting home for open-source projects.
What About the Alternatives?
| Tool | Model | Where it stands today |
|---|---|---|
| Subversion (SVN) | Centralized | Still maintained, but a niche tool. Many teams that relied on it years ago have since migrated to Git. |
| Mercurial (hg) | Distributed | Born the same month as Git, in response to the same BitKeeper crisis. Once used by Mozilla, Python, and Facebook. Python moved to GitHub in 2017; Firefox completed its migration in May 2025. |
| Perforce (Helix Core) | Centralized | Proprietary and paid, but still widely used in game studios where projects contain massive binary asset files that Git handles less gracefully. |
| BitKeeper | Distributed | The tool whose licensing dispute triggered Git's creation. Open-sourced in 2016 — a decade too late to matter. |
Git won because it was free, fast, distributed, and designed from the start for a project bigger and more complex than almost anything else in existence. Then GitHub arrived and made the social side of coding feel accessible. The combination proved impossible to compete with.
Why Any of This Matters to You
The most lasting thing Git did was not technical. By making branches cheap and merging routine, it changed the culture of how software gets built. Experimenting became safe. Contributing to a project you do not own became straightforward. Reviewing someone else's work before it lands in the main codebase became a normal part of the workflow.
If you are new to Git, the commands can feel a little cryptic at first, but understanding the underlying idea makes everything fall into place much faster: Git is a very clever way of taking photographs of your work, keeping them safe, and letting multiple people contribute to the same project without stepping on each other's toes.
Twenty years after that first commit, that idea still holds up remarkably well.
Main References
-
Chacon, S., & Straub, B. Pro Git (2nd ed.). Apress / Git project.
https://git-scm.com/book/en/v2 -
Torvalds, L. (2005, April 6). Kernel SCM saga.. Linux Kernel Mailing List.
https://lkml.indiana.edu/hypermail/linux/kernel/0504.0/1540.html -
GitHub Engineering. (2025, April 7). Git turns 20: A Q&A with Linus Torvalds. The GitHub Blog.
https://github.blog/open-source/git/git-turns-20-a-qa-with-linus-torvalds/ -
Git Project. About Git — Data Assurance. git-scm.com.
https://git-scm.com/about/data-assurance -
GitLab. (2025). Journey through Git's 20-year history. GitLab Blog.
https://about.gitlab.com/blog/journey-through-gits-20-year-history/