What is a Git commit object?

Definition

A Git commit object does not contain every file directly. It points to a tree that represents the repository root and to zero or more parent commits that connect it to history.

The commit's content determines its object ID, so changes to the tree, parents or metadata produce a different commit. Loading a commit snapshot may require traversing many tree and blob objects.

Acronyms and aliases

commit object variant

Frequently asked questions

What does a Git commit point to?

It points to a root tree and parent commits and includes author, committer, timestamps and the commit message.

Why can reconstructing a commit require many lookups?

The commit references a tree hierarchy whose entries point to more trees and blobs needed to assemble the full repository snapshot.

Videos explaining Git commit object