← All interview questions

Skill Zuno · skillzunos.com · Fullstack Pro

GIT interview questions

Prepare for GIT interviews on Skill Zuno. This practice book covers GIT interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.

Open GIT on Skill Zuno

Also see the GIT tutorial.

Git is the distributed version control system used by almost every software team. It records snapshots of a project as commits, lets developers work on branches in parallel and merges their work back together. Git interviews cover the staging area, branching and merging, rebasing, resolving conflicts, undoing changes and team workflows built on pull requests.

Sample GIT interview questions

What is the difference between git merge and git rebase?

Merge joins two histories with a merge commit and keeps the real history. Rebase replays your commits on top of another branch, giving a linear history but new commit IDs, so avoid rebasing commits others already have.

What is the difference between git fetch and git pull?

fetch downloads new commits from the remote without changing your branch. pull runs fetch and then merges or rebases the remote branch into your current branch.

What is the difference between git reset and git revert?

reset moves the branch pointer back, rewriting history, which is fine for local work. revert creates a new commit that undoes an earlier one, which is safe on shared branches.

How do you recover a commit you lost after a reset?

Run git reflog to find where HEAD pointed before the reset, then git reset --hard or git branch to that commit. The reflog keeps local history for about 90 days by default.

What does the staging area do?

It holds the exact snapshot the next commit will contain, so you can commit only some of your changes, even parts of a file with git add -p.

What you can practice

  • GIT interview questions for beginners and experienced developers
  • Level-based practice: New, Easy, Medium, Hard, and Diff
  • Fullstack Pro topics alongside GIT on skillzunos.com

More Fullstack Pro interview questions

All interview questions