Repository
Cheat sheet · https://pcornel.dk/topic.php?topic=5466
Answer
A Git repository is a project's complete version history: all commits, branches and tags, stored in the .git directory alongside a working tree of checked-out files. Clones are full copies of the repository.
Remember
- Repository exists ≠ worktree clean; tracked, staged and untracked changes can still be present.
- Directory contains .git ≠ normal standalone repository; .git may be a file pointing to shared metadata or worktree state.
- Object database present ≠ refs healthy; refs can be missing, stale or inconsistent independently.
- Repository reachable ≠ repository trusted; provenance and access policy remain separate security boundaries.
First checks
git rev-parse --show-toplevel— repo rootgit count-objects -vH— size- README, CODEOWNERS, .gitignore present — hygiene
Verify in this order
repo → files + history
Where it usually breaks
Opening a valid repository proves Git metadata is readable, not that its worktree is clean, its refs are intended or its content is safe to consume.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Repository 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=5466