Member-only story

How to split a giant pull request into smaller ones

Do it like a pro, with step-by-step git commands.

6 min readOct 28, 2024

--

A gigantic pull request (PR) is dreadful for both the author and the reviewers. Huge PRs can lead to prolonged review times, increased chances of bugs, and difficulty in understanding the overall changes.

It is not difficult to agree in principle that a gigantic PR should be split into smaller ones, for smoother collaboration. However, in practice, one common problem is not everybody actually know how to split a PR.

Could this have been avoided with better planning?

Yes, but not always. Even the most experienced programmer could found him/herself in this mess.

The most common situation why a PR became so big is “Someone was trying to do task A, which needs B, then C has to be changed, one thing led to another …”.

The next moment you realize is you end up with 30 files changed, and maybe 30 commits (if you are one of those frequent committers).

One of such branch from my own work

And this article written for someone who want to get out of that mess…

--

--

Krist Wongsuphasawat
Krist Wongsuphasawat

Written by Krist Wongsuphasawat

Data Experience @airbnb / Prev: Turn data into pixels @twitter • Invent new vis @UofMaryland HCIL PhD • From @Thailand • http://kristw.yellowpigz.com

No responses yet