Reputation: 607
How can I split commits in one pull request between two pull requests?
I tried to find such feature on GitHub, but I wasn't able to find even how to remove a commit from the pull request.
Upvotes: 1
Views: 2384
Reputation: 607
The answer is that it's not possible. Separate branches should be used for separate pull requests.
Upvotes: 2
Reputation: 11791
Assuming you have both branches locally, you can use cherry-pick (see git cherry-pick --help
, perhaps use gitk
judiciously to identify what you want) to add individual commits from one branch to the other.
Afterwards you can rewrite history (reorder commits, delete some, squash them together, fix them, ...) using e.g. rebase (git rebase --help
). But be very careful, you can't undo rewriting later. It also leads to you having a different history than everybody else, they will have to force getting the rewritten history. I'd create a new branch off the tip of the branch to be mangled, if redoing that goes south you can go back to the original; else delete the original and rename the new one over it.
Upvotes: 1