I have a monolith of a feature branch. Instead of one massive PR into master I would like to split it up into 3 prs.
Ideally I want to pull out some standalone code from the feature branch into a PR by itself. This code is in a new directory and isn't called into yet so it would be a relatively safe PR. However instead of just copying the directory and creating a single commit and PR I would like to retain all the commit history of the changes for the new PR.
Is this possible using Git? I've looked into filter-branch but it seems like that is for splitting a repo into two, not for splitting a diff of changes into two (if that makes sense).
Github pull requests always concern a branch. If you want to "split a pull request", make sure it is split well-enough into commits, and then make a branch for each pull request you want to make and make sure each such feature branch has all the relevant commits.
It looks like a good strategy for you might be to create 3 branches next to your main branch, cherry-pick the relevant commits to each branch, delete them on main, and have main merge with each of the three branches. Then you could have a PR for each branch and shared history too.