Posts

Showing posts with the label scm

KB: Git HEAD explained using the "Tape Head" Analogy

Image
  The “Tape Head” Analogy for Git HEAD version control   HEAD = The read/write head on a cassette tape Think of your entire Git repository like an old cassette tape with multiple tracks (branches). ✔️ HEAD is the physical read/write head. It doesn’t store music itself — it just points to where on the tape you want to read or write. ✔️ Switching branches = moving the tape head When you run: git switch feature/login You’re not changing the branch itself — you’re just moving the tape head to read/write on that track. HEAD only exists once There is one tape head , but many tracks. The head points to whichever track you choose. Branches = multiple tracks on the same cassette Each branch is like its own “audio track” that ends at a different timestamp (commit): main -> Commit A feature/ login -> Commit C bugfix -> Commit F All those tracks exist, but the HEAD can point only to ONE at a time . Commits = positions on the track When you rewind to an old...