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
  1. What does git init do?

Staging and Commits

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

Knowledge Check
  1. What does git add do?

Branching Questions

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

Knowledge Check
  1. Why are Git branches lightweight?

Remote Collaboration Questions

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

Knowledge Check
  1. What does git fetch do?

Intermediate Git Questions

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

Knowledge Check
  1. 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
  1. 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
  1. Which object stores the contents of a file?

Real-World Scenarios

Practice practical situations that commonly appear in Git interviews.

Knowledge Check
  1. 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
  1. Why should shared public history generally not be rebased casually?

Interview Question 11

Core Git knowledge.

Knowledge Check
  1. What does HEAD usually point to?

Interview Question 12

Core Git knowledge.

Knowledge Check
  1. Which command shows unstaged changes?

Interview Question 13

Core Git knowledge.

Knowledge Check
  1. Which command shows staged changes?

Interview Question 14

Core Git knowledge.

Knowledge Check
  1. What does git commit --amend do?

Interview Question 15

Reset knowledge.

Knowledge Check
  1. Which reset mode leaves changes staged?

Interview Question 16

Reset knowledge.

Knowledge Check
  1. What does default git reset mode do to the index?

Interview Question 17

Reset safety.

Knowledge Check
  1. Why is git reset --hard dangerous?

Interview Question 18

Merge knowledge.

Knowledge Check
  1. When can a merge be fast-forward?

Interview Question 19

Merge knowledge.

Knowledge Check
  1. How many parents can a normal merge commit have?

Interview Question 20

Rebase knowledge.

Knowledge Check
  1. What does rebase primarily do?

Interview Question 21

Rebase knowledge.

Knowledge Check
  1. Why do rebased commits have different hashes?

Interview Question 22

Conflict resolution.

Knowledge Check
  1. What do <<<<<<< and >>>>>>> indicate?

Interview Question 23

Conflict resolution.

Knowledge Check
  1. How do you tell Git a conflicted file is resolved?

Interview Question 24

Rebase conflict recovery.

Knowledge Check
  1. Which command cancels an in-progress rebase?

Interview Question 25

Interactive rebase.

Knowledge Check
  1. What is interactive rebase commonly used for?

Interview Question 26

Cherry-pick.

Knowledge Check
  1. When is cherry-pick useful?

Interview Question 27

Cherry-pick.

Knowledge Check
  1. Does cherry-pick preserve the original commit hash?

Interview Question 28

Stash.

Knowledge Check
  1. What does git stash do?

Interview Question 29

Stash.

Knowledge Check
  1. Which command includes untracked files in a stash?

Interview Question 30

Remote repositories.

Knowledge Check
  1. What is origin?