Course · 40 chapters
Git & GitHub Mastery
A complete course on Git and GitHub in 40 chapters: the data model, everyday commands, merge and rebase, recovery, GitHub pull requests, Actions and security, large repositories, incident response and interview preparation.
Volume 1 of 4: Foundations and the Git data model
- 1FundamentalsA deploy pipeline goes red on a Friday evening. The engineer on call says the fix is committed and can show the commit on screen. The pipeline fails again on the same line. Your CTO asks three questions:30 min read
- 2The Mental ModelAn evaluation report from three weeks ago says that its numbers were produced "at commit 2e76f67". Today the numbers are disputed, and your CTO asks:27 min read
- 3Git InternalsFour questions a CTO can ask on an ordinary day: None of these can be answered with the commands of the other chapters alone. They are questions about how Git stores things. Chapter 2 gave you the model: four object types, names that point at them, a staging area.44 min read
- 4The Working TreeThree questions a CTO can ask after an ordinary week: None of these is about commits, branches or GitHub. All three are about the working tree, the part of Git that most tutorials treat as too plain to explain.33 min read
- 5The IndexThree questions a CTO can ask: The three share one root. Git does not build a commit from your files. It builds it from the index, a second complete record of the project that sits between the working tree and HEAD.27 min read
- 6CommitsThree questions a CTO can ask about one week of history. None of the three is a bug. (1) A commit ID is the hash of the whole commit object, and that object contains the moment the commit was created.22 min read
- 7BranchesThree questions a CTO can ask after an ordinary week. All three are questions about refs, and none has a Git command as its answer. The commits exist and are recoverable from the reflog (section 7.7, Lab 4.2).28 min read
Volume 2 of 4: Integration, undo, remotes, recovery and advanced Git
- 8MergeThree questions a CTO can ask after an ordinary release week: The answers are in sections 8.15, 8.16 and 8.18. None needs a bug in Git. Each follows from what a merge is.45 min read
- 9RebaseFour questions a CTO can ask after a week in which someone rebased: All four have precise answers, and all four answers start from one fact: a rebase does not move or change commits. It writes new commits and then moves a ref. The old commits are still in the object database.46 min read
- 10Cherry-pickThree questions a CTO can ask about a maintenance release: The answers come from one fact. A cherry-pick does not move or reuse a commit. It recomputes the change that a commit made and records that change as a new commit, with a new ID, on the branch you are on.20 min read
- 11Reset, Revert, RestoreThree questions a CTO can ask in the hour after something went wrong: All three are undo questions, and undo is where Git costs its users the most time.33 min read
- 12Remote OperationsThree questions a CTO can ask in the same week: Neither is wrong: the push named a branch that had nothing new (section 12.14). The lease was satisfied by a fetch that nobody looked at, and the commit still sits in places you can name (section 12.8).45 min read
- 13RecoveryIt is 18:40 on a release day. An engineer on your team writes in the incident channel: "I ran a reset and three days of work on the reranker are gone." Your CTO asks you two questions, and neither of them is "which command do we type". The first is "can we get it back?".45 min read
- 14AHistory investigationFour questions a CTO can ask on a Tuesday morning: None of these is answered by scrolling through git log. Each is a query, and Git answers three kinds:48 min read
- 14BConfiguration, Aliases, Tags and SigningFour questions a CTO can ask in one release week. The first two are configuration: Git assembles its behavior from several files, the command line and the environment (sections 14B.2 to 14B.7). The third is a tag that was moved after it had been published (sections 14B.8 to 14B.14).38 min read
- 14CStash Internals, Rerere, Attributes, HooksFour questions a CTO can ask, one for each part of this chapter: The four topics share one design decision. A repository holds content that is versioned and travels with clone, fetch and push (commits and the files in them, such as .gitattributes), and machinery that is local and never travels…37 min read
- 14DThe FrontierThree questions a CTO can ask in the next twelve months: Short answers. The planned changes of Git 3.0 are defaults for newly created repositories and the removal of a few long-deprecated features; existing repositories keep their formats, and no official date exists (sections 14D.2 and 14D.3).21 min read
Volume 3 of 4: GitHub, GitHub Actions and security
- 15GitHubFour questions a CTO can ask, none of which is about a Git command: The answers: no, and the commit is reachable through your own repository's URL (section 15.7). Both are, because a release and a tag are different objects made by different programs (section 15.12).40 min read
- 16AuthenticationFour questions a CTO can ask the morning after: Neither is wrong: the job's credential cannot see the repository, and GitHub answers "not found" on purpose (section 16.19). GitHub has not accepted account passwords for Git since 13 August 2021 (section 16.3).35 min read
- 17Pull RequestsFour questions a CTO can ask in one week: Each is answered by knowing which part of a pull request is Git data, which part is a GitHub object, and which commits GitHub compares when it draws the page. The answers are in sections 17.12, 17.2, 17.8, and 17.2 again.43 min read
- 18Branch Protection and RulesetsThree sentences you will hear from a CTO after an incident: Chapter 17 ended with a list of controls that are only advisory: a "changes requested" review, a red check, a CODEOWNERS file. This chapter is about the layer that makes them binding.35 min read
- 19CODEOWNERS"We have a CODEOWNERS file. How did a change to the deployment workflow merge without the platform team seeing it?"15 min read
- 20AGitHub Actions FundamentalsFour questions a CTO can ask about one pull request: None of these is answered by knowing YAML keys. Each is answered by knowing what a runner has on disk and in its environment when your command starts: which commit, how much history, which shell with which flags, which token, which variables.42 min read
- 20BGitHub Actions: delivery, runners, cost and debuggingChapter 20A taught the parts of a workflow and built eight of them. This chapter uses those parts to deliver software, and then teaches the skill a CTO pays for: finding out why a run failed, in a fixed order, with evidence.38 min read
- 21AGitHub Actions securityThis chapter is defensive. It shows unsafe workflow patterns next to their fixes, at the level of detail GitHub's own security documentation uses, so that you can review and harden your team's workflows. It contains no working attack.40 min read
- 21BRepository security, identity, the Git client, and secret-leak responseA CTO asks four questions after a security scare, and none of them is about a command.49 min read
Volume 4 of 4: Scale, professional practice, production, and reference
- 22Git LFSQuestions that reach a CTO's desk in an AI/ML team: The first two are Git doing what it was designed to do with content it was not designed for. The third is Git LFS working as designed on a machine that does not have it. The fourth is how GitHub accounts for LFS.24 min read
- 23Submodules and SubtreesFour reports from one week on a team that vendors a shared library: A CTO who hears these asks two things: why does this mechanism fail so often, and should we be using it at all?28 min read
- 24MonoreposFour questions a CTO can ask in one planning meeting: The answers, in order. A monorepo exchanges coordination across repositories for tooling inside one (section 24.2).22 min read
- 25WorktreesThree situations, each of which ends with someone asking you what to do: The usual answers are a second clone, or a stash and a branch switch. A second clone costs a full copy of the object database and has to be fetched and kept in sync separately.17 min read
- 26PerformanceFour questions a CTO can ask: The answers. Neither: slow commands map to specific kinds of size, and each kind has a remedy that changes no history (sections 26.2 to 26.9). History questions break, silently: versions, blame, merge bases; a partial clone is usually what was wanted (26.11 to 26.13).31 min read
- 27Open source and team workflowsFour questions a CTO can ask, none of which is about a command: Every answer in this chapter comes from two facts you already have.43 min read
- 28AI/ML workflowsFour questions from a CTO to the engineer who owns the model repository: Each has a cause you can name by the end of this chapter. The run was made from a working tree with an uncommitted change, and the tracker recorded only the commit (section 28.7).43 min read
- 29Production TroubleshootingA CTO does not ask "which command fixes this". The questions are: what happened, how do you know, what will the fix change, and how do we stop it from happening again. Every earlier chapter gave you one mechanism.38 min read
- 30Incident ResponseAt some point a message like this arrives: "main is broken, the release is in an hour, and nobody knows what happened." The CTO does not want a command. The CTO wants four answers: what happened, how you know, what you changed and how you proved it worked, and why it will not happen again.41 min read
- 31Interview PreparationYou already have the material: thirty chapters, the labs, and a question bank with model answers. This guide is about the last step, which is saying it aloud to someone who will not help you. It covers:43 min read
- 32CapstoneThis is the last piece of work in the course. You join a small team for eight working days. On each day something goes wrong in or around the team's repository, and you are the person who is asked to sort it out. Nobody tells you the cause.10 min read
- 33Cheat SheetsGit 2.55.0. 🟢 reads or only adds · 🟡 moves refs, recoverable through the reflog · 🔴 can destroy work or the safety net. Every command was run in this book's labs. Details: disaster-recovery playbook.41 min read
- 34GlossaryUse it in three ways. Look a word up when a chapter, an error message or a colleague uses it. Read one letter before a mastery gate and say each definition aloud before you read it.41 min read
- 35ReferencesGitHub-side facts carry dates because the platform changes: before you rely on a limit, a price, a plan gate or a label, open the linked page. The re-verification calendar is section 10 of the roadmap.46 min read