In the spring of 2005, the Linux kernel community lost BitKeeper — and in just a few weeks, something appeared that changed the habits of programmers around the world. Let's analyze why Git won, how it works inside, and what beginners can take from it.
TL;DR: Git is snapshots, a graph (DAG), and cheap branches. As a result, you get speed, reliability, and freedom to work offline.
Before Git: centralized version control and its limitations 🧯
CVS/SVN relied on a single central server: no network, no commits.
Branches were "expensive", mergers were painful; teams often dragged on with experiments.
The "diff to all files" mindset instead of "project state snapshot" complicated the story.
For the Linux kernel with thousands of patches per month, this became a bottleneck.
Why Git appeared and what it was supposed to be ⚙️
📦 Distribution: a full copy of the history for everyone; commits and branches offline.
⚡ Speed: instant local operations on huge stories.
🧪 Reliability: cryptographic integrity of history through hashes.
🌿 Cheap branches: creation, switching, merging — a routine, not an event.
Key ideas of Git that changed everything 💡
Snapshots instead of diffs: a commit is a snapshot of the project state, not a set of patches.
Merkel's tree: objects (
blob,tree,commit,tag) are linked by hashes — the story is complete.Branches - pointers: these are just links to commits; operations are instantaneous.
DAG history: mergers are a normal cheap operation, not "heroism".
Local work: commits, logs, comparisons — without network; synchronization —
push/pull.
# Mental picture
(main)─A─B─C
╲
(feature) D─E ← ветка — это указатель; merge/rebase двигают ссылкиUnder the hood: the Git object model 🧬
Object | What it stores | Why |
|---|---|---|
| File content | Content targeting and deduplication |
| Links to files and folders | Directory structure at the time of commit |
| Link to | Snapshot + place in history |
| Signed link to the object | Releases and milestones |
Historically, it was SHA-1; modern builds can handle SHA-256. In any case, the hash "glues" the story together.
Mini workshop for 30 minutes 🛠️
Create a repository:
git init, add two files, make 2–3 small commits.Branch:
git switch -c feature, change the file, commit.Pour into
main:git switch main && git merge feature.See the story:
git log --graph --oneline --decorate.Play detective:
git bisecton an artificial bug.Edit the story locally:
git rebase -i HEAD~3(squash/rename). Don't push without agreement!
# Prompt by commands
git init
git add .
git commit -m "init"
git switch -c feature
# ... edits ...
git commit -m "feature: add X"
git switch main
git merge feature
git log --graph --oneline --decorateTypical beginner mistakes and quick solutions 🧭
🔗 Detached HEAD — Always create a branch before the experiment:
git switch -c exp.♻️ Rebase vs merge — rebase rewrites the history; in general, use merge more often in repo.
📦 Large files — store artifacts via Git LFS or external stores.
↩️ Kickbacks —
git revert(new commit) is safer thanreset --hard.
In Codice we make programming training fun and easy to understand: we have interesting courses with tasks that help you improve your skills step by step.
And we also have an active Telegram channel, where we discuss cool ideas, share experiences and analyze tasks together — learning becomes not only useful, but also fun.
Results: what the Git history teaches 🧰
Git was born out of the real pain of large-scale Linux kernel development, so it's good at branches and merges.
Snapshots + DAG remove the "magic" veil: start thinking in stories, not in diff batches.
Make short branches and frequent commits — Git reveals itself in this process.
What was your first "rake" in Git — detached HEAD, rebase conflicts or a "missing" commit?
