How to split one pull request into two different github submit requests

How can I split a single click request into two pull requests? I have committed ten times in a one-off request and I want to split them into two different pull requests because the first six commits are unrelated to the last four commits. I am using Ubuntu os with git. Since I am new to git, I am wondering how to enter git commands step by step to get it done. Any advice would be much appreciated.


source to share

1 answer

You basically have a duplicate Splitting the branch into 2 The graphs there are nice so no need to duplicate them.

First create a second branch pointing to your 6th commit

git branch branch2 HEAD~4



git branch branch2 COMMIT_6_SHA


branch2 is now ready and ready to create a pull request for the first 6 commits.

Now you want to use git rebase --onto

to move your existing branch along with the other 4 commits so that they hang from your upstream

git rebase --onto @{u} branch2


What is it.



All Articles