Git questions show up in almost every software engineering interview, from basic command usage to resolving real conflicts under pressure.
Who should use this guide
Any engineering candidate, Git fluency is assumed at every seniority level today.
Beginner questions
1. What's the difference between git merge and git rebase?
merge creates a new commit joining two branch histories, preserving exactly what happened.
rebase replays your commits on top of another branch, producing a linear history, cleaner to
read, but it rewrites commit hashes, which is risky on shared branches.
2. What does git stash do?
Temporarily shelves uncommitted changes so you can switch branches cleanly, then re-apply them later with
git stash pop.
Intermediate questions
3. How do you resolve a merge conflict?
git merge feature-branch
# conflict markers appear in affected files
# edit files to keep the correct content, then:
git add <resolved-file>
git commit
4. What's the difference between git fetch and git pull?
fetch downloads remote changes without merging them into your current branch.
pull does a fetch followed immediately by a merge (or rebase, depending on config).
Advanced questions
5. How would you undo a commit that's already been pushed?
git revertcreates a new commit that undoes the changes, safe for shared history.git resetrewrites history and should only be used on branches nobody else has pulled.
Frequently Asked Questions
Should I know Git GUI tools, or is the command line enough?
Command-line fluency is what interviewers test, GUI tools are fine day-to-day but rarely come up in interviews themselves.
What's the single most common Git mistake candidates make in interviews?
Confusing reset and revert, or not knowing the practical risk of rebasing a
branch other people have already pulled.
Final preparation tips
Practice resolving a deliberately broken merge conflict in a scratch repo, reading conflict markers under time pressure is a skill that only comes from repetition.

