Git internals, in a nutshell:

.git/objects contains a bunch of files named for their sha-1 hash, these are objects.

An object can be a blob, tree, commit, annotated tags, or arbitrary user data.

A blob is a file.

A tree is a list of files, their unix file mode, and other trees.

A commit has a list of parent commits, a date, author, commit message, and a tree ID.

An annotated tag has a commit ID and a message.

References are files in .git/refs, whose contents are a commit ID. Example references include branches (.refs/heads), tags (.refs/tags), and remote branches (.refs/remotes).

Remotes are stored in .git/config, as well as any relationships between remote branches and local branches.

"part2: The thing about .git/objects is actually a lie. Meet: packfiles" when?

@sir What happens when there is a SHA-1 collision in the objects directory (

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!