Commit
A recorded snapshot of a project with a message explaining it.
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 also6
Hand-picked in the note itself — the neighbours worth reading next.
Atomic Commit
A commit containing exactly one logical change, complete and independently sound.
Version Control & Delivery9 connections
Conventional Commits
A lightweight convention giving commit messages a machine-readable type and scope.
Version Control & Delivery10 connections
Version Control
A system recording the history of a project's files, enabling branching, merging, and recovery.
Version Control & Delivery13 connections
Provenance
The recorded origin of a change or a claim — who made it, when, and on what evidence.
Method18 connections
Squash Merge
Collapsing a branch's commits into one before merging, trading granularity for a clean main history.
Version Control & Delivery10 connections
Rebase
Replaying a branch's commits onto a new base, producing new commits with the same changes.
Version Control & Delivery10 connections
Related3
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from6
Notes elsewhere in the wiki that reach for this one.
- Atomic CommitVersion Control & Delivery
A commit containing exactly one logical change, complete and independently sound.
- Conventional CommitsVersion Control & Delivery
A lightweight convention giving commit messages a machine-readable type and scope.
- ProvenanceMethod
The recorded origin of a change or a claim — who made it, when, and on what evidence.
- RebaseVersion Control & Delivery
Replaying a branch's commits onto a new base, producing new commits with the same changes.
- Squash MergeVersion Control & Delivery
Collapsing a branch's commits into one before merging, trading granularity for a clean main history.
- Version ControlVersion Control & Delivery
A system recording the history of a project's files, enabling branching, merging, and recovery.