Instiq
Chapter 2 · Working with Repositories·v1.1.0·Updated 6/15/2026·~7 min

What's changed: Expanded content (added diagrams)

2.4GitHub Flow (the basic delivery pattern)

Key points

Learn GitHub Flow, a lightweight branching pattern for individuals and teams: create branch → commit → Pull Request → review → merge → deploy, and what each step means.

How do you combine the tools you have learned (branches, commits, Pull Requests) in real development? The standard, lightweight pattern is GitHub Flow. It has no heavy rules—just a flow for delivering changes small and safe.

2.4.1The six steps of GitHub Flow

Diagram showing the GitHub Flow steps proceeding left to right: create branch, commit, Pull Request, review, merge, deploy.
GitHub Flow: from creating a branch to deploying
  1. Create a branch: branch a short-lived feature branch off main.
  2. Commit: record changes in meaningful units.
  3. Pull Request: propose the change and start discussion/review.
  4. Review / discuss: incorporate feedback and pass automated CI checks.
  5. Merge: once approved, integrate into main.
  6. Deploy: ship the contents of main.

2.4.2Why this pattern works

  • Keeps main always deployable.
  • Changes stay small, making them easy to review and safe.
  • PRs preserve discussion and history so you can trace decisions later.
  • Combined with CI, you get automated checks before merge.
Tip

Keep branches small and short-lived, and open PRs frequently. Smaller PRs are faster to review and merge, and less prone to conflicts.

Warning

As a rule, do not push directly to main (you can enforce this with branch protection). Long-lived branches drift from main and cause conflicts.

Exam point

Common points: the GitHub Flow order (branch → commit → PR → review → merge → deploy), "keep main always deployable," and "integrate via short-lived branches and PRs."

2.4.3Section summary

  • GitHub Flow = create branch → commit → PR → review → merge → deploy
  • Keep main always deployable; do work on short-lived feature branches
  • Do not push directly to main; integrate through PRs and review

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. What is the first step of GitHub Flow?

Q2. Which correctly describes how main is treated in GitHub Flow?

Q3. What should changes pass through before being merged into main?

Check your understandingPractice questions for Chapter 2: Working with Repositories