How big should a pull request be?
Small pull requests get reviewed faster and more carefully. What "small" means in practice, how to split large changes into reviewable steps, and when a big PR is fine.
On this page
A pull request should be small enough that a reviewer can understand it in one sitting, which usually means one focused change: a single feature step, a bug fix, or a refactor, not all three. There's no universal line count, but if a reviewer needs to block out an hour or reads the description and still can't tell what it does, it's too big. Split large changes into steps that each make sense and pass CI on their own.
Why small pull requests win
- Faster reviews. A small change fits into a review window; a large one gets postponed. See how to review pull requests faster.
- Better reviews. Reviewers read small diffs carefully and skim large ones. Bugs hide in big pull requests.
- Easier to revert. If something breaks, undoing one focused change is simple.
- Fewer conflicts. Short-lived branches drift less from the main branch.
- Steady progress. Merging several small pull requests feels and is faster than waiting on one huge one.
What "small" looks like
Instead of line counts, use these tests:
| Test | Small enough if |
|---|---|
| Purpose | You can describe it in one sentence without "and also" |
| Review time | A reviewer can finish it in one sitting |
| Mixed concerns | It doesn't combine refactoring, formatting and new behaviour |
| Generated files | Lock files or generated code are separate or clearly marked |
How to split a large change
1. Separate refactoring from behaviour. Do the rename or restructuring in one pull request with no behaviour change, then add the feature in the next. Reviewers can check the refactor quickly because nothing should change.
2. Build in layers. Data model first, then the API, then the interface. Each merges on its own.
3. Use feature flags. Merge incomplete features behind a flag that's off, so partial work can land safely.
4. Stack pull requests. Open a second pull request based on the first branch, and so on. Each is reviewed separately. Merge in order.
5. Move unrelated fixes out. Spotted a bug or a typo elsewhere? Separate pull request.
When a big pull request is fine
- Mechanical changes, such as a dependency upgrade or a project-wide rename, where reviewers check the approach and spot-check the rest.
- Generated code or vendored files, clearly marked.
- An emergency fix that can't wait, followed by cleanup later.
Say so in the description: "Large but mechanical: renames X to Y across the codebase; please review the script in the first commit."
Tell reviewers what to focus on
Even a small pull request benefits from a clear description: what changed, why, how to test it, and where to look closely. A draft can gather early feedback on the approach before you've written everything. See draft pull requests on GitHub.
Sizing in your review queue
As a reviewer, size is one of the first things to check when picking what to review. OneNotch's GitHub screen lists pull requests waiting for your review with their check summaries; press V to open a pull request's changes on GitHub and see its size, then decide whether it fits your current review window. See code review best practices on GitHub.
FAQs
Is there an ideal number of lines for a pull request?
No fixed number works for every codebase. Aim for one focused change a reviewer can understand in one sitting.
How do I stack pull requests on GitHub?
Create each new branch from the previous one, and set each pull request's base to the branch before it. Merge them in order.
What if splitting would leave the code broken?
Use a feature flag, or split so that each step compiles and passes tests, even if the feature isn't visible yet.
Should refactoring and features be in the same pull request?
Separate them where you can. Pure refactors are much quicker to review on their own.