📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Git & GitHub Git Interview Prep

Git Interview Prep

5 min read Quiz at the end
Key Git interview topics: merge vs rebase, fetch vs pull, HEAD, revert vs reset, cherry-pick.

Git Interview Topics

  • merge vs rebase — merge preserves history with merge commit; rebase creates linear history
  • git fetch vs pull — fetch downloads without merging; pull = fetch + merge
  • HEAD — pointer to the current commit (usually tip of current branch)
  • Detached HEAD — HEAD points to a commit, not a branch
  • fast-forward merge — branch was ahead of base; just move pointer, no merge commit
  • cherry-pick — apply a specific commit from one branch to another
  • git stash — temporarily save uncommitted changes to work on something else
  • git bisect — binary search through commits to find which one introduced a bug
  • reset --soft / --mixed / --hard — vary in how much they discard (commit only / unstage / discard all)
  • revert vs reset — revert is safe (new commit); reset rewrites history (dangerous on shared branches)
Topic Quiz · 2 questions

Test your understanding before moving on

1. What is the difference between git merge and git rebase?
💡 Merge = non-destructive history; rebase = rewrites commits for a linear log.
2. What does git fetch do vs git pull?
💡 Use git fetch + inspect + merge manually for more control than a direct pull.