HomeBytesheetsRoadmapsUI TemplatesUI ToolsStack Discussion
60 Topics
Chapter•75 Minutes

Top Interview Questions & Practice

Master 50+ essential Git interview questions ranging from core fundamentals to senior-level real-world scenarios.

Junior Fundamentals

Test your understanding of Git's core concepts, repository structure, commits, staging, branches, and everyday commands.

Key Takeaways
  • Understand Git's distributed model.
  • Know the difference between working tree, index, and repository.
  • Be able to explain common everyday commands.
Knowledge Check

1. What is Git?

Core Git Concepts

These questions cover the fundamental objects and areas that make Git different from simpler version-control systems.

Knowledge Check

2. What does `git init` do?

Staging and Commits

Practice questions about the staging area, diffs, commits, amend, reset, and restoring files.

Knowledge Check

3. What does `git add` do?

Branching Questions

Test your knowledge of branch references, HEAD, switching, tracking, and branch lifecycle.

Knowledge Check

4. Why are Git branches lightweight?

Remote Collaboration Questions

Test remote repositories, fetch, pull, push, upstream branches, and pull requests.

Knowledge Check

5. What does `git fetch` do?

Intermediate Git Questions

Challenge yourself with merge, rebase, conflicts, stash, cherry-pick, tags, and history inspection.

Knowledge Check

6. What is the main difference between merge and rebase?

Advanced History Questions

These questions focus on reflog, reset modes, detached HEAD, bisect, and history rewriting.

Knowledge Check

7. What is the main purpose of `git reflog`?

Git Internals Questions

Explore Git's object model, refs, the index, object IDs, and storage.

Knowledge Check

8. Which object stores the contents of a file?

Real-World Scenarios

Practice practical situations that commonly appear in Git interviews.

Knowledge Check

9. You accidentally ran `git reset --hard HEAD~1`. What should you check first to recover the previous commit?

Senior Git Workflow Questions

These questions cover team practices, protected branches, CI, history rewriting, and repository design.

Knowledge Check

10. Why should shared public history generally not be rebased casually?