181351 posts 1993 follows 1215 followers
Please pay attention to random failures.
https://mstdn.maud.io/@omasanoriAn object can be a blob, tree, commit, or tag. An object is identified by its ID, which is a SHA.
A blob is just some arbitrary data. Files are represented as blobs.
Trees are a list of blob IDs and other tree IDs, and their names. Directories are represented as trees.
A commit has a tree ID, an author, a date, a parent commit ID (or IDs, for a merge commit), and a commit message.
A reference is just a commit ID. Branches are a kind of reference. The only information which is stored to represent "master" is the ID of the latest commit. To get the commit log, you just follow the parent ID in each commit. To get the contents, you look at the tree ID of that commit. To update master, create a new commit and write its ID to .git/refs/heads/master (which is a plaintext file).
A tag has a commit ID, an author, and a message. It just calls out a specific commit as special, like a release number, and adds a message, such as that version's changelog.
All git commands are just a means of manipulating what is ultimately a very simple data store. If you want to know more about how a specific command works and how it relates to this data store, let me know.