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.

EasyTechnical
90 practiced
Describe the difference between creating a new branch locally and creating/pushing a remote tracking branch. Provide the sequence of commands you would use to create a feature branch, set its upstream to origin, and open a pull request (mention the typical steps on GitHub/GitLab).
MediumTechnical
152 practiced
Explain how to use git blame and git annotate to investigate when a line of code was last changed and by whom. Then discuss limitations of blame (e.g., when history is rewritten via rebase/squash) and strategies to maintain traceability in projects that frequently squash or rebase before merge.
MediumTechnical
78 practiced
Explain how git bisect works and demonstrate, with commands, how to use it to find the commit that introduced a regression in a test suite. Include how you would automate bisecting in CI if the test can be run non-interactively.
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.
HardTechnical
90 practiced
You suspect the remote Git repository has corrupt objects after CI jobs started failing with git errors. Explain the steps you would take to detect corruption, isolate the problem, restore service (e.g., using a mirror or backup), and prevent recurrence. Include commands like git fsck and git clone --mirror in your answer.

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.