Git
Cheat sheet · https://pcornel.dk/topic.php?topic=5464
Answer
Git is the distributed version-control layer that records content snapshots and references so automation changes can be reviewed, compared, integrated, reproduced and traced without treating repository state as deployed target state.
Remember
- Repository state ≠ deployed state; Git records versioned intent and history but does not prove infrastructure or application convergence.
- Working tree ≠ index ≠ commit; edits, staged content and recorded snapshots are distinct states.
- Local history ≠ remote history; refs can diverge until fetch/push synchronization is observed.
- Git ≠ GitOps; Git provides version control while GitOps adds declarative desired state and reconciliation.
First checks
git status— working treegit log --oneline -10— historygit remote -v— remotes
Verify in this order
edit → commit → push → review → merge
Where it usually breaks
A clean or synchronized repository proves only version-control state. It does not prove that a downstream pipeline ran, a GitOps controller reconciled or the target system matches the committed intent.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness. Preserve at least three independent checks: prerequisite/interface or identity/transport state; the owning control/service/policy state; then effective data-plane, backend or workload state. A healthy upstream boundary does not prove the downstream consumer or return path.
Git 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=5464