Kelly Mears

Version Control

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

Version Control & Delivery2 min read206 words14 out · 22 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 also12

Git Worktree

An additional working directory attached to one repository, each on its own branch.

Version Control & Delivery15 connections

Branching Model

The convention governing what branches exist, what they mean, and how work reaches production.

Version Control & Delivery18 connections

Three-Way Merge

Combining two lines of work by comparing both against their common ancestor.

Version Control & Delivery17 connections

Hash Function

A function mapping arbitrary input to a fixed-size digest, used for identity, integrity, and addressing.

Systems & Tooling30 connections

Monorepo

Several packages developed in one repository with shared tooling and atomic cross-package changes.

Systems & Tooling16 connections

Regression

A previously working behavior that a change has broken.

Method23 connections

Squash Merge

Collapsing a branch's commits into one before merging, trading granularity for a clean main history.

Version Control & Delivery24 connections

Pull Request

A proposal to merge a branch, carrying review, automated checks, and the discussion around it.

Version Control & Delivery25 connections

Gitignore

The file of patterns telling Git which files to leave untracked, such as build output, dependencies, editor clutter, and local secrets, along with the traps of files that were already tracked and secrets already committed.

Version Control & Delivery12 connections

Timeline

Laying events out along a line in order of time, a form that seems obvious but was invented in the eighteenth century and still forces hard choices about scale, density, and what counts as an event.

Design & Interface4 connections

Detached HEAD

The Git state in which the current checkout points directly at a commit rather than a branch, harmless for looking around but a trap for new work, since commits made there belong to no branch and can quietly disappear.

Version Control & Delivery11 connections

Staging Area

The intermediate snapshot in Git between the working files and the next commit, which lets a developer choose exactly which changes go into each commit, down to individual lines.

Version Control & Delivery15 connections

Linked from22