Lesson 34 +20 XP

GitHub Flow

GitHub Flow

GitHub Flow is a simple branching strategy that many teams use. It has just a few rules.

The core idea

  • Everything lives on main, and main is always deployable.
  • You never work directly on main.
  • Every change happens on its own feature branch.
  • Changes get reviewed through pull requests.

The GitHub Flow steps

  1. Create a branch off main.
  2. Make your changes and commit them.
  3. Push the branch to GitHub.
  4. Open a pull request.
  5. Discuss and review the changes.
  6. Merge the pull request into main.
  7. Deploy main.

Why it works

Because main is always stable, the team can release anytime. Feature branches keep experiments separate, and pull requests make every change visible and reviewed.

Short lived branches

Feature branches in GitHub Flow are short lived. They exist for one feature or fix, then get merged and deleted.

TL;DR

  • GitHub Flow: branch, change, push, pull request, merge.
  • main is always deployable.
  • Never commit directly to main.
  • Feature branches are short lived and merged via pull requests.