InterviewStack.io LogoInterviewStack.io

Git and Version Control Questions

Comprehensive knowledge of Git and general version control concepts, including distributed repository fundamentals, local versus remote repositories, the staging area, commit history, and common Git commands for cloning, committing, branching, merging, pushing, and pulling. Practical skills in branching and code flow strategies such as feature branching, trunk based development, Git Flow, and GitHub Flow, including when and why teams choose each strategy, their trade offs for release cadence and team size, and how they affect continuous integration and continuous delivery pipelines. Proficiency with merge strategies and conflict resolution, rebasing versus merging, pull request and code review workflows, integrating version control with automated pipelines and code quality checks, and troubleshooting common Git issues and merge conflicts.

MediumTechnical
92 practiced
Explain submodules vs git subtree. Describe how you would add a shared utility repository as a submodule and as a subtree, including commands for common tasks (update, push changes upstream, remove). Discuss which approach is better for CI and why.
HardSystem Design
147 practiced
A large monorepo hosts dozens of services and the CI pipeline runs full test suites for each PR, creating long queues. Propose a scalable CI strategy using Git features and other tooling (e.g., path filters, build matrices, caching, remote caching). Explain how to determine which tests to run per PR and how to validate cross-service changes.
MediumTechnical
80 practiced
You are troubleshooting why a CI job that runs on pull requests does not trigger for forked repositories. Describe potential causes related to Git hosting configuration and CI settings (webhooks, permissions, token scopes) and a step-by-step troubleshooting checklist to restore PR CI triggers for forks while protecting secrets.
EasyTechnical
103 practiced
Describe the difference between git reset --soft, --mixed (default), and --hard. Provide an example scenario (with commands) where you would use git reset to undo a local commit vs when you'd prefer git revert for a public commit.
HardTechnical
74 practiced
You need to remove API keys and large binary files that were accidentally committed several commits ago. Describe a detailed migration and communication plan using git filter-repo or BFG to rewrite history, how to rotate keys, coordinate re-clone among contributors and CI, and how to keep the repo reachable during the cutover.

Unlock Full Question Bank

Get access to hundreds of Git and Version Control interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.