Git Quiz
Eight quick questions on git fundamentals and recovery.
Sample questions
EXAMPLE
# Git quiz 1) Fast-forward merge keeps: a) a merge commit b) a linear history when the target branch has no new commits c) deleted files only d) tags only 2) git pull = ? a) git fetch + git rebase b) git fetch + git merge (or rebase if configured) c) git status d) git push 3) git rebase changes: a) the remote b) local commit SHAs (you are rewriting history) c) nothing d) the working tree only 4) git reflog stores: a) commit messages b) every HEAD move locally for ~90 days - your safety net c) remote logs d) author dates 5) HEAD is: a) the latest commit on main b) a pointer to the current branch (or commit if detached) c) the staging area d) the working tree 6) The safest way to share history rewrites: a) force-push without warning b) avoid - rewrite only your own unpushed work; or coordinate + use --force-with-lease c) reset the remote d) clone fresh 7) git stash + git stash pop is for: a) backups b) parking uncommitted work, returning to it later c) rebasing d) merging 8) git bisect: a) cleans up branches b) binary-searches commits to find a regression c) signs commits d) creates a tag Answers: 1b, 2b, 3b, 4b, 5b, 6b, 7b, 8b.
Why it matters
Bisect for regressions and reflog for mistakes are the two safety nets you almost never use - until the day you do. Internalise the rest until the daily commands run from muscle memory.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Discussion
Loading…