While cleaning up (i.e. mostly squashing) the history of some bigger feature, I often end up with the following situation:
Commit A:
- change A.1
- change A.2
- change A.3
// EDIT: maybe some more commits
Commit B:
- change B.1
- change B.2
- change B.3
Suppose that now I want to move change B.1 to commit A using an interactive rebase. The only way I have found so far to do this, is:
- Start
rebase -i - Edit commit B
- Split commit B in tmp commit and commit B (
reset HEAD^and thenadd -p) - Start
rebase -i - Fixup tmp commit in commit A
This requires two rebases and is pretty cumbersome. Also I have to rewrite the commit message of commit B when splitting.
Is there any better/more efficient way to achieve this?