About
Git ships with two kinds of commands. The porcelain ones are the friendly surface —
commit, push, log. The plumbing ones underneath —
hash-object, update-ref, cat-file — are what the
porcelain is built from. Almost nobody needs the plumbing, but knowing it exists changes
how the rest reads: every porcelain command is a short script that writes some objects
and then moves a pointer.
That is the idea behind the way this reference is laid out. Rather than an alphabetical
list, commands are grouped by which of four states they read from and which they write to:
the working tree, the index, the local repository, and a remote. The question people
actually arrive with is never "what does reset do" — it is "my change is in
the wrong place, how do I move it".
Things deliberately left out:
- Submodules. They deserve more than a line each, and half the advice about them is about avoiding them.
- Hooks and server-side configuration, which depend entirely on your forge.
- GUI clients. Nothing against them, but they name things differently and a reference that tried to cover both would help with neither.
Where a command has changed meaning across versions, the wording follows git 2.23 and
later — the release that introduced switch and restore and
retired most reasons to reach for checkout.
This is a personal reference that grew out of notes, published because a colleague kept
asking for the link. It is not affiliated with the Git project, and the canonical
documentation is always the manual pages shipped with your install:
git help <command>.