← Library07 Knowledge

git · status/growing

Git and Version Control

07 Knowledge/Git and Version Control.md

Git and Version Control

Git stores a graph of snapshots. Branches are movable names pointing to commits; merges and rebases create different histories from the same changes.

Practical rules

  • Commit one coherent reason for change.
  • Inspect status and the diff before staging and committing.
  • Write messages that explain intent and consequences.
  • Pull remote changes before publishing when collaboration requires it.
  • Never rewrite shared history casually.
  • Use revert for an auditable undo of published changes.

Debugging tools

  • git log reveals history and intent.
  • git diff shows change between states.
  • git blame is a route to context, not blame.
  • git bisect finds the first bad commit through binary search.

Failure modes

Accidentally committing secrets, mixing unrelated changes, large binary history, destructive recovery commands, and resolving conflicts without understanding both sides.

Knowledge connections