I have one branch which has many unnecessary commits so I would like to branch from it to a version with clean history.
This is example:
Master:
commit1
commit2
commit3
BranchB:
commitB1
commitB2
commitB3
commitB4
commitB5
commitB6
After merge:
commit1
commit2
commit3
commitB1
commitB2
commitB3
commitB4
commitB5
commitB6
Instead of that I would like to have something like this:
commit1
commit2
commit3
commitB6
Is it possible to clone all the code from branch B (state after commit B6) and copy it to a new branch C with a new commit message?