GitHub Flow

GitHub Flow: A Lightweight Alternative

GitHub 29 flow, as GitHub documents it, adds one gate to the trunk: every change goes through a pull request. Its six steps: create a descriptively named branch from main, commit, open a pull request, address the review, merge, and delete the branch. main stays deployable, and branches live days, not hours.

Sam starts BookNest's next feature this way, a ?minRating= filter for /api/books:

Starting a GitHub flow branch and publishing itShell
git switch -c feat/min-rating
# Edit app.js: filter /api/books by ?minRating=
git commit -qam "Add ?minRating= to /api/books"
# Edit test/api.test.js: expect books 1, 3 and 5 for ?minRating=4.5
git commit -qam "Test ?minRating="
git push -qu origin feat/min-rating
git log --oneline main..
Output
Switched to a new branch 'feat/min-rating'
...
770239e Test ?minRating=
f14b7a4 Add ?minRating= to /api/books

The trimmed lines are lint-staged 14,736 's progress (Husky Pipeline). Pushing early backs the branch up and opens it for review; on a host the pull request comes next (Pull Requests and Code Review). Here the branch waits for Squash vs Preserve.