The "Test Code Before You Commit" rule suggests that the writer does not distinguish between committing code and pushing code, between private changes and public changes. When you commit changes locally, you can always rebase to your heart's content before pushing.
I think this says it best: "Treat public history as immutable, atomic, and easy to follow. Treat private history as disposable and malleable." https://sandofsky.com/blog/git-workflow.html