Search notes:

commit object [git]

A commit object is a single point in the repository's history. It contains these information
A commit is a snapshot of the entire repository. Unlike other SCMs, it doesn't store diffs.
A commit object is sometimes abbreviated as «commit» or referred to as «revision».
If two different commit objects point back to one other commit object, it is called a branch.
A commit object might be created with git commit-tree.

Parents

A commit object can have any number of parents.
An ordinary commit, however, has exactly one parent.
An initial commit (root commit) has no parents.
A commit that was created as part of a merge has multiple parents: one for each line of history.

Looking at the content of a commit object

git cat-file commit 5f39acdb8
git cat-file commit HEAD

To commit

«to commit» (the verb rather than the noun) describes the action of storing a new snapshot of files into the Git history: it creates a new commit object representing the current state of the index and advances the HEAD to point at the new commit.

Copying commit objects between repositories

Commit objects are transferred between repositories with the git commands

Removing commit objects

Commit objects can be removed from a repository with one of the following commands:

Directed acyclic graph

The commit objects form a directed acyclic graph because they have parents (which makes them directed) and there is no chain which begins and ends with the same object (which would make them acyclic).

Commit-ish identifiers

A complete list of commit-ish identifiers can be found in this Stack Overflow answer.
This answer also points out that there are two tree-ish identifiers which cannot be used as commit-ish identifiers.
@ is an alias for HEAD.

Reachable commits

All ancestors of a given commit are said to be «reachable» from that commit.

Cleaning up unreachable commits

Commits that cannot be reached via a branch or a tag will be garbage collected after 30 days.

See also

Git objects
git rev-list lists commit objects in reverse chronological order.
git log --full-history -- /path/to/file shows all commits where a given file was involved.
git show --stat <commit-SHA> returns a list of the files that were changed in a given commit.
git diff (to show differences between to commit objects).
git difftool (to show such differences with a tool that is suitable to show differences, such as gvim -d).
commit, git log, git revert, git whatchanged, git verify-commit, git show-branch
A commit object's hash can be shown with git's --format option %H (full) and %h (abbreviated)

Index