I have a git branch B, off of branch master, M, the commit history of which looks like this:
M
\
B1-B2-B3-B4-B5-B6
M is the master branch, and B is the branch I want to split into 2. I want to end up with this:
B'1-B'3-B'5
/
M
\
B"1-B"2-B"4-B"6
The problem is that I want commits related to one set of files (which appeared in commits B1, B3, and B5) in branch B', and I want commits related to another set of files (which appeared in commits B1, B2, B4, and B6) in branch B". As you can see, The files are neatly separated into different commits, except for commit B1.
What is the best, cleanest way to separate branch B into branches B' and B" such that each of the new branches only have commit histories for the needed files?