---
title: Git Interview Questions & Answers (2026): Branching, Merge vs Rebase & More
description: The Git interview questions that get asked in 2026 — merge vs rebase, resolving conflicts, reset vs revert, branching strategies and the staging area — with clear answers.
url: https://usegreenroom.app/blog/git-interview-questions
last_updated: 2026-06-19
---

← Back to blog

Technical

# Git interview questions and answers

June 19, 2026 · 8 min read

![Git interview questions and answers — cover from Greenroom, the AI mock interviewer](/assets/blog/git-interview-questions-hero.webp)

Git questions show up in almost every developer interview, and they separate people who actually understand version control from people who memorized five commands. The questions cluster around branching, merge vs rebase, undoing changes, and Git's underlying model. Here are the **Git interview questions** that actually get asked, with answers.

## Core concepts

- What is the difference between Git and GitHub?
- The three areas — working directory, **staging area**, and repository.
- git fetch vs git pull.
- What is a commit, and what does a commit hash represent?
- What is HEAD?

## Branching, merge & rebase

- How does branching work, and why is it cheap in Git?
- **Merge vs rebase** — the difference and when to use each.
- What is a fast-forward merge?
- How do you resolve a merge conflict?
- What is a detached HEAD?

![Git interview topics — branching, merge vs rebase, reset vs revert, staging](/assets/blog/pool-structured-screen.webp)

Git rounds test whether you understand the model, not just memorized commands.

## Undoing & workflows

- **reset vs revert vs checkout** — and which is safe on shared branches.
- git stash; cherry-pick.
- Soft vs mixed vs hard reset.
- Branching strategies — Git Flow, trunk-based, feature branches.

**The core truth:** Git interviews reward understanding the model — that branches are pointers, that rebase rewrites history, that revert is safe on shared branches while reset isn't. Memorized commands without the model fall apart on "what would this do?".

## How to prepare

Git rounds ask "what happens if…" scenarios. Practise explaining merge vs rebase and reset vs revert out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Pair it with our DevOps guide.

## Frequently asked questions

### What are the most common Git interview questions?

Common Git questions cover Git vs GitHub, the working directory/staging area/repository model, fetch vs pull, commits and HEAD, branching, merge vs rebase, fast-forward merges, resolving conflicts, detached HEAD, reset vs revert vs checkout, soft/mixed/hard reset, stash and cherry-pick, and branching strategies like Git Flow and trunk-based development.

### What is the difference between merge and rebase?

Merge combines two branches by creating a new merge commit that ties their histories together, preserving the exact history but adding extra commits. Rebase moves your branch's commits to replay on top of another branch, producing a linear history but rewriting commit hashes. Use merge to preserve history on shared branches and rebase to keep a clean linear history on your local feature branch before sharing.

### What is the difference between git reset and git revert?

git reset moves the branch pointer to an earlier commit, potentially discarding commits, which rewrites history and is unsafe on shared branches. git revert creates a new commit that undoes the changes of a previous commit without rewriting history, making it safe to use on shared branches. Use revert to undo public commits and reset for local cleanup.

### How should I prepare for a Git interview?

Focus on understanding Git's model — branches as pointers, how rebase rewrites history, and why revert is safe on shared branches while reset isn't — rather than memorizing commands, since interviewers ask 'what would this do' scenarios. Practise explaining merge vs rebase and reset vs revert out loud with a voice-based mock interview that follows up.

Git rounds reward understanding the model, explained out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Free to start.