The Git InterviewCookbook

Real Git interview questions with model answers, likely follow-ups, and hands-on labs, from everyday commands to branching strategies, security, and Git internals.

Prefer listening? Get the audio answers →
The Git Interview Cookbook cover
4parts
12chapters
25interview topics
20+hands-on labs
What you get

More than a list of questions

Interviewers rarely stop at the first question. This book prepares you for the whole conversation: the answer, the reasoning behind it, and the next question they will ask.

Answers you can say out loud

Each question gets a clear model answer written the way you would explain it to an interviewer.

The follow-up questions

Every topic ends with the questions interviewers ask next, so the second and third question don't catch you off guard.

Hands-on Vagrant labs

Practice exercises run in disposable Vagrant labs, so you can break history and repair it without risk.

Real team workflows

GitFlow, GitHub Flow, and trunk-based development compared, plus how branches map to environments in CI/CD.

Security from day one

Clean up leaked credentials, keep secrets out of pipelines, and sign commits with SSH or GPG keys.

What happens under the hood

Blobs, trees, commits, and the index explained step by step, so the commands stop feeling like magic.

How every recipe works

One topic, four steps

Every topic in the book follows the same structure, so you always know where you are.

The interview question

A real question from DevOps, SRE, and developer interviews.

A worked scenario

A small, concrete example repository that shows the problem.

The model answer

What to say and why, with the commands that back it up.

Follow-ups and practice

Likely next questions, then a lab you run yourself.

Audio answers

Hear the answers, not just read them

Model answers to the book's interview questions, recorded as short audio clips. Listen on your commute or during a walk, and get used to how a confident answer sounds before you have to give one yourself.

Buy the audio answers on Topmate
  • What is Git, and how is it different from GitHub?
  • git fetch or git pull: when do you use which?
  • Merge or rebase: what is the difference?
  • Why does Git have a staging area?
Contents

From first commit to Git internals

Twelve chapters in four parts, ordered the way interview questions usually escalate.

Part 1 · Git essentials
01

Core Git concepts

What Git is, how it compares with SVN, and configuring a repository.

02

Everyday Git workflow

The four places your changes live, daily commands, comparing commits, and tags.

03

Working with remotes

git fetch versus git pull, and cloning compared with pulling.

Part 2 · Branches and history
04

Merging and rebasing

Merge, rebase, squash, and when to use which.

05

Resolving merge conflicts

Why conflicts happen and how to resolve, investigate, and prevent them.

06

Cherry-pick and stash

Backporting fixes and shelving work during interruptions.

07

Undoing changes and recovering work

Reset, revert, force-push, and recovering lost work with the reflog.

Part 3 · Git in teams and delivery
08

Branching strategies

GitFlow, GitHub Flow, trunk-based development, stale branches, and git bisect.

09

From branches to environments

Promoting builds through environments and validating changes with hooks and CI.

10

Hosting and migrating repositories

Mirror migrations, artifact repositories, and making large repositories fast.

Part 4 · Security and under the hood
11

Secrets and signed commits

Leaked credentials, secrets in pipelines, and signing commits.

12

Git internals

What git add and git commit actually write, plumbing and porcelain, and submodules.

Who it's for

Written for people who use Git at work

No prior interview prep needed. If you have used git commit and git push, you are ready.

Job seekers

Preparing for DevOps, SRE, platform, or developer interviews where Git questions come up.

DevOps & SRE engineers

Who run CI/CD and want to explain branching, releases, and recovery with confidence.

Developers

Who use Git every day but want to understand what happens when things go wrong.

Team leads & interviewers

Looking for a structured set of questions and model answers to run interviews.

Maxat Akbanov
About the author

Maxat Akbanov

Senior DevOps, Cloud, and DevSecOps engineer with more than 10 years in systems administration, information security, and cloud engineering. He runs Kubernetes, GitOps, and CI/CD for production systems in retail, FinTech, gaming, and EdTech.

Maxat holds an MSc in Cyber Security from the University of York and runs the KazDevOps Reading Club. He is also the author of The Kubernetes Interview Cookbook, The Linux Interview Cookbook, and The ArgoCD Workshop.

For his full experience, projects, and talks, see his CV.

The book is being written now

Follow progress updates on Ko-fi and be the first to know when The Git Interview Cookbook is released. The audio answers are available to buy now.