Chapter 2 of 7 · 4 practices · 2 min · 3-question quiz
Branches and pull requests
A branching flow that keeps the main branch releasable and pull requests easy to review.
Start: Work on short-lived branches off main4 practices in this chapter
- 1Work on short-lived branches off mainLong-lived branches drift away from main, collect painful conflicts and delay feedback. Short ones stay easy to merge and easy to review.
- 2Keep pull requests small and focusedReviewers give careful feedback on a 150 line change and skim a 1,500 line one. Small pull requests get reviewed faster, catch more bugs and are easier to revert.
- 3Write a pull request description that explains what, why and how to testThe description is where the reviewer starts, so it decides how quickly and how well your change gets reviewed. Cover three things: What the change does; Why it is needed; How you tested it
- 4Protect the main branch and require checks before mergingRules on the server stop the most common accidents, such as pushing straight to main or rewriting its history, in a way a team agreement cannot.
Check yourself on this chapter
3 questions, right here once you are signed in. Your progress is saved as you read.