foundation
Git basics
Understand commits, branches, merges, rebases, cherry-picks, stashes, tags, and remotes as operations on a commit graph.
Git basics interviews test the commit-graph model: snapshots, branch pointers, merging and replaying history, and synchronizing with remotes. Everything else in Git builds on these primitives.
Subtopics: commit, branch, merge, rebase, cherry-pick, stash, tag, remote.
On interviews: draw how a branch points to a commit, explain fast-forward vs merge commit, why rebase changes hashes, and fetch vs pull vs push.
Common pitfalls: thinking branches copy files; merge without understanding two-parent commits; rebase on shared branches without coordination.
The trade-off is linear history (rebase) versus preserved integration topology (merge) on the path to shared main.
Checklist:
- Explain commits as immutable snapshots with parents.
- Treat branches as movable refs.
- Compare merge and rebase outcomes on a diagram.
- Fetch before reasoning about remote state.