The Linux kernel development team just had a massive falling out with BitKeeper, their proprietary version control provider. Most people expected them to switch to Subversion (SVN) or maybe Mercurial. Instead, Linus Torvalds spent a week in a room and came out with "Git"—which he jokingly calls the "Stupid Content Tracker."
Having spent a few days playing with it, I can tell you: it’s not stupid. It’s a work of genius that completely rethinks what version control should be.
SVN and CVS are "Centralized." There is one server that holds the history, and you "check out" a single version. If the server is down, or you’re on a plane, you can't commit, you can't see the history, and you can't branch.
Git is "Distributed." When you clone a repository, you get the entire history of the project. Every commit, every branch, every tag—all of it is on your local disk. This makes operations like log or diff nearly instantaneous because they don't need a network connection.
But the real magic of Git is how it handles branching. In SVN, a branch is a full copy of the directory. It’s heavy and slow. In Git, a branch is just a 40-byte file containing the SHA-1 hash of a commit. Branching and merging are so fast and easy that you’re encouraged to create a new branch for every single feature or bug fix.
The data model is also incredibly robust. Git doesn't track "changes to files." It tracks "snapshots of the directory." Every object in Git is addressable by its cryptographic hash. This means the history is immutable and verifiable. If a single bit in a file changes, the hash changes, and the whole chain is broken.
The learning curve is... steep. The command-line interface is inconsistent, and if you accidentally "detach your HEAD," you’re going to have a bad time. But once you understand the underlying graph of commits, you’ll never want to touch SVN again.
# The magic of git
git checkout -b feature/new-idea
# ... hack hack hack ...
git commit -am "My new idea"
git checkout master
git merge feature/new-idea
Git is the version control system we didn't know we needed, but now can't live without.