issue 117apr 27mmxxvi
est. 2026
delhi/ncr edition
vol. IX · no. 117
PapersAdda
placement intelligence, source-anchored
1,000+ briefs · 24 campuses · 120+ companies
verified offers · sourced from r/developersIndia
razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1
section: Interview Questions / interview questions
08 Jun 2026
placement brief / Interview Questions / interview questions / 08 Jun 2026

Git Interview Questions 2026, 35 Q&A on Branching, Merge vs Rebase, and Recovery

Git fluency is assumed in 2026, and candidates report interviewers probe the parts people fake: rebase, reset vs revert, and recovery. Beyond add and commit,...

on this page§ 06
advertisement

Git fluency is assumed in 2026, and candidates report interviewers probe the parts people fake: rebase, reset vs revert, and recovery. Beyond add and commit, the questions test your mental model of commits, branches, and history. This guide compiles 35 questions from candidate-reported rounds and public preparation resources, each with commands and the trade-off being tested.

The mental model: a branch is just a movable pointer to a commit, and a commit is an immutable snapshot. Most Git confusion dissolves once this clicks.

Related: CI CD Interview Questions 2026 | Docker Scenario Based Questions 2026 | REST API Interview Questions 2026 | Node.js Interview Questions 2026


Fundamentals (Q1 to Q12)

Q1. What is the difference between Git and GitHub?

Q2. What are the three states of a file in Git?

Q3. What is the difference between git fetch and git pull?

Q4. What is a branch in Git?

Q5. What is HEAD?

Q6. What is the difference between git merge and git rebase?

MergeRebase
HistoryPreserves, adds a merge commitLinear, replays commits
ResultNon-linear graphClean straight line
Shared branchesSafeAvoid (rewrites history)
UseIntegrating feature branchesTidying local commits before pushing

Candidate-reported as the single most common Git question. The key: never rebase commits others have pulled.

Q7. Why should you not rebase a shared/public branch?

Q8. What is the difference between git reset and git revert?

resetrevert
ActionMoves the branch pointer backCreates a new commit undoing changes
HistoryRewrites itPreserves it
Shared branchesDangerousSafe

Use revert to undo on shared branches; reset for local cleanup. Candidate-reported as a top question.

Q9. What are the three modes of git reset?

Q10. What is git stash?

Q11. What is the difference between git stash pop and apply?

Q12. What does git cherry-pick do?


Conflicts, History, and Recovery (Q13 to Q24)

Q13. How do you resolve a merge conflict?

Q14. How do you recover a deleted commit or branch?

Q15. What is git reflog?

Q16. How do you undo the last commit but keep the changes?

Q17. How do you amend the last commit?

Q18. What is an interactive rebase used for?

Q19. What is the difference between a fast-forward and a three-way merge?

Q20. How do you squash commits?

Q21. How do you find which commit introduced a bug?

Q22. How do you see who changed a line and when?

Q23. What is the difference between git diff, git diff --staged, and git diff HEAD?

Q24. How do you remove a file from Git but keep it locally?


Workflows and Best Practices (Q25 to Q35)

Q25. What is the difference between centralized, feature-branch, Gitflow, and trunk-based workflows?

Q26. What is a pull request and why use it?

Q27. What makes a good commit message?

Q28. What is the difference between origin and upstream?

Q29. How do you keep a fork in sync with upstream?

Q30. What are Git tags and when do you use them?

Q31. What is git submodule?

Q32. How do you handle a large binary file in Git?

Q33. What does git clean do?

Q34. Scenario: you committed a secret and pushed it. What do you do?

Q35. Scenario: your feature branch is far behind main with conflicts. How do you update it cleanly?


Git Mock Test, 2026 Edition

5 original questions calibrated to the 2026 batch by Aditya Sharma, from candidate-reported patterns.

Question 1

To undo a commit on a shared branch safely, use:

a) git reset --hard b) git revert c) git rebase d) git commit --amend

Solution: revert creates a new undoing commit, preserving history. Answer: (b)

Question 2

You should NOT rebase:

a) local commits b) commits others have already pulled c) your own branch d) WIP commits

Solution: Rebasing shared history rewrites hashes and breaks others. Answer: (b)

Question 3

To recover a lost commit after a hard reset, use:

a) git stash b) git reflog c) git clean d) git fetch

Solution: reflog tracks every HEAD position for recovery. Answer: (b)

Question 4

git reset --soft HEAD~1:

a) deletes changes b) moves HEAD back and keeps changes staged c) pushes d) merges

Solution: Soft reset keeps the changes staged. Answer: (b)

Question 5

To find the commit that introduced a bug, use:

a) git blame b) git bisect c) git log d) git diff

Solution: bisect binary-searches history for the bad commit. Answer: (b)


FAQ, Git Interview Questions

Q: How deep is rebase tested? Candidate-reported rounds expect the merge-vs-rebase trade-off and the golden rule: do not rebase shared history.

Q: Do freshers get Git questions? Yes, branching, staging, merge conflicts, and basic commands. Recovery and workflows skew mid to senior.

Q: Is the reflog commonly asked? Yes, as a recovery question. Knowing it signals real Git experience.

Q: What is the most-missed Git concept? reset vs revert and not rebasing shared branches, per candidate-reported feedback.


You May Also Like

advertisement
Sources and review notesreviewed 8 Jun 2026
Article-specific sources
Verification window
Page last edited 8 Jun 2026 by Aditya Sharma. A review date records an editorial edit, not a guarantee that every external fact is still current.
Evidence labels

Official notices, candidate reports, offer documents, and editorial practice questions carry different confidence levels. The visible source list lets you inspect the evidence instead of relying on a blanket verification badge.

Verification policy: /editorial-standards/. Found something incorrect? Submit a correction - we respond within 48 hours.

topic cluster

More resources in Interview Questions

Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.

Open Interview Questions hubBrowse all articles

paid contributor programme

Sat this this year? Share your story, earn ₹500.

First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story with byline.

Submit your story →

ready to practice?

Take a free timed mock test

Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.

Start free mock test →
related guides
more from PapersAdda
Company Placement PapersFlipkart Placement Papers 2026, Complete Guide with Solutions
15 min read
Company Placement PapersGoogle Placement Papers 2026, Complete Guide with Solutions
16 min read
Company Placement PapersRazorpay Placement Papers 2026, Complete Guide with Solutions
18 min read
Exam PatternsInfosys Power Programmer Coding 2026: How PP Differs From SP
7 min read

Share this guide