Here's an operation that's trivial in Perforce and seems nigh impossible in Git, but let's see. Situation: Pull Request with six files, call them: A, B, C, X, Y, and Z. None of this is merged to master, but the local branch has been pushed to the remote (Github if it matters).
There are many, many commits that touch any and all of these files. Some commits touch only one file. Some touch all six.
I want to create two new PRs. One PR contains files A, B, and C with all the changes from all the commits. The other PR contains X, Y, and Z with all the changes to those files from all the commits. I don't care what happens to the commit history or branches. All commits will be squashed before merge and all work branches will be deleted.
I was in a similar situation as you and this is what I did :-
main, run git reset --soft main. This will delete all your commits in your feature branch. But all the changes that you did in those commits will stay as unstaged files.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With