Skip to content
InterviewEra
Loading account navigation
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Product

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Resources

  • Interview Questions
  • All Resources
  • Blog
  • Community Hub
  • DSA Topic Map
  • Placement Guide
  • STAR Guide

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy

© 2026 InterviewEra. All rights reserved.

Privacy Policy|Terms & Conditions|Refund Policy
|Ranchi, Jharkhand, India
Interview Questions›Topics›Git

DevOps · Fresher-relevant

Git Interview Questions 2026

Git interview questions on branching strategies, merge vs. rebase, cherry-pick, and resolving conflicts in collaborative workflows.

DevOpsFresher-relevant

Git Interview Questions

Placement-oriented · Updated 2026
  1. 01

    What is the difference between git merge and git rebase?

    TechnicalMedium

    Tip: Merge creates a merge commit, preserving the true branching history (non-destructive). Rebase replays your commits on top of the target branch for a linear history, but rewrites commit hashes. Rule of thumb: rebase local/private branches, never rebase shared/pushed history.

  2. 02

    What is the difference between git fetch and git pull?

    TechnicalEasy

    Tip: git fetch downloads remote changes into remote-tracking branches without touching your working branch. git pull is fetch + merge (or rebase with --rebase) into your current branch. Fetch lets you review before integrating; pull integrates immediately.

  3. 03

    How do you undo commits — reset vs revert?

    TechnicalMedium

    Tip: git revert creates a new commit that undoes a previous one — safe for shared history. git reset moves the branch pointer back: --soft keeps changes staged, --mixed unstages them, --hard discards them. Use revert on pushed commits, reset on local-only work.

  4. 04

    What is the difference between git reset, git stash, and git checkout?

    TechnicalMedium

    Tip: stash shelves uncommitted changes to switch context, restored later with stash pop. reset moves the branch/HEAD and optionally changes the index/working tree. checkout (or switch/restore in modern Git) switches branches or restores files. They operate on different parts of Git's three trees.

  5. 05

    Explain a typical Git branching strategy.

    TechnicalMedium

    Tip: Common: trunk-based (short-lived feature branches merged to main behind feature flags, fast CI/CD) or GitFlow (main, develop, feature, release, hotfix — heavier). Most modern teams prefer trunk-based with PRs and protected main for speed and fewer merge conflicts.

  6. 06

    How do you resolve a merge conflict?

    TechnicalEasy

    Tip: Git marks conflicting regions with <<<<<<<, =======, >>>>>>>. Edit each file to the correct combined result, remove the markers, git add the resolved files, then commit (or continue the rebase/merge). Tools like a 3-way merge editor help on complex conflicts.

  7. 07

    What does git cherry-pick do?

    TechnicalMedium

    Tip: cherry-pick applies the changes from a specific commit onto your current branch as a new commit — useful for porting a bug fix to a release branch without merging everything. It can cause duplicate commits if the branch is later merged, so use it deliberately.

  8. 08

    What is the difference between the working directory, staging area, and repository?

    TechnicalEasy

    Tip: The working directory holds your actual files. git add moves changes to the staging area (index) — a snapshot of what will be committed. git commit records the staged snapshot into the local repository. git push then publishes commits to the remote.

Practice Git questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need Git

  • Software Engineer questions
  • Frontend Developer questions
  • Backend Developer questions
  • DevOps Engineer questions
  • QA Engineer questions

Related devops topics

  • Docker questions
  • Linux questions
  • Kubernetes questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples