Module 07 · DevOps · CI/CD, IaC & Operations · about 16 min to read
Continue where you left off ×
Git for a team: trunk, protection, bisect and monorepos
IaC and GitOps · Open board
The board where “deploy = merge a PR” and “main is the desired state” sit side by side. This lesson is about the habits that keep main safe to deploy when many people push to it every day.
Before you start. Git: the ledger every change signs (commits, branches, merge and rebase) showed that a commit is a full snapshot with a hash, that a branch is a small file holding one commit hash, and that merge joins two lines while rebase recopies commits. The Assembly Line (CI/CD) gave you the pipeline that runs checks on every commit and builds one image. Shipping without fear: rolling, blue-green, canary and flags gave you feature flags, a switch in the code that turns a new feature on or off without a new deploy. Here we use all three.
The idea in 30 seconds
Short branches (a day or two) mean fewer changes to reconcile at merge time, and feature flags hide unfinished work on main.
Laptop hooks give fast feedback and can be skipped. A protected branch enforces the rule on the server.
A good review flow is small pull requests, required checks, and one commit per reviewed change.
git bisect run finds the first bad commit in about log base 2 of the commit count runs, 10 runs for 1,000 commits.
git cherry-pick -x copies one fix to another branch as a new commit and records where it came from.
A monorepo trades one-commit changes across projects for the need to run only the checks that a change affects.
Read the story
Lesson 54 of 70 in DevOps
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson 5:10 pm: main is red and 30 changes landed today Keep branches short: trunk-based development Keep main clean: protected branches and hooks The review flow that goes with it Finding the bad commit: bisect Moving one fix to another line: cherry-pick One repository for everything: the monorepo Terms it explains: Trunk-based development, hook, protected branch, Bisect, cherry-pick, monorepo, Common mistakes, IaC.
Review DevOps
Mark as read Saved in this browser, and to your account when you sign in.