Skip to content

Git

Git is a distributed version control system created by Linus Torvalds in 2005 that stores content as an immutable DAG of snapshots, enabling branching, merging and offline work at planetary scale.

Definition

What it is

Git is not a file server. It is a content-addressed database of objects (blobs, trees, commits, tags) identified by SHA-1 (now SHA-256 in experimental mode). Every operation — commit, merge, rebase, checkout — works by writing or moving pointers in this object graph. Two developers can work offline for weeks and merge cleanly because the graph never needed a central server to authorize the write.

The design goal, stated by Linus Torvalds in 2005, was speed, simplicity and support for non-linear development with thousands of branches.

Why it matters

GitHub, GitLab, Bitbucket, Codeberg, Gitea — all are interfaces over Git. Every deploy pipeline, every code review, every changelog is a Git artifact. A developer who cannot navigate Git commits, branches and merges cannot collaborate in 2026.

Git vs SVN vs Mercurial

Aspect

Git

SVN

Mercurial

Model

Distributed DAG

Centralized tree

Distributed DAG

Speed

Very fast

Medium

Fast

Branching

Cheap (pointer)

Expensive (copy)

Cheap

Ecosystem

GitHub, GitLab, etc.

Legacy

Less common

Learning curve

Steep

Shallow

Medium

The Git model

graph LR
  W[Working tree] -->|git add| I[Index]
  I -->|git commit| R[Local repo]
  R -->|git push| Rem[Remote]
  Rem -->|git pull/fetch| R
  R -->|git checkout| W
  style R fill:#E8F5E9

How to use Git well

Git hygiene

  1. One concern per commit

    If the message has "and" twice, split the commit.

  2. Commit messages that survive `git log --oneline`

    Imperative subject ≤50 chars, blank line, wrapped body ≤72 chars explaining why.

  3. Rebase local, merge shared

    Rebase your local branch onto main before opening a PR. Merge feature branches with --no-ff to preserve the event.

  4. Never rebase main

    Rewriting main breaks every clone.

  5. Use `--force-with-lease`, never `--force`

    Protects against overwriting someone else's push.

Common failures

Origin

In 2002–2005 the Linux kernel used BitKeeper, a proprietary VCS. When BitKeeper's license was revoked in April 2005, Linus Torvalds wrote Git in two weeks as a replacement. The first self-hosting commit (Git committing itself to itself) was April 7, 2005. Git 1.0 shipped in December 2005. Today it is maintained by Junio Hamano and the community.

I'm an egotistical bastard, and I name all my projects after myself. First Linux, now Git.

— Linus Torvalds, 2005 (self-attributed; "git" in British slang means "unpleasant person")
2005 · Linus Torvalds crea Git en 2 semanas
2005 · Primer self-hosting
2008 · GitHub populariza
2018 · Microsoft compra GitHub
2024 · SHA-256 commits (experimental)

Evidence

FAQ

Is Git the same as GitHub?

No. Git is the VCS; GitHub is a hosting service for Git repos.

Git vs GitHub?

Git works offline and independently; GitHub adds collaboration, CI and issue tracking.

Reset vs revert?

Reset moves the branch pointer (rewrites history); revert creates a new commit that undoes an old one (preserves history).

Is Git hard?

The mental model (commits, branches, remotes) is small; the CLI vocabulary is large.

Connections

Etymology

Origin: coined

  • git (noun): British slang for "unpleasant person"; chosen by Torvalds self-deprecatingly

Semantic network

Gitversion-coCommitBranchMergeRebaseStash

● broader ● narrower ● related

Broader

  • version-control

Related

Used in the garden

Sources