Git Reference / Mental model
01Mental model
Git stores snapshots, not diffs. Every commit is a full picture of your project, identified by a hash, pointing back to its parent(s). Branches are just movable labels on commits.
Commit
An immutable snapshot plus metadata (author, message, parent hashes). Identified by a SHA like a1b2c3d.
Branch
A lightweight pointer to a commit. Committing moves the current branch forward automatically.
HEAD
“Where you are now.” Usually points to a branch; if it points straight at a commit, you’re in detached HEAD.
Remote
Another copy of the repo (e.g. on GitHub). origin/main is your local memory of where main is on origin.