Splitting Big Fat Pr

Today we will be discussing how we can split up a big pr into multiple smaller pr’s. Since smaller pr’s has its own advantage like -

  1. Easy to review
  2. Easy to test
  3. Easy to understand the core concept of the pr

Big fat Pr’s can be avoided if the task is planned well, so that from the initial phase onwards all the tasks were broken down into smaller Pr’s.

but what if you missed the opportunity to plan your tasks well and created a big fat pr.

Do not worry,

github is there for the rescue.

 

Photo by Roman Synkevych on Unsplash

Let’s take an example —

Suppose you have a Pr consists of 3 files , we will name this as main pr

1. mainScript.js --- +29   // lines of change
2. logger.js ----   +500  // lines of change
3. background.js --- +130  // lines of change

Now, the first task would be to identify the independent changes which we can separate out in a different Pr, in our case it’s the logger.js .

So how can we separate out the logger.js from the main pr?

  1. create a child branch from the main pr, we will name this as logger pr
    Since this is a child branch of the main pr it will contains all the changes of its parent.

 Read More