Pcornel
Automation · Git

History

Cheat sheet · https://pcornel.dk/topic.php?topic=5477

Back to the Topic

Answer

Git history is the commit graph and associated metadata reachable from selected refs; views can differ depending on traversal, filtering and ref freshness.

Remember

  • History recorded ≠ repository state correct; a valid graph can contain unwanted commits or omit unreachable/local history from a chosen view.
  • Log order ≠ simple chronological truth; topology and timestamps can differ.
  • Author timestamp ≠ integration time; author and committer metadata have different meanings.
  • Visible branch history ≠ all recoverable history; reflogs or unreachable objects may exist locally.

First checks

  • git log --oneline --graph — history
  • git log -p -- <file> — file history
  • git blame <file> — line origins

Verify in this order

commits → history → investigation

Where it usually breaks

Git history proves recorded ancestry and metadata for reachable objects, not that commits were reviewed, built, deployed or operationally correct.

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

History Git boundary map

BoundaryHealthy evidenceSuspicious evidence
Local stateRepository, HEAD, worktree/index and commit IDs are explicitWrong repo/ref, hidden staged/untracked state or mutable-name ambiguity
History / refsAncestry and branch/tag movement match intentUnexpected rewrite, stale tracking ref or unclear merge base
Remote syncURL/refspec, auth and remote read-back match expected commitsLocal assumptions, rejection, stale fetch or unsafe force update
Downstream proofBuild/reconciliation/target is verified independentlyPush/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=5477

Confirmation

Confirm action

Continue?