โ—€ Playbook index
NO.8.8

๐Ÿ”€ Pull Requests

Updated: 2026-07-22

In one line

When you write code, there are several ways to branch and merge. This chapter tours the main ones.

Whichever you pick, everyone goes through a Pull Request to merge. We'll break down what a PR contains, and how all of this can be enforced with Rulesets.

Branching strategies

How a team organizes branches around PRs. Pick the model that matches your release cadence.

StrategyHow it worksBest for
๐ŸŒฟ GitHub FlowOne main + short-lived feature branches; PR โ†’ merge โ†’ deploy from mainContinuous delivery, most teams
๐ŸŒณ Git Flowmain + long-lived develop, plus feature / release / hotfix branchesScheduled, versioned releases

๐Ÿ’ก Default to GitHub Flow for speed; reach for Git Flow only when you ship versioned releases.

GitHub Flow

One long-lived branch (main), short-lived feature branches. Branch off main, open a PR, review, merge, and deploy โ€” continuously. Simple and fast; ideal for web apps and small teams shipping many times a day.

change main change change
  • ๐ŸŒฟ Branch from main for each change (feature / fix)
  • ๐Ÿ”€ Open a PR early โ€” review and CI run on the branch
  • โœ… Merge to main, then deploy immediately
  • โ™ป๏ธ main stays always deployable

๐Ÿ’ก Fewer moving parts = faster feedback. The default for continuous delivery.

Git Flow

Two long-lived branches (main + develop) plus supporting branches. Work integrates on develop; a release branch stabilizes a version, then merges to main and gets tagged. Structured for scheduled, versioned releases and larger teams.

main hotfix release develop feature feature v0.1 v0.2 v1.0
  • ๐ŸŒณ develop = integration line ยท main = production (tagged)
  • ๐Ÿงฉ feature/* branches off develop, merges back
  • ๐Ÿ“ฆ release/* stabilizes โ†’ merges to main + develop, tags the version
  • ๐Ÿš‘ hotfix/* off main for urgent prod fixes โ†’ merges to both

๐ŸŽฏ More ceremony, more control. Reach for it when you ship versioned releases, not continuous deploys.

Inside a review

Today a PR can be opened by a human, a cloud agent, Dependabot, or an agentic workflow. On the diff, conversation, checks, and automated analysis converge: the place where quality is secured before merge.

ElementRole
๐Ÿ”€ Propose diffCompare branches, request merge
๐Ÿ’ฌ ReviewLine comments, approve/reject
๐Ÿค– Copilot code reviewAI auto-reviews every PR
โœ… Tests / CIRequired status checks must pass
๐Ÿ›ก๏ธ Code Scanning (GHAS ยท Code Security)CodeQL finds security vulnerabilities
๐Ÿ“Š Code Quality (standalone product)Maintainability & reliability analysis (billed separately)

๐Ÿ”‘ Closes #123 in a PR โ†’ the Issue auto-closes on merge.

Rulesets

Rulesets enforce merge conditions as rules, a quality gate on your branches. Configure them at the organization or repository level, and apply them top-down across many repos.

Minimal recommended setup:

RuleRecommended settingWhy
๐Ÿ”€ Require a pull request before mergingON + Required approvals: 1Block direct pushes; every change gets at least one review
๐Ÿ›ก๏ธ Require status checks to passRequire tests + Require branches to be up to date before mergingMerge only when CI is green and validated against the latest main
๐Ÿ” Require code scanning resultsRequire CodeQL results (block by severity)Stop merges while unresolved security alerts remain
๐Ÿ”’ Block force pushesONPrevent destructive history rewrites
๐Ÿค– Automatically request Copilot code reviewONCopilot pre-reviews every PR automatically

๐ŸŽฏ Stop manual gatekeeping; let rulesets enforce top-down.

โ˜… PRs in the AI era

With AI shipping PRs en masse, some ask โ€œare PRs still needed?โ€ But to keep a repo understandable and safe, this gate is necessary.

  • ๐Ÿค– Copilot auto-review catches issues early
  • ๐Ÿ“ˆ ~90M merges/month in 2026 (~2x)
  • ๐Ÿ‘€ Humans approve, AI does the prep

๐Ÿ’ก Guard the PR and go faster = Rulesets ร— Copilot.