Commit
Cheat sheet · https://pcornel.dk/topic.php?topic=5468
Answer
A Git commit is an immutable snapshot object plus metadata and parent relationship, while branch names are movable references that may later point elsewhere.
Remember
- Commit exists ≠ change deployed; downstream systems may never consume that commit.
- Commit message ≠ commit contents; inspect the tree/diff rather than trusting description text.
- Author metadata ≠ cryptographic identity proof; configurable metadata is not authentication.
- Committed ≠ backed up remotely; a local commit can be lost with the local repository.
First checks
git add -p— stage selectivelygit commit -m '<type>: <summary>'— commitgit show --stat HEAD— review commit
Verify in this order
staged changes → commit
Where it usually breaks
Creating a commit proves a specific snapshot and ancestry exist locally; it does not prove remote durability, approval, build success or deployment.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Commit Git boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Local state | Repository, HEAD, worktree/index and commit IDs are explicit | Wrong repo/ref, hidden staged/untracked state or mutable-name ambiguity |
| History / refs | Ancestry and branch/tag movement match intent | Unexpected rewrite, stale tracking ref or unclear merge base |
| Remote sync | URL/refspec, auth and remote read-back match expected commits | Local assumptions, rejection, stale fetch or unsafe force update |
| Downstream proof | Build/reconciliation/target is verified independently | Push/tag/merge success treated as deployment success |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5468