Kelly Mears

Version Control

A system recording the history of a project's files, enabling branching, merging, and recovery.

Version Control & Delivery2 min read206 words10 out · 12 in
also calledGitSource control

Version control records the successive states of a project so that any past state can be recovered, changes can be attributed, and independent work can proceed in parallel and be recombined. Git is the near-universal implementation.

Git's model is worth understanding directly, because most confusion with it comes from working against the model rather than with it. A repository is a content-addressed object store: every file version, directory tree, and Commit is stored under the hash of its contents, and a commit records a tree plus its parents. Branches are just movable pointers into that graph. Nothing is ever modified in place; operations that appear to rewrite history create new objects and move pointers.

Two consequences matter constantly. Anything committed is recoverable, even after a branch is deleted or a reset appears to destroy it — the objects persist until garbage collection. Anything not committed is not protected, which is why a destructive command in a shared working directory is genuinely destructive and why committing frequently is a safety practice rather than a bookkeeping one.

History is also a document. It is the durable answer to why is this here, which is what makes a change description part of the deliverable rather than paperwork; see Provenance.

See also7

Hand-picked in the note itself — the neighbours worth reading next.

Related2

Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.

Linked from12

Notes elsewhere in the wiki that reach for this one.