Split a large Pull Request into multiple smaller ones
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Sometimes a pull request can get quite large, be it by the amount of files added or commits containing too much code to be reviewed, and it's useful to have a way to split it into smaller tasks for your reviewers so that they can focus on specific portions of it or work on it simultaneously, with each reviewer taking care of one of the smaller tasks. This article explores a way to split that large Pull Request into multiple smaller ones using git cherry-pick for the process below:

Environment
Any repository that contains a pull request that has been deemed too large to review, be it because it has too many files, conflicts, or code, or for any other reason, it might be helpful to split it into smaller tasks.
Solution
To break out a PR in several smaller ones, follow the steps below:
First we want to checkout to the main branch by using the command below:
1
git checkout <branch name>
Create a new branch that will be the destination for the new, smaller PR:
1
git checkout -b <new_branch>
Use git cherry-pick to separate a subset of commits (eg. regarding some refactoring):
1
git cherry-pick <commit_id_1> <commit_id_2>
Create a Pull request
Instruct your reviewers to focus solely on this PR.
After this is merged, update base Pull Requests. There’s less code to check now.
Repeat 2-5 until there’s minimal code on the base pull request (or no code at all).
Was this helpful?