squash multiple versions into one

How do you squash multiple versions down into one, for instance, right before submitting it as a patch?

Three options: 1) git add --ammend, 2) rebase, and 3) git merge --squash.



splitting one commit into several

rebase -i

add --patch

fugitive.vim is awesome for this

reorder commits

rebase -i


Good advice: "you should not rewrite history for things that are already push out into the world"