Kelly Mears

Commit

A recorded snapshot of a project with a message explaining it.

Version Control & Delivery2 min read209 words15 out · 20 in
also calledCommits

A commit is a recorded state of a project together with metadata: authorship, timestamps, parent commits, and a message. It is the unit of history, the unit of revert, and the unit of bisection.

The message is the part with the longest life. A diff shows what changed; only the message can say why, and it is the only explanation that survives in a form nobody has to maintain. A useful message states the motivation and any constraint that shaped the approach — the information a reader a year later cannot reconstruct.

A few mechanical facts worth knowing. Commits record two dates, author and committer, and only the second is rewritten by a rebase — so author dates survive history rewriting and are what you want when reconstructing when something was actually written. Commit messages are never rewritten by a rebase, so a rebase past a change that removed the commit's subject leaves a message narrating work the diff no longer contains. And commit counts between branches are misleading once anything has been squashed, since the same content appears under different hashes.

Staging deserves care in shared working directories: a bulk "add everything" sweeps in other people's in-flight work under your message, producing history that lies. See Atomic Commit.

See also14

Conventional Commits

A lightweight convention giving commit messages a machine-readable type and scope.

Version Control & Delivery14 connections

Version Control

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

Version Control & Delivery26 connections

Provenance

The recorded origin of a change or a claim — who made it, when, and on what evidence.

Method44 connections

Squash Merge

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

Version Control & Delivery24 connections

Rebase

Replaying a branch's commits onto a new base, producing new commits with the same changes.

Version Control & Delivery19 connections

Three-Way Merge

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

Version Control & Delivery17 connections

Regression

A previously working behavior that a change has broken.

Method23 connections

Plausible Mechanism

A causal explanation that was inferred rather than tested, and reads as more rigorous for being specific.

Method63 connections

Fast-Forward Merge

The two basic ways Git joins branches, by sliding a branch pointer forward or by recording a new commit with two parents, and how the choice shapes a project's history.

Version Control & Delivery14 connections

Commit Message

The note attached to each change in version control, conventionally a short summary line and a body explaining why, which becomes the main record of intent for anyone who later wonders why the code is the way it is.

Version Control & Delivery13 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

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

Git Object Model

Git stores every version of a project as a graph of immutable objects named by the hashes of their contents, blobs for files, trees for directories, and commits for snapshots, which makes history tamper-evident and identical content free to store twice.

Version Control & Delivery12 connections

Git Hook

Scripts Git runs automatically at points such as committing or pushing, used to check formatting and messages locally, and on servers to enforce policy or trigger deploys.

Version Control & Delivery15 connections

Linked from20