Git & SDLC Interview Questions and Answers
Git and software delivery interview questions — merge vs rebase, resolving conflicts, reset vs revert, branching strategies, pull request workflow, semantic versioning and CI/CD basics.
- 01 What is Git, and how is it different from a centralized VCS like SVN? Git is a distributed version control system: every clone is a full repository with the complete history, so you can…
- 02 What is the staging area (index) in Git? The staging area (the “index”) is a middle step between your working directory and a commit. git add puts changes into…
- 03 What is the difference between git fetch and git pull? git fetch downloads new commits from the remote into your remote-tracking branches (origin/main) but doesn't touch…
- 04 What is the difference between git merge and git rebase? Merge combines two branches with a new merge commit, preserving the exact history of what happened. Rebase re-writes…
- 05 What can you do with an interactive rebase? git rebase -i <base> opens a list of commits you can edit: squash/fixup to combine commits, reword to fix a message,…
- 06 What is the difference between git reset, git revert and git restore? git revert <sha> creates a new commit that undoes an earlier one — safe for shared history. git reset moves the branch…
- 07 How do you resolve a merge conflict? Git marks the conflicting sections with <<<<<<< HEAD / ======= / >>>>>>> branch. You edit each file to the correct…
- 08 What is git stash, and when do you use it? git stash saves your uncommitted changes (staged + unstaged) onto a stack and reverts your working directory to a…
- 09 What is git cherry-pick? git cherry-pick <sha> takes the changes from one specific commit and applies them as a new commit on your current…
- 10 What Git branching strategies do you know (GitFlow, trunk-based, GitHub Flow)? GitFlow — long-lived develop + main, plus feature/, release/, hotfix/ branches; heavy, suited to versioned/on-prem…
- 11 What is a pull request, and what makes a good one? A pull request proposes merging one branch into another and is the place for code review, automated checks (build,…
- 12 What makes a good commit message? A concise summary line (~50 chars, imperative mood — “Add retry to payment client”), a blank line, then a body…
- 13 What is a detached HEAD state in Git? Normally HEAD points at a branch, which points at a commit. In detached HEAD, HEAD points directly at a commit…
- 14 What is git reflog, and how does it save you? git reflog records every time HEAD moved — every commit, checkout, reset, rebase and merge — locally, for ~90 days. So…
- 15 What is Semantic Versioning (SemVer)? SemVer is MAJOR.MINOR.PATCH. Bump MAJOR for a breaking change, MINOR for a backward-compatible feature, PATCH for a…
- 16 What is CI/CD? Continuous Integration — every push triggers an automated build + tests, so integration problems surface within…
- 17 What is a feature flag (feature toggle)? A feature flag is a runtime switch that turns a piece of functionality on or off without a redeploy. It lets you merge…
- 18 What is a remote-tracking branch, and what is an upstream branch? A remote-tracking branch (origin/main) is a local, read-only pointer to where a branch was on the remote at your last…
- 19 How do you ship an urgent production hotfix with Git? Branch from the exact commit/tag that's in production (not from main, which may have unreleased changes), make the…
- 20 What is a .gitignore file, and what belongs in it? .gitignore lists file patterns Git should not track — build output (bin/, obj/), dependencies (node_modules/), IDE…
- 21 What is a Git tag, and what is the difference between lightweight and annotated tags? A tag marks a specific commit permanently — usually a release. A lightweight tag is just a name pointing at a commit.…
No questions match those filters
Try removing a filter or .
About these Git & SDLC questions
Git questions in an interview aren't about memorising commands — they check that you understand the model (commits, branches, the staging area, remotes) and can recover from a mess without panicking. The recurring topics are merge versus rebase and when each is appropriate, resolving conflicts, the difference between reset, revert and restore, and how your team's branching strategy and pull-request process fit together.
The SDLC side extends into code review, CI/CD, semantic versioning and how a change goes from a branch to production safely.