Skip to content

Version Control with Git ​

Git is the tool in this part you touch every hour of every working day. It is also the one where a shaky mental model costs you the most. The senior version is not a longer list of commands. You know what a commit is, so you can say what rebase, cherry-pick and reset --hard will do before you type them, and how to get back when they do something else.

Chapters ​

#ChapterWhat it answers
01Git Fundamentals and RecoveryWhat is a commit, and how do you get back work you thought you lost?
02Branching, Review and Repository StrategyWhich branching model, what makes a change reviewable, and one repository or many?

What Interviewers Probe For ​

Two Git questions, on top of the part-level signals in the Part VIII opener:

  • Can you recover? "You force-pushed over a colleague's branch. What now?" A senior reaches for the reflog and explains why the objects are still there. Git rarely deletes anything.
  • Do you have a reason for your branching model? Naming GitFlow is worth nothing. Saying that long-lived branches turn merge conflicts into a scheduling problem, and that trunk-based development trades that for feature flags and better tests, is worth a lot.

Reading Order ​

01, then 02. Chapter 02 assumes you can picture the commit graph, because "squash or rebase merge" is a question about what happens to commits.

The whole book, free to read. Generated from the manuscript on every change.

Your progress

Tick each chapter in the sidebar once you have read and understood it. Your name and email keep the ticks on any device.

Your name and email are stored to save your progress. Nothing else is done with them.