"git rebase --interactive HEAD~10" will bring up a $EDITOR window with the last 10 commits listed. You can rearrange them, squash them into each other, delete some entirely. Save the file, and git will happily rewrite history for you.
See this blog post for a little more detail: http://blog.madism.org/index.php/2007/09/09/138-git-awsome-n...
[alias]
magic = rebase -i HEAD~10
Then you can just use 'git magic' instead of writing the full command.Then again, I have an alias "git cia" for "commit -a"... Just remember where to look it up if you need something more elaborate.
I always use
git rebase --interactive origin/master
That only shows me commits that are local.It's always seemed so much effort than it's worth.
Besides, isn't it better to keep a history of what actually happened? Something about being doomed to repeat it comes to mind...
That's only useful for me, during tight development loops, not to a historian looking back at what I actually did. So before I push to others, I squash it to a changeset, possibly keeping all the commit messages in the single commit.
That way you can branch at any point in the commit history and be sure it'll run cleanly or cherry-pick a change without having to remember everything that it might depend on. And you get exactly what you want and nothing more.