To add to what VonC answered, it depends on how many commits you have.
What happens to me most often is something like this:
- Work on A, commit
- Work on B, commit
- Oh no! I missed something important in A, fixed a fix for A
With interactive permutation, it is trivial to reorder and then dig the patch into the original commit for A.
Another example is when I just want to rewrite the commit message.
Another example: when I have something like this
A
and I want to include C and D, but not B in master. I can use rebase to reorder my branches to C, D, B, then git checkout master and git merge D
source share