Warm-up · from “Your first repository and commit”
What does git init create?
What does git init create?
No notes: write what you remember, then check. Recalling before reading is what makes it stick.
The problem
You want to explain why a branch switch is different from copying a folder. Start by separating data, references and checked-out files.
After this lesson you can
Identify the object database, refs and Index.
Distinguish porcelain from plumbing.
Locate Git metadata safely.
Key terms
Full glossarySay what each term means, then open it to check.
Ref · new in this lesson
Name identifying an object; branch refs usually identify commits.
Porcelain / plumbing · new in this lesson
High-level workflow commands / lower-level inspection and operations.
Tree · preview, covered in lesson 6
Directory snapshot mapping names, modes and object IDs.
Commit · preview, covered in lesson 7
Object identifying a root tree, parent(s), metadata and message.
Visual mental model
- Working tree
- Index
- Objects
- HEAD
- Branch ref
- Commit
Build the mental model
Git has an object database containing immutable objects, refs that identify objects, an Index describing prepared content and a working tree for edits. HEAD identifies the current branch or a commit. Together these parts explain most everyday commands. The repository metadata is usually in .git, but linked worktrees may use a .git pointer file and bare repositories have no working tree.
Under the hood
High-level commands such as git commit are called porcelain. Lower-level commands such as git cat-file and git update-ref are plumbing. Porcelain gives convenient workflows; plumbing exposes specific mechanisms. The course uses both. Prefer supported commands for inspecting and changing metadata rather than editing files directly.
Common mistake · important nuance
HEAD is not the database, and the Index is not a second full physical copy of every file. The labels name different roles.