Git & GitHub interview questions and quick answers
Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.
Review 1,228 questions and short answers on Git & GitHub. Start with real examples below, then search, practise and follow links to full explanations.
Git & GitHub: questions worth revising first
These answers come from AI Tapri's existing question bank and published interview guides. Open each answer and read the linked in-depth guide for examples and context.
01What is the difference between git bisect and git blame?
git blame shows who last changed each line of a file and in which commit. git bisect finds which commit introduced a behavior by testing the project at different points in history.
Read the full explanation02What branching strategies do teams use in Git? Compare GitFlow and trunk-based development.
Most teams use short-lived feature branches merged through pull requests. GitFlow adds long-lived develop, release and hotfix branches and suits planned, versioned releases. Trunk-based development keeps everyone merging small changes into main at least daily, using CI and feature flags, and suits teams that deploy often.
Read the full explanation03How do you cherry-pick a range of commits, and what if there is a conflict?
Use git cherry-pick A^..B to copy commits from A through B. On conflict, fix the files, git add them and run git cherry-pick --continue, or use --abort to cancel.
Read the full explanation04What is the difference between git push --force and --force-with-lease?
--force overwrites the remote branch no matter what. --force-with-lease overwrites only if the remote is still where you last saw it, so you do not wipe out commits a teammate pushed meanwhile.
Read the full explanation05What is the difference between a fork, a clone and a branch?
A fork is your own server-side copy of someone else's GitHub repository. A clone is a local copy on your computer. A branch is a separate line of work inside one repository.
Read the full explanation06What is the difference between git diff and git diff --staged?
git diff shows changes in your working files that are not yet staged. git diff --staged shows changes already added to the staging area, which is exactly what the next commit will contain.
Read the full explanation07What is version control?
Track changes to code over time. Branches, commits, history. Collaborate safely, revert if needed.
08What is Git?
Distributed version control system. Created by Linus Torvalds. Tracks file changes, enables collaboration.
Find your next answer.
Pick a topic, search a keyword, or open a question to reveal the answer.
Git & GitHub quick answers
Free to practise. No account needed. Made for quick revision, not rote memorisation.
Keep preparing for Git & GitHub
Quick answers help with recall; detailed guides explain the reasoning, examples and common mistakes behind each answer.