Git Interview Guide

🟢 Easy (Basics)

1. Git?
Distributed VCS for snapshots of code.
2. Branch vs tag?
Branch moves; tag immutable (release).
3. Merge vs rebase?
Merge keeps history; rebase rewrites for linearity.
4. Stash?
Save work‑in‑progress temporarily.
5. Three states?
Working dir, staging (index), HEAD.

🟡 Medium (Hands‑on)

1. Interactive rebase?
Squash/reword/reorder commits.
2. Cherry‑pick?
Apply specific commit onto another branch.
3. Reset vs revert?
Reset moves ref; revert adds inverse commit.
4. Hooks?
Client/server scripts (pre‑commit, pre‑push).
5. LFS?
Store large binaries efficiently.

đź”´ Hard (Advanced)

1. Conflict strategy?
Small merges, tests, mergetools, bisect for bugs.
2. Monorepo perf?
Sparse checkout, partial clone, modular CI.

đź§Ş Scenario Questions & Answers

1. Secret committed.
Rotate/rewrite history with filter‑repo; protect future pushes.
2. Need 1 commit PR.
Squash via rebase -i or squash merge.
3. Wrong base.
Rebase onto correct base or cherry‑pick.

Generated for quick interview revision — basics, hands-on, advanced, and scenarios.